Open kmanalo opened 8 years ago
This works
plot(x=rand(10), y=rand(10), Guide.yticks(ticks=[0.0, 0.1, 0.9, 1.0]), Geom.bar)
Guide
only changes the labels, while Stat
transforms the aesthetics. That said, this shouldn't break like this.
I'm going to label this as a bug. What do you all think @shashi @Mattriks?
Here is an example which better shows the issues here. What do you think will be plotted?
srand(999)
ytix = Stat.yticks(ticks =[0.0, 0.1, 0.9, 1.0])
layer1 = layer(Geom.point, Geom.smooth)
layer2 = layer(ytix, Geom.smooth, Theme(default_color=colorant"red"))
p = plot(x=1:10, y=rand(10), layer1, layer2)
There is a larger question here about what should a layer contain wrt geometries and statistics? Conventional thought would say that a layer should contain one geometry (e.g. points or lines etc) and one statistic (e.g. a smoothing function and the identity function are both statistics). Guess what Gadfly does when it finds statistics that are not associated with geometries!
I've added an example (#894) to show why the above behavour is useful.
plot(x=rand(10), y=rand(10), Geom.point, Stat.yticks(ticks=[0.0, 0.1, 0.9, 1.0]))
plot(x=rand(10), y=rand(10), Stat.yticks(ticks=[0.0, 0.1, 0.9, 1.0]), Theme(default_point_size=0mm), Geom.point, Geom.bar)
plot(x=rand(10), y=rand(10), Stat.yticks(ticks=[0.0, 0.1, 0.9, 1.0]), Geom.bar)
Outputs:The following aesthetics are required by BarGeometry but are not defined: xmax, xmin
Just wondering what the approach should normally be - my desire is to work with bar charts here.