The-Python-Graph-Gallery icon indicating copy to clipboard operation
The-Python-Graph-Gallery copied to clipboard

Adding Plotnine graphs

Open votti opened this issue 6 years ago • 6 comments

Hi there, thanks for providing this useful resource!

Half a year ago I was really excited to find https://github.com/has2k1/plotnine , the first really usable ggplot2 implementation in Python. The implementation is so close to ggplot2 that one can even use the ggplot2 tutorials and manual almost 1:1.

The gallery provides many nice examples of the usage: https://plotnine.readthedocs.io/en/stable/gallery.html Maybe it would be helpful to add these examples to the Python graph gallery?

votti avatar Apr 06 '18 19:04 votti

Hi votti, Thanks for this suggestion. I have to study this library more in depth, it looks very promising. Thanks!

holtzy avatar Apr 06 '18 22:04 holtzy

I just remembered that there is even another repository with plotnine examples: https://github.com/has2k1/plotnine-examples/

votti avatar Apr 06 '18 22:04 votti

I'm reaching the end of the bandwidth I had to update the gallery and did not find time for the plotnine library, so I'm gonna close this old issue :(

holtzy avatar Feb 27 '21 20:02 holtzy

Two more usage tutorials for plotnine in case you ever want to revisit this topic:

  • https://github.com/cmparlettpelleriti/CPSC392ParlettPelleriti/blob/master/InClass/LectureNotebooks/Visualization%20I--Class%204.ipynb
  • https://github.com/cmparlettpelleriti/CPSC392ParlettPelleriti/blob/master/InClass/LectureNotebooks/Visualization%20II--Class%205.ipynb

I'd be interested to contribute plotnine impl. of certain basic figures if there is interest (as measured by the number of thumbs up on this comment).

ivanistheone avatar Jun 16 '21 03:06 ivanistheone

Hi @ivanistheone, thanks for your comment.

As stated before, I would be very keen to add some plotnine examples to the gallery. I just don't have the bandwidth for it yet.

If you feel like contributing (that would be awesome! 😄 ), it would be cool to have a translation of any of the R graph gallery ggplot2 blogpost in plotnine. The post in the python graph gallery are just jupyter notebooks, so building PRs should be relatively straightforward.

Example: density chart, histogram and so many others..

Otherwise I keep it in mind for when I will have more time on the project!

holtzy avatar Jun 17 '21 08:06 holtzy

Is there a contributing guide somewhere?

I'm slowly getting around to looking at plotnine (I'm a beginner, but there are so many examples and this project has nice tooling so I want to try adding some basic charts just to get some practice with it).

I was looking to start with a boxplot, and I see each thumbnail is a link to a notebook:

          <ChartImageContainer
            imgName="33_Custom_Boxplot_color_Seaborn5"
            caption="Everything you need concerning color customization on your boxplot: transparency, palette in use, manual control.."
            linkTo="/33-control-colors-of-boxplot-seaborn"
          />

where the image is in static/graph folder and the linkTo is this notebook, but Q1: how was the image name 33_Custom_Boxplot_color_Seaborn5.png generated?

I'm guessing the 5 is an auto-incrementing, i.e. fifth graphic in the notebook, but where did 33_Custom_Boxplot_color_Seaborn come from?

The notebook has slug = 33-control-colors-of-boxplot-seaborn in the metadata section at the end of the .ipynb json, so that doesn't seem to be it.

Q2: Is there a build system for the notebooks that extracts all the graphics and put them into static/graph?

Any pointers and tips for getting started will be much appreciated.

ivanistheone avatar Jul 02 '21 13:07 ivanistheone

Hi @ivanistheone @votti

I'm back with bandwidth to work on the gallery.

  • I took another look at plotnine and it definitely makes sense to add examples to the gallery.

  • I am currently documenting the process to add new examples in the repo Wiki

  • Q1 -> The images you see in the gallery are hand-made.

  • Q2 -> NO, I do it by hand

Thanks!

holtzy avatar Jul 20 '23 08:07 holtzy

Closing now as we're in the process of adding examples with @JosephBARBIERDARNAL

holtzy avatar Mar 22 '24 10:03 holtzy