Gadfly.jl icon indicating copy to clipboard operation
Gadfly.jl copied to clipboard

Ternary plot

Open simleb opened this issue 9 years ago • 3 comments

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 avatar Jun 20 '15 15:06 simleb

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

simleb avatar Jun 20 '15 15:06 simleb

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.

dcjones avatar Jun 20 '15 16:06 dcjones

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).

FJValverde avatar Mar 03 '21 11:03 FJValverde