GiovineItalia / Gadfly.jl

Crafty statistical graphics for Julia.
http://gadflyjl.org/stable/
Other
1.9k stars 250 forks source link

Ternary plot #610

Open simleb opened 9 years ago

simleb commented 9 years ago

I would love to be able to make ternary plots in Gadfly.

It is supported by a different kind of axes so where does this fit in the “grammar of graphics”? Should it be a Scale? A Geometry?

simleb commented 9 years ago

Ideally, it would support multiple geometries. Point, Path, but also histogram2d would be nice, maybe coupled with tribin (analogous to rectbin but triangular).

dcjones commented 9 years ago

I would like to add this. It does fit into a gog approach, in fact, Wilkinson's book has a section (9.2.3) on ternary plots.

I'd have to think a little about the implementation, but probably there'd be a Coord.triangular element, and new aesthetics named to avoid overlapping cartesian aesthetics, probably x1, x2, x3. Then it would be sufficient to say plot(x1=a, x2=b, x3=c, Geom.point).

There would be a fair amount of work, because one would have to implement guides to draw the grid lines, write separate render functions for applicable geometries, etc. I would probably rearrange things so that render functions for geometries and guides dispatch on the coordinate type of the plot to avoid mixing of coordinates.

FJValverde commented 3 years ago

Hi. Could one of the main developers of this enhancement provide an update about this? I regularly use ternary diagrams for a type of assessment plot in Machine Learning and would like to try this in Julia. I have developed such a thing for Matlab but in R-ggplot2 had to used somebody's implementation of the ternary geometry (http://www.ggtern.com).