Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adjusting tick widths for plots other than Geom.point #837

Open
kmanalo opened this issue May 5, 2016 · 4 comments
Open

Adjusting tick widths for plots other than Geom.point #837

kmanalo opened this issue May 5, 2016 · 4 comments
Labels

Comments

@kmanalo
Copy link

kmanalo commented May 5, 2016

  1. Providing a fixed set of ticks - Original example
    plot(x=rand(10), y=rand(10), Geom.point, Stat.yticks(ticks=[0.0, 0.1, 0.9, 1.0]))
  2. Providing a fixed set of ticks for bar - WORKS
    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)
  3. Providing a fixed set of ticks for bar - how do I define xmax, xmain?
    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.

@tlnagy
Copy link
Member

tlnagy commented Aug 24, 2016

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.

@tlnagy tlnagy added the bug label Sep 9, 2016
@tlnagy
Copy link
Member

tlnagy commented Sep 9, 2016

I'm going to label this as a bug. What do you all think @shashi @Mattriks?

@Mattriks
Copy link
Member

Mattriks commented Sep 9, 2016

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!

@Mattriks
Copy link
Member

I've added an example (#894) to show why the above behavour is useful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants