Plots types documentation

plotting

#1

Hello, I am I bit lost with the Plots (but also other plotting packages) documentation: there are really lots of great examples for doing complicate stuff, but on the other side very little comprehensive documentation.
For example, I went trough the whole Plots documentation, but still I didn’t got how to plot a simple histogram.
Which type of plots do I have available ? Do all plots types use the plot() function, or do they use specified functions? e.g. somewhere I see scatter(), hystogram2d(), bar()… Where these functions are documented ? (or at least is there a list of them? - I can see in the example section many “types” but they are ordered by backend and the examples include other topics as well… I think a list of just plots types - and backends that implement them - would be nice )


#2

Everything in Plots uses the plot command. Different “plot types” in Plots.jl are called “series”. scatter is just shorthand for plot(seriestype=:scatter,...).

There is definitely a page missing which defines the different built-in series types. But this page

https://juliaplots.github.io/supported/

shows which series are supported on each backend. In addition, recipe libraries like PlotRecipes.jl and StatPlots.jl (and any other library! It’s not just Plots libraries that do this!) add new series recipes as well.

So with that in mind, from the examples plotting a histogram is

histogram(randn(1000),nbins=20)

which is the same as

plot(seriestype=:histogram,randn(1000),nbins=20)

For reference this then just calls the series recipe defined here:

Though I really think there should be a nice page which lists the built-in series recipes along with an example. @mkborregaard


#3

Thank you… clear…
The best imho would be a list of series type with a short graphical representation… see this screenshot from libreoffice… just a small image can tell a lot!


#4

100% agreed. The Plots docs need a section on the different series types. So little time, so much to document :slight_smile:


#5

I also think that there is not enough simple example for simple figures. Most of the time, I try to extract the simple things inside the complex examples shown.

I know it’s not sexy to show these when we develop a package and people prefer to spend time on new features as opposed to boring examples. The adoption is harder for newcomers though without these examples.

I think that Plots.jl is on the right track though and I really appreciate the work done!


#6

I should say that docs PRs are among the most welcome. There’s a high bar on the quality of examples, though, because they also serve as unit tests in CI.


#7

…just to share some fun… I didn’t got much what a “recipe” was… so let’s google it: “julia recipe”

…hmmm… let’s be more precise: “what is a recipe in julia”

Let’s try to be even more precise: “what is a recipe in julia language”

Finally we got it (but note still some noises…)

who has chosen “Julia” as name ??? :sob: :sob: … looking for a Julia tutorial you may well end up watching this (nice song):


#8

Ok, but to be fair: :wink:

Anyway, the reason you’re not finding it is that “recipes” aren’t a Julia-wide concept. They’re specific to the Plots.jl ecosystem. Try “julia plots recipes” and you’ll get something much more useful.