You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The problem here is, that the colors and the position of the levels in the colorkey are not chosen consistently with the order specified in levels. This becomes a problem when multiple plots are generated where new classes are added. In this case I would like to keep a consistent ordering and coloring scheme between the plots by appending the new class to the levels. Currently, however, the classnames seem to be sorted lexicographically which will result in shift of all colors.
The text was updated successfully, but these errors were encountered:
In Gadfly (and ggplot2), each aesthetic (e.g. x,y,color) has its own scale, and the scales operate independently.
In Gadfly, the levels argument controls the order for each scale:
using Gadfly, RDatasets
mtcars =dataset("datasets","mtcars")
p =plot(mtcars, x=:Cyl, color=:Cyl, Geom.histogram,
Scale.x_discrete(levels=[8,6,4]), Scale.color_discrete(levels=[8,6,4]) )
To group related classes together in a Geom.bar plot I used Scale.x_discrete.
The (simplified) code reads as follows:
The problem here is, that the colors and the position of the levels in the colorkey are not chosen consistently with the order specified in
levels
. This becomes a problem when multiple plots are generated where new classes are added. In this case I would like to keep a consistent ordering and coloring scheme between the plots by appending the new class to thelevels
. Currently, however, the classnames seem to be sorted lexicographically which will result in shift of all colors.The text was updated successfully, but these errors were encountered: