How to choose a plotting package?

And it also really depends on what your background is. I find I have a lot of issues with PyPlot on Windows, but almost none on Linux. So I’d suspect heavy Linux users (most devs) would be scratching there heads when they read my comment about the instability of PyPlot. On the other hand, those who are familiar with GGPlot2 are probably more familiar with Gadfly’s style of syntax. However, I think that if we all just use Plots.jl (and its extension GGPlots.jl), we can all argue about which backend is best while all running the same code.

Again, I’ve found a time/purpose for each Plots.jl backend. The only plotting package that I don’t see a use for is Gadfly, and that’s because it’s not “feature-wise any good” and I really think that the time spent on its API should really just be spent on GGPlots.jl so that way every plotting package has a Grammar of Graphics frontend.

In reality, these opinions don’t tend to matter dev to dev. But where they do matter is in recommendations to new users. They will try out the plotting package that we point to, and if it’s slow and can’t do 3D plotting, they may wrongly walk away with the idea that that package is somehow representative of the plotting situation in Julia.

3 Likes

Exactly this. I am always ready for a little flame war over which plotting package is the best, but that was not what I intended to start with the question on PyPlot :slight_smile: My question was, why is PyPlot emphasised to julia beginners on the official julia download page, along with Plots and Gadfly, but to the exclusion of other good packages? I think it is a remnant from the early days of julia 0.2 or 0.3 where Gadfly was still in early development. So the recommendation was for new users to look at Gadfly or use PyPlot, which worked (by cheating a little via Python). The plotting ecosystem has just evolved a lot since then.

1 Like

Make a PR. It’s always fun:

1 Like

Right, looks like all the people that should be discussing this already are :slight_smile: If any of what is discussed in that (merged!) PR comes on the website I’ll be completely happy.

The very front page of julialang.org still highlights Gadfly at the exclusion of all other plotting packages, though.

Feel free to generate a new screenshot and make a PR.

3 Likes

I’m working with people who don’t know any programming. and I have to show my working status regularly in a meeting, and discuss what to do next, and where to dig further into.

And my co-workers are used to excel, so they naturally assume that you can lookup raw data at any time when there is a plot. and discuss more with raw data when they spot unusual patterns in plot.

That’s where plotly backend is extremely helpful because it show all the raw data with just whip of a cursor. And I thought this is thing of beauty.

I used pyplot backend few month ago, and if I want to lookup raw data in the meeting, I had to prepare much more to lookup data point my coworker wants to see, So I just gave up using Julia plot and had to use excel plot.

This is lovely, and also exporting to Html is really nice because I can just copy them to laptop for meeting and use it without any concern for resolution


plotly() VS pyplot()

4 Likes

That was it ! Thank you.
(edit: setting minimum font size in firefox to none fixed the display problem)

hi all
thank for your answers
of course i have no opnion yet but i appreciate your sensibility to new users
it is true that starting needs motivation…
i have difficulties for example to display the curves of f(x)=K cos(x) for k in {-2,-1,1,2} ; i just need very simple things
to start, one needs some help, a very precise documentation and a system that reacts logiccaly and without any bugs…
i go on
nice evening to you
Vincent

Hi Vincent. This is super easy:

using Plots
plot([x->K*cos(x) for K in [-2,-1,1,2]], 0, 10)

I haven’t actually tested this, but I expect it to do what you want.

That’s using the new function plotting, right? Has that been tagged yet?

It should still work fine, just without all the untagged range calc fanciness.

1 Like

I just tried this, and I think arrays of functions are broken since the change to abstract Function. So instead this will work:

plot(0:.1:10, Any[x->K*cos(x) for K in [-2,-1,1,2]])
1 Like

Ha ha, I guess it is true it can be hard being a beginner in a language that is in rapid development :slight_smile:

1 Like

This produces the axis but not the lines, do you know why? I am having real troubles with plotting in Julia. My final objective is to plot in real time within a loop.

Thank you.

You can get good help on the Plots gitter: https://gitter.im/tbreloff/Plots.jl

In this case I cannot answer, as plot(0:.1:10,Any[ x->K*cos(x) for K in [-2,-1,1,2]]) leads to this plot for me:

I think your “real-time” plotting problem is a Jupyter problem, rather than a Plots problem. Try running your code in Atom or from the REPL to verify.

1 Like