You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#!/usr/bin/Rscript
library(ggplot2)
stat = read.csv("dat.csv")
png(file = "graph.png")
stat = ggplot() + geom_area(data=stat, aes(x, y))
print(stat)
dev.off()
gives a plot that is a little curious. See displayed graph. The
problem is that the x value 0.3 is duplicated. This might be
considered an error, but could be handled more
gracefully. Additionally, I would like to make a plea for points like
(0.8,0.75) and (0.8,0.76) to be dealt with in a reasonable way. Such
values can easily be produced as a result of rounding errors or
simulations that are not using enough precision. I suspect that
whatever geom_area would do with (0.8,0.75) & (0.8,0.76) is masked by
the duplicate x value problem.
Tested on Debian squeeze with R 2.15.3 and 0.9.3.1.
The text was updated successfully, but these errors were encountered:
You're right. That does fix the problem. I should have looked again at the documentation for geom_area. So, I guess this is user errror. However. the document is a little sketchy. For example, for the page for geom_area, e.g. Area Plot, it is not clear what the different options for position are,
nor are there any examples given.
Call this file
dat.csv
."x","y"
0.1,0.9
0.2,0.8
0.3,0.8
0.3,0.8
0.4,0.7
0.5,0.8
0.6,0.8
0.7,0.8
0.8,0.75
0.8,0.76
0.9,0.8
1.0,0.7
Then
gives a plot that is a little curious. See displayed graph. The
problem is that the x value 0.3 is duplicated. This might be
considered an error, but could be handled more
gracefully. Additionally, I would like to make a plea for points like
(0.8,0.75) and (0.8,0.76) to be dealt with in a reasonable way. Such
values can easily be produced as a result of rounding errors or
simulations that are not using enough precision. I suspect that
whatever geom_area would do with (0.8,0.75) & (0.8,0.76) is masked by
the duplicate x value problem.
Tested on Debian squeeze with R 2.15.3 and 0.9.3.1.
The text was updated successfully, but these errors were encountered: