Saurajyoti Kar
2018-07-16 18:19:09 UTC
Thanks so much!!
Saurajyoti
--
You received this message because you are subscribed to the ggplot2 mailing list.
Please provide a reproducible example: https://github.com/hadley/devtools/wiki/Reproducibility
To post: email ***@googlegroups.com
To unsubscribe: email ggplot2+***@googlegroups.com
More options: http://groups.google.com/group/ggplot2
---
You received this message because you are subscribed to the Google Groups "ggplot2" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ggplot2+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Saurajyoti
Exactly! Thanks very much.
Jeff
--Jeff
Is
gp + guides(color = guide_legend(override.aes = list(size = 2)))
along the lines of what you were after?
Dennis
gp + guides(color = guide_legend(override.aes = list(size = 2)))
along the lines of what you were after?
Dennis
I can't figure out how to increase line thickness in a legend where I am
df <-data.frame(x.left=1:8, x.right=1:8, y.bot=2:9, y.top=3:10,
color.var=c(rep("a", 4), rep("b", 4)), width.var=rep(c("c", "d"),,4))
#> df
# x.left x.right y.bot y.top color.var width.var
#1 1 1 2 3 a c
#2 2 2 3 4 a d
#3 3 3 4 5 a c
#4 4 4 5 6 a d
#5 5 5 6 7 b c
#6 6 6 7 8 b d
#7 7 7 8 9 b c
# 8 8 8 9 10 b d
gp <- ggplot(df) + geom_segment(aes(x=x.left,xend=x.right, y=y.bot,
yend=y.top, color=color.var, size=width.var))
print (gp)
This produces the attached plot thin_legend_lines.png where the width
of thedf <-data.frame(x.left=1:8, x.right=1:8, y.bot=2:9, y.top=3:10,
color.var=c(rep("a", 4), rep("b", 4)), width.var=rep(c("c", "d"),,4))
#> df
# x.left x.right y.bot y.top color.var width.var
#1 1 1 2 3 a c
#2 2 2 3 4 a d
#3 3 3 4 5 a c
#4 4 4 5 6 a d
#5 5 5 6 7 b c
#6 6 6 7 8 b d
#7 7 7 8 9 b c
# 8 8 8 9 10 b d
gp <- ggplot(df) + geom_segment(aes(x=x.left,xend=x.right, y=y.bot,
yend=y.top, color=color.var, size=width.var))
print (gp)
This produces the attached plot thin_legend_lines.png where the width
lines in the color.var legend is very thin and hard to distinguish in my
real use case where I am using 7 colors.
(A) Increasing legend key size
require("grid")
gp <- gp + theme(legend.key.size=unit(1,"cm"))
print (gp)
That increased the size of the background in the legend but didn't
changereal use case where I am using 7 colors.
(A) Increasing legend key size
require("grid")
gp <- gp + theme(legend.key.size=unit(1,"cm"))
print (gp)
That increased the size of the background in the legend but didn't
the line width.
(B) Making line size constant.
gp <- ggplot(df) + geom_segment(aes(x=x.left,xend=x.right, y=y.bot,
yend=y.top, color=color.var, size=width.var), size=5)
That actually did make the legend lines have size 5 but overrode my size
aesthetics setting (i.e., all lines were of size 5).(I expected this but
gave it a shot anyways).
Any ideas on how to preserve the size aesthetic while making the lines
in(B) Making line size constant.
gp <- ggplot(df) + geom_segment(aes(x=x.left,xend=x.right, y=y.bot,
yend=y.top, color=color.var, size=width.var), size=5)
That actually did make the legend lines have size 5 but overrode my size
aesthetics setting (i.e., all lines were of size 5).(I expected this but
gave it a shot anyways).
Any ideas on how to preserve the size aesthetic while making the lines
the color legend thicker? Thanks.
Jeff
--
--
You received this message because you are subscribed to the ggplot2
mailingJeff
--
--
You received this message because you are subscribed to the ggplot2
list.
https://github.com/hadley/devtools/wiki/Reproducibility
More options: http://groups.google.com/group/ggplot2
---
You received this message because you are subscribed to the Google
Groupshttps://github.com/hadley/devtools/wiki/Reproducibility
More options: http://groups.google.com/group/ggplot2
---
You received this message because you are subscribed to the Google
"ggplot2" group.
To unsubscribe from this group and stop receiving emails from it, send
anTo unsubscribe from this group and stop receiving emails from it, send
For more options, visit https://groups.google.com/groups/opt_out.
--
You received this message because you are subscribed to the ggplot2 mailing list.
Please provide a reproducible example: https://github.com/hadley/devtools/wiki/Reproducibility
To post: email ***@googlegroups.com
To unsubscribe: email ggplot2+***@googlegroups.com
More options: http://groups.google.com/group/ggplot2
---
You received this message because you are subscribed to the Google Groups "ggplot2" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ggplot2+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.