Hinnerk Boriss
2002-Nov-12 17:10 UTC
[R] R: Error in plot.new() : axis style "d" not implemented
Hi there! Both on windows and Solaris platforms I run into troubles when trying to draw two plots on top of each other. Here a short code example:> x1 <- c(2,3,4,5,6,7,8) > y1 <- sin(x1) > x2 <- c(1,2,3,4,5,6,7,8,9,10) > y2 <- cos(x2) > d1 <- cbind(x1,y1) > d2 <- cbind(x2,y2) > plot(d1) > par(new=T, xaxs="d") > plot(d2)Error in plot.new() : axis style "d" unimplemented>And here an excerpt from the R help pages: xaxs The style of axis interval calculation to be used for the x-axis. Possible values are "r", "i", "e", "s", "d". The styles are generally controlled by the range of data or xlim, if given. Style "r" (regular) first extends the data range by 4 percent and then finds an axis with pretty labels that fits within the range. Style "i" (internal) just finds an axis with pretty labels that fits within the original data range. Style "s" (standard) finds an axis with pretty labels within which the original data range fits. Style "e" (extended) is like style "s", except that it is also ensured that there is room for plotting symbols within the bounding box. Style "d" (direct) specifies that the current axis should be used on subsequent plots. (Only "r" and "i" styles are currently implemented) As I understand the manual pages, this should work. However it doesn't. Is there any other way to combine plots and align them on the same axis? I hope someone can help. Cheers, Hinnerk -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Peter Dalgaard BSA
2002-Nov-12 18:31 UTC
[R] R: Error in plot.new() : axis style "d" not implemented
"Hinnerk Boriss" <boriss at izbi.uni-leipzig.de> writes:> Hi there! > > Both on windows and Solaris platforms I run into troubles when trying to > draw two plots on top of each other. Here a short code example: > > > x1 <- c(2,3,4,5,6,7,8) > > y1 <- sin(x1) > > x2 <- c(1,2,3,4,5,6,7,8,9,10) > > y2 <- cos(x2) > > d1 <- cbind(x1,y1) > > d2 <- cbind(x2,y2) > > plot(d1) > > par(new=T, xaxs="d") > > plot(d2) > Error in plot.new() : axis style "d" unimplemented > > > > > And here an excerpt from the R help pages: > xaxs > The style of axis interval calculation to be used for the x-axis. > Possible values are "r", "i", "e", "s", "d". The styles are generally....> current axis should be used on subsequent plots. (Only "r" and "i" > styles are currently implemented) > > As I understand the manual pages, this should work. However it doesn't.Which part of 'Only "r" and "i"' did you misunderstand if you expect "d" to work? Patches will be considered.... -- O__ ---- Peter Dalgaard Blegdamsvej 3 c/ /'_ --- Dept. of Biostatistics 2200 Cph. N (*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918 ~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk) FAX: (+45) 35327907 -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Uwe Ligges
2002-Nov-12 20:59 UTC
[R] R: Error in plot.new() : axis style "d" not implemented
Hinnerk Boriss wrote:> > Hi there! > > Both on windows and Solaris platforms I run into troubles when trying to > draw two plots on top of each other. Here a short code example: > > > x1 <- c(2,3,4,5,6,7,8) > > y1 <- sin(x1) > > x2 <- c(1,2,3,4,5,6,7,8,9,10) > > y2 <- cos(x2) > > d1 <- cbind(x1,y1) > > d2 <- cbind(x2,y2) > > plot(d1) > > par(new=T, xaxs="d") > > plot(d2) > Error in plot.new() : axis style "d" unimplemented > > > > And here an excerpt from the R help pages: > xaxs > The style of axis interval calculation to be used for the x-axis. > Possible values are "r", "i", "e", "s", "d". The styles are generally > controlled by the range of data or xlim, if given. Style "r" (regular) > first extends the data range by 4 percent and then finds an axis with > pretty labels that fits within the range. Style "i" (internal) just > finds an axis with pretty labels that fits within the original data > range. Style "s" (standard) finds an axis with pretty labels within > which the original data range fits. Style "e" (extended) is like style > "s", except that it is also ensured that there is room for plotting > symbols within the bounding box. Style "d" (direct) specifies that the > current axis should be used on subsequent plots. (Only "r" and "i" > styles are currently implemented) > > As I understand the manual pages, this should work. However it doesn't.Please read the last sentence you cited --- right, the one in brackets! It means: "d" is NOT implemented.> Is there any other way to combine plots and align them on the same axis? > I hope someone can help.Try points(x2, y2) instead of the second call to plot(). Maybe you need to scale the axes in the first call to plot(), or e.g. like: plot(c(x1, x2), c(y1, y2), type = "n") points(x1, y1) points(x2, y2) Uwe Ligges -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Hi! Is there a way to evaluate "density" objects other than with plot, so that I can write data points to a file and plot them with gnuplot? Can anyone help? Cheers, Hinnerk -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
density() returns a list containing the x and y values of the density. dens <- density(x) write(t(cbind(dens$x, dens$y)), file = "gnuplot-input.txt") -roger _______________________________ UCLA Department of Statistics rpeng at stat.ucla.edu http://www.stat.ucla.edu/~rpeng On Thu, 14 Nov 2002, Hinnerk Boriss wrote:> Hi! > > Is there a way to evaluate "density" objects other than with plot, so > that I can write data points to a file and plot them with gnuplot? Can > anyone help? > > Cheers, > Hinnerk > > -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- > r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html > Send "info", "help", or "[un]subscribe" > (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch > _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._ >-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._