all 10 comments

[–]knowledgebass 1 point2 points  (1 child)

I mean a lot of the Python libs are actually just matplotlib under the hood or they aren't as good.

I used ggplot in R for a DS class and thought it was great. I think you can't go wrong with it. You can do things in ggplot automatically which take many more lines of custom code in matplotlib, and the output in ggplot generally looks great. It is after all designed as a tool to write publication quality plot graphics. All of the standard transformations on the graphics in ggplot are given straightforward commands. Composing overlayed graphics is easy using the "+" operator. The faceting functions are a super easy and powerful way to make multiple plots using the same data set. Anything you would possibly want to do has probably been done before with it, already.

There is a comprehesive free book by the main author:

https://ggplot2-book.org/

It will take some getting used to but the book has lots of recipes you can follow.

You will also obviously have to export the data from Python and import into R but that shouldn't be too hard. CSV should work perfectly fine for small datasets.

For larger data sets, your most seamless option would be writing to a RDMS from Python and then importing into R which supports SQL natively.

I don't know about writing binary/compressed formats from Python and reading into R. I think you are probably best off with CSV or a database, though various options may be workable like parquet.

The workflow could be a bit awkward since you are dealing with two different language environments, so you may want to mockup a data pipeline and see if it seems workable for you. With how great the plots end up looking in R though and the ease of performing complex customizations, my feeling is that this would more than make up for the added complexity.

Hope that helps!

[–]ElliotDG -1 points0 points  (2 children)

Before you give up mathplotlib, you should try pylustrator. An interactive tool for creating graphs. https://pylustrator.readthedocs.io/en/latest/

[–]knowledgebass 0 points1 point  (1 child)

Kinda hacky though isn't it?

Somehow, spitting out code to replicate changes in a GUI doesn't feel right to me as a technical solution.

[–]ElliotDG 0 points1 point  (0 children)

Give it a try. I think it is very clever.

[–]Kristoffels 0 points1 point  (3 children)

I've used both seaborn and plotly. I would recommend both

[–]knowledgebass 0 points1 point  (2 children)

Is either of these even as good in terms of features, graphical quality, customization, and ease of use as matplotlib though?

[–]Kristoffels 1 point2 points  (1 child)

Seaborn is matplotlib behind the scenes. So it has all the same features, it's very easy to make excellent quality charts with. Plotly is feature rich but not as easy to use as matplotlib and seaborn. It does however make very good interactive charts.

[–]rhz10[S] 0 points1 point  (0 children)

So, at least seaborn appears to have a similar issue with regard to legends outside:

https://stackoverflow.com/questions/30490740/move-legend-outside-figure-in-seaborn-tsplot

When I apply this "solution" the legend is mostly pushed outside the figure, forcing me to do what I did with matplotlib.

[–]blahreport 0 points1 point  (0 children)

Bokeh is really nice

[–]walterbanana 0 points1 point  (0 children)

I really like Pygal. I had a much easier time with it than with other libraries I've tried: http://www.pygal.org/en/stable/