-
Notifications
You must be signed in to change notification settings - Fork 24
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
A geom
similar to geom_text
but curves in polar co-ordinates
#5
Comments
I think this is pretty nice and might have some use cases, but I'm questioning whether this should be a geom or a position adjustment. I don't foresee any problems that don't happen in Cartesian coordinates, but I do wonder if this only has a use case in non-Cartesian coordinates. Similar to how |
You're right - it does only do something useful in polar co-ordinates. I do think there is an occasional need for something like this though - see for example this SO question and this other one. It would be great if we could get this to work as just a position adjustment, but I can't immediately see how that would work, since it involves passing row-wise data rather than vertically grouped data. The implementation above is just a reparameterisation of |
I agree that it is useful to have, but I'm wondering whether there is an opportunity here to kill two birds with one stone. I haven't fully fleshed out anything yet, but I was thinking along the following lines.
I imagine in both cases that the line pieces become curves in polar coordinates and because the line pieces are straight in cartesian coordinates, we can extend the The case you presented above would then be a |
Come to think of it, we could probably also make a |
This enhancement is being archived as it forms part of a later thread, where it is linked for reference. |
Consider the following example where we can't use
geom_textpath
because we only want labels at a single point rather than following a path:But if we switch to polar co-ordinates, the labels are of course straight:
With what we have in place so far, it should be straightforward to define a new geom that acts as a drop-in for
geom_text
but bends in polar co-ordinates, so for example:and
The implementation is something like this:
The questions are
The text was updated successfully, but these errors were encountered: