Gadfly is the best plotting library I've ever used

I’ve used ggplot2, matplotlib, bokeh, seaborn, holoviews, VegaLite, plotly, Plots.jl, among many others, and Gadfly is the most productive & principled plotting library I’ve used yet. If you haven’t already given it a go, I highly recommend it. It’s a true joy to work with, and takes the best of ggplot2’s grammar of graphics, matplotlib’s vector-based plotting, and Haskell’s diagrams, all combined in a next gen interface.

Could not recommend more emphatically. Sorry if this is fluff, but I figure no one minds having work acknowledged & praised :slight_smile:

48 Likes

Hi!

I am trying Julia visualization packages. Does it have support for surface plotting?

I cannot find anything in the docs.

1 Like

Yeah Gadfly is a work of beauty… But it’s missing lots of features like surface plots :wink:

3 Likes

there is no 3D at all in gadfly, but it can plot surfaces in 2D with contours or bins:

http://gadflyjl.org/dev/gallery/geometries/#[Geom.contour](@ref)

http://gadflyjl.org/dev/gallery/geometries/#[Geom.density2d](@ref)

http://gadflyjl.org/dev/gallery/geometries/#[Geom.hexbin](@ref)

2 Likes

@bjarthur probably meant to link to

Which seemed to be broken up by Discourse. Respectively, the plots for these links look as follows:

Contour

Density2d

Hexbin

8 Likes

Does it solve the data exploration issue of other packages?
What I mean is I couldn’t find any visualization package to imitate MATLAB’s figure() data tips.

Namely being able to go through the data values (Only data values not coordinates as in c shortcut in Gadfly) (Especially on images).

I think Plotly gets close but are there others?

1 Like

In my experience, Plotly is good for data exploration with the usual line plots, but forget about it when plotting surfaces, and goodbye to interactivity if you want to build some kind of GUI.

Makie is the way to go for all these things, and it is very, very fast. You can have data exploration if you code it manually, see for example: [Plots.jl] Can't show data on hover (surface plot) - #2 by sudete

I love Makie, but it is true that it needs to keep improving to be as polished as Gadfly for some things. However, this is good! There is still room for improvement.

7 Likes

I was a big user of ggplot2 becoming somewhat of an expert during my doctorate years. After moving to Julia, I wasn’t a big fan of Julia’s Plots.jl. I eventually settled on Gnuplot.jl, which I guess isn’t really a Julia library but is highly customizable. I also realized I like the non-grammer-of-graphics way of plotting.

Is Gadfly as customizable as Gnuplot and how much is it influenced by GoG ?

1 Like

Yes, Gadfly is GoG-based: Tutorial · Gadfly.jl. Although unlike other GoG libraries, it also supports plotting from dataframes or arrays. Additionally, Gadfly is based on an elegant declarative graphics engine, so unlike ggplot2 you have low-level access to graphic primitives, all wrapped in beautiful S expressions.

4 Likes

I anyone trying to create a figure element with experience like MATLAB’s figure() in Makie?

This is the only feature that make want something like MatPlot (Like PyPlot) to have MATLAB’s figure experience.

I am watching the excellent Klopper Lectures on YouTube and it has a section on Gadfly. I may be mistaken, but I vaguely remember reading that Gadfly is not being maintained. Is Gadfly worth learning at this point?

best way to check whether any package is maintained is to look at the number of commits over time. gadfly has seen a bit of a dip due to covid, but there are 3-4 of us who regularly contribute. please give it a try and let us know what you think.

1 Like

I began using Plots, but never really liked it. I am now trying out VegaLite, but I’m curious, how do Gadfly and Makie compare?

Makie vs Gadly

Algebra of Graphics (built on Makie) is quite similar to Gadfly and VegaLite. Perhaps the most principled of the bunch, but the youngest by far

4 Likes

I’d like to temper the expectation of anyone reading this thread: as of now (Sept 2023), I would say that Gadfly is very far behind Holoviews in terms of maturity and ease of use. It is also possibly behind Makie? (This is not meant as a criticism of Gadfly, as I’m aware it’s a lot of work to develop such a package; I just want to bring a more balanced view of the julia plotting package landscape.)