Bug in geom_line?

27 views
Skip to first unread message

Mario Pardo

unread,
Feb 8, 2015, 3:08:49 PM2/8/15
to ggp...@googlegroups.com
# Hi,

# I think there is a problem with geom_line:

# Try this:

orig_data <- read.csv("~/My_R/xy.csv") # File attached

require(ggplot2)
ggplot()+
geom_line(data=orig_data ,
                aes(x=x,
                      y=y),
                size=0.1,
                colour="red",
                alpha=0.6)+
theme_bw()+
coord_fixed()

# Now, compare the results to this:
plot(orig_data$x,orig_data$y)
lines(orig_data$x,orig_data$y)

# WHAT'S GOING ON?






xy.csv

Richard Zijdeman

unread,
Feb 8, 2015, 3:32:20 PM2/8/15
to Mario Pardo, ggp...@googlegroups.com
Hi,

geom_line is for (functional) ordered lines. check out geom_path http://docs.ggplot2.org/current/geom_path.html

Best,

Richard

--
--
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 ggp...@googlegroups.com
To unsubscribe: email ggplot2+u...@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+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
<xy.csv>

Reply all
Reply to author
Forward
0 new messages