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
theme_classic() no axis lines in version 2.1 #1565
Comments
It seems my update to allow access to lower level elements (axis.line.x, panel.grid.major.y, etc) leaves changes to upper level elements unused. Let me give this some thought. |
Here's a temporary workaround for the axes if anyone needs it until the issue's resolved: |
Thanks. I already had the work around but thought I should let you know of the changes to the classic_theme. |
I think the problem is related to #1567 and seems to stem from complete removal of axis lines by default |
It has to do with how attributes for elements are inherited. To remove an attribute, like axis.line in some themes, the current code sets them as element_blank(). However if a subelement, axis.line.x and axis.line.y are added, they inherit element_blank and will not appear. Newly added elements need to inherit from the original object (line, rect, or text) skipping any blank elements but I'm still thinking on how to do that. |
Really would appreciate for theme_classic() to work as in version 2.0.0 (and all prior versions), showing the x and y axis line as before instead of drawing no axis at all. (And thanks for the, hopefully temporary, workaround). I have countless shiny applications that depend on the classic theme, and re-programming all of these would be a nightmare. |
I think I have this completely fixed. Would anyone mind testing before I request a pull? |
Hi @Katiedaisey. I pulled from your fork and tried running the example in http://docs.ggplot2.org/current/ggtheme.html
Nevertheless, axis lines appear to work:
|
@steveharoz The ticks and labels were affected. They should also be fixed now. |
Nice! Looks like it's fixed. Here are the graphs with latest commit: Looks identical to commit a760ff6 (right before the theme updates) |
Dear Katiedaisy, I have recently downloaded the ggplot2 again to my desktop and found that the theme_classic() does not draw the axis.line() and I have come across this post. I have tried as shown by steveharoz. ggplot(mtcars, aes(wt, mpg)) + Would this problem be addressed again? Many Thanks, |
Hi @sjin09 |
I still don't get axis lines: ggplot(mtcars) + geom_point() + theme_classic() On 3/9/2016 5:09 PM, Katiedaisey wrote:
|
I'm having a similar trouble, for specifically requesting a grid. For example:
Is there a solution? Should I open up a different issue for this? |
@Katiedaisey: Have you made a pull request with your fix? Edit: Actually, I think it's this one - #1581 |
@steveharoz: yes. It hasn't been integrated yet. No idea what's going on. @jac0bean9 @rpruim: This has been fixed in my pull request #1581 and as available on my git. It just hasn't been integrated yet. |
@Katiedaisey thank you so much for the fix. I am actually under a crunch to use it, as the PI in my study wants precisely the classical layout (black axes, no borders) for a rather elaborate 4x2 grid of ggplots I've written for an article we're submitting. Thanks a bunch! |
It's a one-liner if you have devtools installed. A two-liner if not: install.packages("devtools")
devtools::install_github("Katiedaisey/ggplot2") |
Wow, it works now! Thank you both @rpruim @Katiedaisey. Anyway, all's well that ends well. How can we up the pressure on Hadley et al. to finally integrate this? |
@assaforon Hope it works out for you. I'll look at updating the package on my account to the most recent version of ggplot2 incase there's any of the newer changes you need. |
Duplicate of #1567 |
Shouldn't theme_classic actually have axis lines?
Is the update a mistake?
See theme_classic():
http://docs.ggplot2.org/dev/ggtheme.html
The text was updated successfully, but these errors were encountered: