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

Error with coord_polar #42

Open
mevers opened this issue Jun 21, 2020 · 6 comments
Open

Error with coord_polar #42

mevers opened this issue Jun 21, 2020 · 6 comments
Milestone

Comments

@mevers
Copy link

mevers commented Jun 21, 2020

Using theme(axis.text.x = element_markdown()) with coord_polar causes an error (but still correctly draws the plot):

Error in grid.Call.graphics(C_setviewport, vp, TRUE) :
non-finite location and/or size for viewport

Minimal & reproducible example:

df <- data.frame(name = sprintf("**%s**", LETTERS[1:4]), value = 1:4)

library(ggtext)
library(ggplot2)

ggplot(df, aes(name, value)) +
    geom_point() +
    coord_polar() +
    theme(axis.text.x = element_markdown())

example

This issue seems to be related to the polar coordinates, as removing coord_polar gets rid of the error

ggplot(df, aes(name, value)) +
    geom_point() +
    theme(axis.text.x = element_markdown())

example

@clauswilke
Copy link
Collaborator

Can you report this for ggplot2 also (linking to this issue)? It's almost certainly a problem in how ggplot2 renders axes for polar coordinates.

@mevers
Copy link
Author

mevers commented Jun 22, 2020

@clauswilke
Copy link
Collaborator

It's been determined that this is a ggtext issue that needs fixing.

@clauswilke clauswilke modified the milestones: 0.1.0 CRAN release, 0.1.1 Aug 31, 2020
@HugoSentenac
Copy link

Hi, I've encountered this problem. Is there a solution?

@gabriel-abrahao
Copy link

Hi, are there any updates on this? I'm not very savvy on gg-world, but I'd gladly try and come up with a fix if someone points me in the right direction. Seems like the ggplot people suspect this is caused by draw_axis not being able to handle an NA argument with #element_markdown, any clue on how to tackle that in this side? Thanks anyway!

@clauswilke
Copy link
Collaborator

I guess this completely dropped off the radar. I thought we had fixed this.

I don't have a lot of capacity for ggtext development right now. If anybody wants to dig a bit deeper and try to figure out where the problem is I'm happy to assist/give advice. The problem is ggplot sends NAs to element_markdown() and (I believe) ggtext tries to format and then render those rather than ignore them.

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

4 participants