-
Notifications
You must be signed in to change notification settings - Fork 2.1k
geom_path(linejoin = "mitre") #2399
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
Comments
Thanks, Bill. Just adding my snippets from the community thread since I have them, so it'll (hopefully) be easier to navigate sources when we troubleshoot. Exact replication of the example using linejoin = "mitre" from the doc example # Control line join parameters
library(ggplot2)
df <- data.frame(x = 1:3, y = c(4, 1, 9))
base <- ggplot(df, aes(x, y))
base + geom_path(size = 10, linejoin = "mitre", lineend = "butt") Created on 2018-01-13 by the reprex package (v0.1.1.9000). And the example with the same code from the docs: Bonus forensic investigation 🔎: I checked out the ggplot2 repo, and looked for issues mentioning |
The documented example works as expected for me on 2.2.1. Using differently sized segments (as in OPs example) never works, as the segments get connected by size and therefore respond to the |
Interesting, the CRAN version (2.2.1) works as expected (see reprex below), but the dev version does not (shown in #2399 (comment), above, # Control line join parameters
library(ggplot2)
df <- data.frame(x = 1:3, y = c(4, 1, 9))
base <- ggplot(df, aes(x, y))
base + geom_path(size = 10, linejoin = "mitre", lineend = "butt") |
Possibly related to 3553f31? |
@Ax3man good call. 👍 Works as it should when library(ggplot2)
df <- data.frame(x = 1:3, y = c(4, 1, 9))
base <- ggplot(df, aes(x, y))
base + geom_path(size = 10, linejoin = "mitre", linemitre = 1) Created on 2018-01-15 by the reprex package (v0.1.1.9000). n.b. When passed library(ggplot2)
df <- data.frame(x = 1:3, y = c(4, 1, 9))
base <- ggplot(df, aes(x, y))
base + geom_path(size = 10, linejoin = "mitre", linemitre = 10) Created on 2018-01-15 by the reprex package (v0.1.1.9000). |
Yes, mitering works when the line segments are the same size, but doesn't work when the segments are of different sizes. Is there any way to get this to work for segments of different sizes? I'm using ggplot2 2.2.1.9000. Thanks |
I don't think so - the underlying grid grob doesn't support varying widths. |
Since it sounds like this isn't possible, I'm gonna go ahead and close the issue. |
This old issue has been automatically locked. If you believe you have found a related problem, please file a new issue (with reprex) and link to this issue. https://reprex.tidyverse.org/ |
Uh oh!
There was an error while loading. Please reload this page.
The code below does not mitre the path segments as in geom_path() documentation.
Bill
The text was updated successfully, but these errors were encountered: