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

axis_x_inverse_trans overlapping text around 0 #70

Open
alexheubeck opened this issue Aug 12, 2020 · 3 comments
Open

axis_x_inverse_trans overlapping text around 0 #70

alexheubeck opened this issue Aug 12, 2020 · 3 comments

Comments

@alexheubeck
Copy link

Hey @mikejiang and @jacobpwagner,

I'm using axis_x_inverse_trans() and axis_y_inverse_trans() on data with the logicle transform, and the linear portion of the data always has the 0 and 10^2 axis labels overlapping. Any way to have overlapping text on the axis just display 0?

Here is an example:

Screen Shot 2020-08-12 at 1 42 25 PM

Thanks!

@jacobpwagner
Copy link
Member

jacobpwagner commented Aug 12, 2020

Hey @alexheubeck . Ideally, the continuous scale added by the axis_x/y_inverse_trans functions would pass down all parameters to scale_x/y_continuous and properly apply them later, so you could just set the breaks accordingly. However, because of how it's currently implemented, that is not currently honored. For example, my omission of 1e2 is ignored here and that tick is still labeled:

library(ggcyto)
gs <- load_gs(system.file("extdata", "gs_manual", package = "flowWorkspaceData"))
ggcyto(gs[[1]], subset = "CD3+", aes("CD4", "CD8")) +
  geom_hex(bins=0) +
  axis_x_inverse_trans(breaks=c(0,1e3,1e4,1e5)) +
  axis_y_inverse_trans(breaks=c(0,1e3,1e4,1e5))

image

I can put together some workarounds, but they will likely involve going through a standard ggplot object using as.ggplot or just building it directly from the dataframe, which sort of defeats the point. So, I will try to add in support for passing arguments to scale_x/y_continuous as above.

@alexheubeck
Copy link
Author

Hey @jacobpwagner,

That would be awesome, thanks so much. On a related note, do you know if it's possible to put log tick marks on a ggplot axis? Particularly on the outside of the plot so it lines up with the axis_x/y_inverse_trans tick marks.

@JohannesSchroth
Copy link

Haven't found a solution to this online, but for anyone with the same problem this workaround worked for me:
p + guides(x = guide_axis(check.overlap = T))

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

No branches or pull requests

3 participants