Hi,
Now its work, just invert the theme() and theme_bw() position. The
theme_bw() was overlapping the legend position.
Thanks
Ronaldo
Em 09-12-2015 13:11, Ronaldo Reis J�nior escreveu:
> Thanks,
>
> Now its work, but I dont get to change te legend position. Look:
>
>
> ggplot(data1, aes(x=x1, y
Last "+theme_bw()" to be deleted.
Try this:
ggplot(data1, aes(x=x1, y=y1))+
geom_point()+
geom_smooth(method="glm", family="gaussian",aes(linetype="equation1"))+
geom_smooth(aes(x=x1, y=y1, linetype="equation2"),data=data2, method="glm",
family="gaussian")+
scale_linetype_manual(values =
Thanks,
Now its work, but I dont get to change te legend position. Look:
ggplot(data1, aes(x=x1, y=y1))+
geom_point()+
geom_smooth(method="glm", family="gaussian",aes(linetype="equation1"))+
geom_smooth(aes(x=x1, y=y1, linetype="equation2"),data=data2,
method="glm", family="gauss
Try to look at the link:
http://www.cookbook-r.com/Graphs/Legends_(ggplot2)/
Also consider:
help(theme)
legend.backgroundbackground of legend (element_rect; inherits from rect)
legend.margin extra space added around legend (unit)
legend.key background underneath legend keys (element_rect
Hi,
I'm trying to make a ggplot() graph with a custom legend, but without
success, it is simple, I have somethink like this in traditional plot:
plot(y~x)
curve(equation1,lty=1)
curve(equation2,lty=2)
legend(x,y,legend=c("equation 1","equation 2"),lty=c(1,2),bty="n").
In my ggplot graph I have
5 matches
Mail list logo