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

aspect ratio not honored #367

Open
wdwatkins opened this issue Jun 30, 2016 · 12 comments
Open

aspect ratio not honored #367

wdwatkins opened this issue Jun 30, 2016 · 12 comments
Labels

Comments

@wdwatkins
Copy link
Contributor

wdwatkins commented Jun 30, 2016

The asp argument is not being honored in plotting function calls.

set.seed(2576)
X <- runif(33)
Y<-seq(0,2,length.out = 33)
gs <- gsplot() %>% points(X, Y,
                          asp=1,frame.plot=FALSE) %>% axis(side=c(3,4),labels=FALSE) %>% grid()
gs

Produces this:
image
asp=1 should produce 1:1 axes.

@wdwatkins
Copy link
Contributor Author

labels seems to be having the same problem.

@jordansread
Copy link
Member

@wdwatkins when you make examples, can you make sure they are reproducible for us? I think that just means you need to include X and Y in your code snippet, but that helps us diagnose.

@jordansread
Copy link
Member

not sure that labels is broken. You are saying "no labels" on sides 3 and 4, and there aren't labels on those sides.

@jordansread
Copy link
Member

jordansread commented Jun 30, 2016

try triple ticks w/ r specified:
this
image
gives you this:

this.variable <- result(data=c(2,3,1),flags='three')

and that way you can use return lines too

@wdwatkins
Copy link
Contributor Author

wdwatkins commented Jun 30, 2016

Sorry, X and Y are just arbitrary things to plot. I added them.

To be more specific with labels: it works in the axis() call like above, but not when its inside points(), the same way asp doesn't. Same X and Y as above.
gs <- gsplot() %>% points(X, Y, labels=FALSE ) %>% axis(side=c(3,4),labels=FALSE)
image
I'm trying to suppress initial labels on the main axes, so I can relabel them with an axis() call that places the labels between tick marks for the time/date axis labeling.

@lindsayplatt
Copy link

You shouldn't need to suppress them in order to change the labels:

gs <- gsplot() %>% 
    points(1:10,1:10) %>% 
    axis(side=1,at=c(2,4,6,8,10),labels=TRUE)
gs

image

@wdwatkins
Copy link
Contributor Author

wdwatkins commented Jun 30, 2016

That also moves the tick marks though. I'm trying to keep the original ticks, and only add labels. To get something like this:

image

I'm using this method: http://stackoverflow.com/questions/7530933/placing-the-x-axis-labels-between-period-ticks. Maybe there's a better option though.

@jordansread
Copy link
Member

@wdwatkins do you want:

set.seed(2576)
X <- runif(33)
Y<-seq(0,2,length.out = 33)
gs <- gsplot() %>% points(X, Y, axes=FALSE ) %>% axis(side=c(1:4), labels=FALSE)
gs

That would be my suggestion for what you are doing...unfortunately, that doesn't actually work as expected for me:

image

This seems like a bug, right @lindsaycarr ?

@lindsayplatt
Copy link

lindsayplatt commented Jul 1, 2016

Yes, that does seem like a bug. Something with axes=FALSE because this works as expected:

set.seed(2576)
X <- runif(33)
Y<-seq(0,2,length.out = 33)
gs <- gsplot() %>% points(X, Y) %>% axis(side=c(1:4), labels=FALSE)
gs

image

@lindsayplatt
Copy link

See #370

@jordansread jordansread added the bug label Jul 1, 2016
@lindsayplatt lindsayplatt added bug and removed bug labels Aug 25, 2016
@lindsayplatt
Copy link

asp still not working. Is this at all related to #366?

@lindsayplatt lindsayplatt modified the milestone: 0.8.0 Mar 20, 2017
@lindsayplatt
Copy link

Saving for later because it's complicated (asp tells us to ignore one of the axis' limits) and not useful for repgen. Would be nice to have for ease of meeting SPN compliance.

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