Re: [R] plot legend: combining filled boxes and lines

2007-09-10 Thread Gabor Grothendieck
Check out: http://tolstoy.newcastle.edu.au/R/e2/help/07/05/16777.html On 9/10/07, Lauri Nikkinen [EMAIL PROTECTED] wrote: Hello, I have difficulties combining boxes and lines in plot legend. I searched previous R-posts and found this (with no solution):

Re: [R] plot legend: combining filled boxes and lines

2007-09-10 Thread Lauri Nikkinen
Thanks Gabor, I got it! For example: x1 - rnorm(100) x2 - rnorm(100, 2) hist(x1, main = , col = orange,ylab = density, xlab = x, freq = F, density = 55, xlim = c(-2, 5), ylim = c(0, 0.5)) par(new = T) hist(x2, main = , col = green, ylab = , xlab = ,axes = F, xlim = c(-2, 5), ylim = c(0, 0.5),

Re: [R] plot legend: combining filled boxes and lines

2007-09-10 Thread Monica Pisica
This is not quite what you want but you can try this: legend(3, 0.45, legend = c(x1, x2, mean(x1), mean(x2)), col = c(orange, green),pch = c(15,15,-1,-1), lty=c(-1,-1,2,2)) Although pch=22 should draw a filled square with a border - but it draws only the border instead Monica

Re: [R] Plot command drops part of the plot for large plots in multiple figure environment

2007-08-29 Thread Uwe Ligges
Your examples are not reproducible. Hence hard to tell what goes wrong. There never was an R version 1.51. Please use a current version of R and read the pposoting guide. Uwe Ligges Lindveld, Charles wrote: I have run into some surprising behaviour when plotting data in a 3x2 grid: random

Re: [R] plot in for loop with i indexed variables does not work

2007-08-22 Thread Dimitris Rizopoulos
you need something like this: par(mfrow = c(5, 5)) for (i in 1:10) { nam - paste(Var., i, sep = ) plot(x = time, y = mat[, nam], xlab = Time, ylab = nam) } where `mat' is the matrix containing Var.1, Var.2, Var.3, etc. I hope it helps. Best, Dimitris Dimitris Rizopoulos

Re: [R] Plot legend in margin

2007-08-10 Thread Uwe Ligges
Daniel Brewer wrote: Hi all, Another plotting question I am afraid. Is there anyway of putting a legend for a plot in a margin rather than within the figure. I am trying to plot a 3x2 plot and I want to have: 1) One key along the bottom for all the plots 2) A label (a,b,c) for each plot

Re: [R] Plot legend in margin

2007-08-10 Thread Daniel Brewer
Thanks. That got me onto the right track. Because it is a multiplot and I wanted it along the bottom, I found that I had to use par(xpd=NA) and then position it relative to the last of the multiplots. After a bit of trial and error I got there. Thanks Lauri Nikkinen wrote: Very simple

Re: [R] Plot legend in margin

2007-08-10 Thread Greg Snow
Brewer Sent: Friday, August 10, 2007 4:55 AM To: Lauri Nikkinen; r-help@stat.math.ethz.ch Subject: Re: [R] Plot legend in margin Thanks. That got me onto the right track. Because it is a multiplot and I wanted it along the bottom, I found that I had to use par(xpd=NA) and then position

Re: [R] plot table with sapply - labeling problems

2007-08-09 Thread jim holtman
Here is a modified script that should work. In many cases where you want the names of the element of the list you are processing, you should work with the names: test-as.data.frame(cbind(round(runif(50,0,5)),round(runif(50,0,3)),round(runif(50,0,4 sapply(test, table)-vardist sapply(test,

Re: [R] Plot in log scale

2007-08-05 Thread John Kane
What appears to be happening is that you are plotting all the data sets but all the lines () are being plotted outside the original plotting frame. If you just plot out$a with axes=TRUE you will see what the y coordinates are. You need to explicitly set the ylim values. There is a mockup of

Re: [R] plot to postscript orientation

2007-08-03 Thread Uwe Ligges
Miruna Petrescu-Prahova wrote: Hi I am trying to save some plots in a postscript file. When I generate the plots in the main window, they appear correctly - their orientation is landscape (i.e., horizontal). However, when I open the .ps file with GSview, the whole page appears

Re: [R] plot to postscript orientation

2007-08-03 Thread Vorlow Constantinos
Hi, My vanilla code works fine... See also attached .eps file (seperate email sent directly to you) r-rnorm(100) postscript(figure.eps) plot.ts(r) dev.off() Also this works ok as you have been told already: paper=special in the postscript() call. If you see my eps file wrongly then

Re: [R] plot to postscript orientation

2007-08-03 Thread Prof Brian Ripley
Do you have the Orientation menu set to 'Auto'? The effect described seems that if 'Rotate media' is selected, which it should not be. The files look fine to me in GSView 4.8 on Windows and other viewers on Linux. I agree with Uwe that it is a viewer issue (most reported postscript/PDF are).

Re: [R] plot to postscript orientation

2007-08-03 Thread John Kane
I seem to see the same problem that Miruna gets just to confirm that it is not just her set-up. I'm using GSview4.8 if that helps --- Uwe Ligges [EMAIL PROTECTED] wrote: Miruna Petrescu-Prahova wrote: Hi I am trying to save some plots in a postscript file. When I generate the

Re: [R] plot to postscript orientation

2007-08-03 Thread John Kane
I don't know about for Miruna but it does not work for me. I tried postscript (figure.eps, paper=letter) http://ca.geocities.com/jrkrideau/R/eps.figure.pdf postscript(figure.eps, paper=special, width=5, height=4) with similaar same results. Interstingly enough figure.eps imports completely

Re: [R] plot to postscript orientation

2007-08-03 Thread Miruna Petrescu-Prahova
: John Kane [EMAIL PROTECTED] To: Vorlow Constantinos [EMAIL PROTECTED]; [EMAIL PROTECTED] Cc: r-help@stat.math.ethz.ch Sent: Friday, August 03, 2007 11:40 AM Subject: Re: [R] plot to postscript orientation I don't know about for Miruna but it does not work for me. I tried postscript

Re: [R] plot to postscript orientation-update

2007-08-03 Thread John Kane
Follow-up I seem to have manged to get the eps file to work using: postscript(C:/temp/figure.eps, horizontal=F, paper=special, height=8, width=8, pointsize=12) Exactly why I'm not sure since I just copied some old code that I had used a year or so ago. --- Vorlow Constantinos [EMAIL

Re: [R] plot to postscript orientation-update

2007-08-03 Thread Miruna Petrescu-Prahova
]; [EMAIL PROTECTED] Cc: r-help@stat.math.ethz.ch Sent: Friday, August 03, 2007 11:52 AM Subject: Re: [R] plot to postscript orientation-update Follow-up I seem to have manged to get the eps file to work using: postscript(C:/temp/figure.eps, horizontal=F, paper=special, height=8, width=8

Re: [R] plot matrix data- lattice?

2007-08-01 Thread Gabor Grothendieck
Try this: mat - matrix(1:24, 6, dimnames = list(year = 2001:2006, region = letters[1:4])) library(lattice) xyplot(Freq ~ year | region, as.data.frame.table(mat)) On 8/1/07, Dong Guo [EMAIL PROTECTED] wrote: Dear all, I have a matrix, dim = (years, regions) I would like to plot the data

Re: [R] plot matrix data- lattice?

2007-08-01 Thread Gabor Grothendieck
?matrix On 8/1/07, Dong Guo [EMAIL PROTECTED] wrote: Thanks, Gabor. My matrix is from a big array(year, regions,variables). so, matrix does not have row names or col names, how could i add the col names or row names?? Thanks again. Dong On 8/1/07, Gabor Grothendieck [EMAIL PROTECTED]

Re: [R] plot matrix data- lattice?

2007-08-01 Thread Dong Guo
Thanks, Gabor. My matrix is from a big array(year, regions,variables). so, matrix does not have row names or col names, how could i add the col names or row names?? Thanks again. Dong On 8/1/07, Gabor Grothendieck [EMAIL PROTECTED] wrote: Try this: mat - matrix(1:24, 6, dimnames = list(year

Re: [R] plot

2007-07-31 Thread Greg Snow
show outliers that may be of interest. From: Dong GUO ?? [mailto:[EMAIL PROTECTED] Sent: Sat 7/28/2007 10:19 PM To: Greg Snow Cc: r-help@stat.math.ethz.ch Subject: Re: [R] plot Thanks again, Greg, It really helps. Would you please let me know more reference

Re: [R] plot

2007-07-30 Thread Dong GUO 郭东
Many thanks, Greg and Justin. The matrix is just a 26*31 matrix - 26 years, 31 regions. I am know to R, just dont know how to attach the data here yet.. As I have such matrices for nine indicators for all regions, so i could show some differences by 3D plot, which I did similar things in Excel.

Re: [R] plot

2007-07-30 Thread Dong GUO 郭东
Center Intermountain Healthcare [EMAIL PROTECTED] (801) 408-8111 -Original Message- From: Dong GUO ¹ù¶« [mailto:[EMAIL PROTECTED] Sent: Friday, July 27, 2007 12:09 PM To: Greg Snow Cc: r-help@stat.math.ethz.ch Subject: Re: [R] plot Many thanks, Greg and Justin

Re: [R] plot

2007-07-27 Thread Greg Snow
Graphs that rely on 3-d effects tend to distort the data rather than enlighten the viewer. If your goal is to distort the data (which I doubt), then most of us don't want to help. On the other hand, if you really do want to enlighten the viewer (even if that is just you), then tell us what

Re: [R] plot

2007-07-27 Thread Greg Snow
Center Intermountain Healthcare [EMAIL PROTECTED] (801) 408-8111 -Original Message- From: Dong GUO 郭东 [mailto:[EMAIL PROTECTED] Sent: Friday, July 27, 2007 12:09 PM To: Greg Snow Cc: r-help@stat.math.ethz.ch Subject: Re: [R] plot Many thanks, Greg and Justin. The matrix

Re: [R] plot centered line on barplot

2007-07-20 Thread Uwe Ligges
[EMAIL PROTECTED] wrote: Dear R user, I need plot an histogram for the occurrence of a dataset, and then add a line corresponding to the freuqnecy of another similar dataset. in order to do this i used the function hist_data1=hist(data1, breaks= seq(0,50,5), plot=FALSE)

Re: [R] plot only x- and y-axis with origin, no box()

2007-06-20 Thread Talloen, Willem [PRDBE]
: Greg Snow [mailto:[EMAIL PROTECTED] Sent: Tuesday, 19 June 2007 18:23 To: Talloen, Willem [PRDBE]; r-help@stat.math.ethz.ch Subject: RE: [R] plot only x- and y-axis with origin, no box() Try: plot(.., bty='l') Does that do what you want? (see the bty parameter in ?par for details) If you

Re: [R] plot only x- and y-axis with origin, no box()

2007-06-20 Thread Talloen, Willem [PRDBE]
perfect Romain, box( bty = l, lwd = 2 ) is the solution ! thank you all for your kind responses, willem -Original Message- From: Romain Francois [mailto:[EMAIL PROTECTED] Sent: Wednesday, 20 June 2007 10:01 To: Talloen, Willem [PRDBE] Subject: Re: [R] plot only x- and y-axis with origin

Re: [R] plot only x- and y-axis with origin, no box()

2007-06-19 Thread Marc Schwartz
On Tue, 2007-06-19 at 15:15 +0200, Talloen, Willem [PRDBE] wrote: hi all, I'm trying for quite some time to have an x- and y-axis, but no entire box. plot(..,axes=F) axis(1) axis(2) Gives this, but their axes do not go to the origin. Quite a number of people find this gap between the

Re: [R] plot only x- and y-axis with origin, no box()

2007-06-19 Thread Romain Francois
Hello, You are looking for the box function, and its bty argument. For example, this one will do the trick. R box( bty = L) ?par gives more information on the potential values for bty. Cheers, Romain Talloen, Willem [PRDBE] wrote: hi all, I'm trying for quite some time to have an x- and

Re: [R] plot only x- and y-axis with origin, no box()

2007-06-19 Thread Greg Snow
Try: plot(.., bty='l') Does that do what you want? (see the bty parameter in ?par for details) If you don't want the lines extending beyond the axes on the right and top then you could do something more like: plot(5:10, 5:10, bty='n') library(TeachingDemos) lines(cnvrt.coords( c(0,0,.5),

Re: [R] plot via xyplot not being saved

2007-06-15 Thread deepayan . sarkar
On 6/15/07, Benilton Carvalho [EMAIL PROTECTED] wrote: Hi everyone, it's been a while I've been trying to save a plot created via lattice:::xyplot if I have a file tst.R with the following code: y - rnorm(100) x - rnorm(100) z - sample(letters[1:4], 100, rep=T) library(lattice)

Re: [R] plot via xyplot not being saved

2007-06-15 Thread Benilton Carvalho
So, if those statements are inside a function, I have to make my function to have an 'echo' argument/functionality? eg.: ## begin test.R test - function(n){ y - rnorm(n) x - rnorm(n) z - sample(letters[1:4], n, rep=T) library(lattice) bitmap(tst.png) xyplot(y~x|z) dev.off()

Re: [R] plot via xyplot not being saved

2007-06-15 Thread deepayan . sarkar
On 6/15/07, Benilton Carvalho [EMAIL PROTECTED] wrote: So, if those statements are inside a function, I have to make my function to have an 'echo' argument/functionality? eg.: ## begin test.R test - function(n){ y - rnorm(n) x - rnorm(n) z - sample(letters[1:4], n, rep=T)

Re: [R] plot via xyplot not being saved

2007-06-15 Thread Benilton Carvalho
Thank you Deepayan, I understand the behavior of not printing out the results inside the functions. What I didn't know was that for xyplot() saving the plot actually meant save the result I see, which does not happen with plot(), in which case my function test() works just fine if I

Re: [R] plot(......,new=T) vs. par(new=T)

2007-05-22 Thread John Kane
?par There are several parameters can only be set by a call to par(): new You just were lucky enough to find one. --- jiho [EMAIL PROTECTED] wrote: Hello everybody, This is probably a classic but I cannot find an answer to this on the mailing list (i.e. with a google search restricted

Re: [R] plot(......,new=T) vs. par(new=T)

2007-05-22 Thread jiho
On 2007-May-22 , at 13:51 , John Kane wrote: ?par There are several parameters can only be set by a call to par(): new You just were lucky enough to find one. Yes sorry about that, I saw this afterwards. I read the help pages a while ago and it seems it's time to take a re-read tour.

Re: [R] plot problems

2007-05-21 Thread Roland Rau
Markus voigt wrote: because it should start at 2. Is there a parameter where you can define the start on the x-axis? Maybe this will help you? datax1 - 1:8 datax2 - 2:9 datay1 - runif(length(datax1)) datay2 - runif(length(datax2)) plot(x=datax1, y=datay1, type=l, col=blue, xlab=X,

Re: [R] plot cyrillic characters on MacOS X

2007-05-21 Thread Vlad Skvortsov
Prof Brian Ripley wrote: On Sat, 12 May 2007, Vlad Skvortsov wrote: Hi! I'm running R version 2.4.1 (2006-12-18) on MacOS X 10.4; my $LANG is ru_RU.KOI8-R. But we are told that all locales on MacOS X are actually UTF-8: it will not matter as R knows the charset it is using. I'm not sure

Re: [R] plot problems

2007-05-21 Thread Markus voigt
Hi Roland, thanks for your help. I can see that your exapmle do that what I want to have. Here my source code because your solution doesn't work for my data: currentarray etc. are vectors table(currentarray) currentarray 2 3 4 5 6 7 8 13 70 260 339 240 72 6

Re: [R] plot problems

2007-05-21 Thread Ben Bolker
Markus voigt markus-voigt at gmx.net writes: plot(table(currentarray)/1000,typ=b, col=c(red),ylim=c(0,0.8),xlim=c(1,8)) Not at all obvious but here's what you have to do to use the proper x values: t2 = table(currentarray2)/1000 x2 = as.numeric(names(t2)) t3 = table(probearray)/1000 x3 =

Re: [R] plot cyrillic characters on MacOS X

2007-05-12 Thread Prof Brian Ripley
On Sat, 12 May 2007, Vlad Skvortsov wrote: Hi! I'm running R version 2.4.1 (2006-12-18) on MacOS X 10.4; my $LANG is ru_RU.KOI8-R. But we are told that all locales on MacOS X are actually UTF-8: it will not matter as R knows the charset it is using. While trying to plot a graph to PDF

Re: [R] plot time series

2007-05-08 Thread Roland Rau
Hi Jessica [EMAIL PROTECTED] wrote: __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal,

Re: [R] plot time series

2007-05-08 Thread jessica . gervais
Dear All, I sended my first mail as HTML by accident. It has probably been stripped off... (see first mail below) During that time, I was actually able to find a solution to my problem : I wanted to plot times on a graph representing precipitation=f(time) here is an example: time-c(2004-10-18

Re: [R] plot time series

2007-05-08 Thread jessica . gervais
Dear all, I actually would like to improve the label orientation on the x-axis (turn them to 45 degrees) I tried the par(las=2) ... but doesn't work... Do anyone knows how to do ? Jessica __ R-help@stat.math.ethz.ch mailing list

Re: [R] plot time series

2007-05-08 Thread John Kane
The short answer is that you can't. The longer answer is that you need to replace them with text. Have a look at the FAQ 7.27 How can I create rotated axis labels? It provides a pretty good example. --- [EMAIL PROTECTED] wrote: Dear all, I actually would like to improve the label

Re: [R] plot log scale, axis original scale

2007-04-11 Thread Petr PIKAL
Hi Dean Sonneborn [EMAIL PROTECTED] napsal dne 10.04.2007 18:28:43: Petr, This is great! Thank you so much for responding. Could I get one more point clarified. My A values range from 1 to 35. I would really like to use something like AT=1 to 35 by 5 instead of AT=log(a). at=log(a)

Re: [R] plot log scale, axis original scale

2007-04-10 Thread Petr PIKAL
Hi [EMAIL PROTECTED] napsal dne 09.04.2007 22:10:22: I want to produce some boxplots and plot the logged values but have the axis scale in the original, not-logged scale. It seeming like I have the first few steps but I'm having trouble with the last. Here's what I'm doing (which I got

Re: [R] plot log scale, axis original scale

2007-04-09 Thread Peter Dalgaard
Dean Sonneborn wrote: I want to produce some boxplots and plot the logged values but have the axis scale in the original, not-logged scale. It seeming like I have the first few steps but I'm having trouble with the last. Here's what I'm doing (which I got for the documentation for boxplot

Re: [R] Plot symbols dimensions

2007-04-09 Thread Jorge Cornejo-Donoso
I have the same question/problem. I have a UTM plot, so the axes are in meters, and I need to represent each point of 50*50 m. It is any way to do it? -Mensaje original- De: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] En nombre de Cressoni, Massimo (NIH/NHLBI) [F] Enviado el: Domingo, 08

Re: [R] Plot symbols dimension

2007-04-09 Thread hadley wickham
There are several options - have you looked at grid? If you want to stick with base graphics, instead of using point glyphs, you could draw polygons at precisely the locations you specify. A glyph is a rendering of a point, a 0-dimensional object, so it is quite reasonable to argue that glyphs

Re: [R] Plot symbols dimensions

2007-04-09 Thread hadley wickham
Have you tried using polygons instead? That sounds like it would be more appropriate for your purpose. Hadley On 4/9/07, Jorge Cornejo-Donoso [EMAIL PROTECTED] wrote: I have the same question/problem. I have a UTM plot, so the axes are in meters, and I need to represent each point of 50*50

Re: [R] Plot degree symbol by itself

2007-03-29 Thread Henrik Andersson
Andre Jung wrote: Dear all, I'm trying to plot the degree symbol by itself between two square brackets. I just want to have K [°]. So far I got to: expression(K ~ group([,1*degree,])) or expression(K ~ group([,1^o,])) But it won't work without a number or letter. This worked for me:

Re: [R] Plot degree symbol by itself

2007-03-29 Thread Peter Dalgaard
Andre Jung wrote: Dear all, I'm trying to plot the degree symbol by itself between two square brackets. I just want to have K [°]. So far I got to: expression(K ~ group([,1*degree,])) or expression(K ~ group([,1^o,])) But it won't work without a number or letter. Any suggestions?

Re: [R] plot of computed vector

2007-03-25 Thread hadley wickham
I apologize for the non-programming language. I found what seems to be a strange behavior of plot(). The code follows: #_ N=3030; gn=.04; tn=1:100 n=N/(1+(N-1)*exp(-gn*tn)) N=n*(1-exp(-gn*tn))/(1-n*exp(-gn*tn)) plot(N) #strange plot N Have a look at diff(N)

Re: [R] plot of computed vector

2007-03-25 Thread Mihai Nica
Wow. I understand, thanks. m Mihai Nica 170 East Griffith St. G5 Jackson, MS 39201 601-914-0361 - Original Message From: hadley wickham [EMAIL PROTECTED] To: Mihai Nica [EMAIL PROTECTED] Cc: R list r-help@stat.math.ethz.ch Sent: Sunday, March 25, 2007 7:53:14 AM Subject: Re: [R] plot

Re: [R] plot(): I want to display dates on X-axis.

2007-03-05 Thread Petr Pikal
Hi you probably know that the second column are dates but your poor PC does not, so you should to tell him. You have several options: Change the column to suitable date format - see chron package or help pages related to date functions e.g. strptime, as.Date, ... and perform your plot.

Re: [R] plot(): I want to display dates on X-axis.

2007-03-05 Thread Alberto Monteiro
Sarthi M. wrote: I want to display dates on my x-axis of the plot. Dates are a problem. There's a standard for dates, but it seems that most users and software didn't catch up :-/ The variable dat is a data frame. The first column has numeric values and second column has date. e.g. dat

Re: [R] plot(): I want to display dates on X-axis.

2007-03-05 Thread jim holtman
You can also do it with the following: plot(as.POSIXct(strptime(as.character(dat[,2]), %Y%m%d)), dat[,1]) On 3/5/07, d. sarthi maheshwari [EMAIL PROTECTED] wrote: Hi, I want to display dates on my x-axis of the plot. I was trying to use plot() command for the same and passing the values

Re: [R] plot groupedData in nlme

2007-03-04 Thread Renaud Lancelot
library(nlme) trellis.par.set(list(superpose.line = list(col = black))) plot(Dialyzer, outer = ~QB, key = FALSE, col = black) I prefer to use directly xyplot (package lattice) for a finer control. Best, Renaud 2007/3/4, Qiong Yang [EMAIL PROTECTED]: Hi, Does anyone know how to make the

Re: [R] plot of 2 time series with very different values

2007-03-02 Thread Petr Pikal
Hi I use a function plot.yy which i designed for convenieant plotting on 2 y axes for myself (see code below). You can modify its internals to suit your needs easily but this will give you something quite close. plot.yy(1996:2000, c(80, 100, 95, 35, 28), c(7,8,6, 2, 3), xlim=c(1996, 2000),

Re: [R] plot of 2 time series with very different values

2007-03-02 Thread Berta
Thank you so much Petr, it is exaclty what I was looking for!! Berta. Hi I use a function plot.yy which i designed for convenieant plotting on 2 y axes for myself (see code below). You can modify its internals to suit your needs easily but this will give you something quite close.

Re: [R] plot of 2 time series with very different values

2007-03-02 Thread Gabor Grothendieck
There is an example in the example section of plotting two time series on the same plot with different left hand and right hand scales here: library(zoo) ?plot.zoo On 3/2/07, Berta [EMAIL PROTECTED] wrote: Hi R-Users, I am trying to plot two time series in the same plot, but they measure

Re: [R] plot with fixed axis proportion

2007-03-02 Thread Gabor Grothendieck
See the aspect argument, asp, in ?plot.default . Also eqscplot in MASS. On 3/2/07, Thomas Steiner [EMAIL PROTECTED] wrote: I want to plot something (eg a circle) with a fixed ratio of the x and y axis, or (even better) with a fixed size when I print it. Output should then be a circle

Re: [R] plot with fixed axis proportion

2007-03-02 Thread Greg Snow
Your question can be interpreted a couple of ways, Gabor gave you the answer to one of those interpretations. Another interpretation of your question makes it the same as one that was asked earlier in the week with the subject: PLotting R graphics/symbols without user x-y scaling, looking at that

Re: [R] plot portion of a line

2007-01-16 Thread Dimitris Rizopoulos
you could try something like the following: x - rnorm(50) y - rnorm(50) obj - lm(y ~ x) par(mfrow = c(2, 2)) plot(x, y, main = x -1) x. - c(min(x), -1) y. - predict(obj, data.frame(x = x.)) lines(x., y.) plot(x, y, main = x 1) x. - c(1, max(x)) y. - predict(obj, data.frame(x = x.)) lines(x.,

Re: [R] plot portion of a line

2007-01-16 Thread Gabor Grothendieck
Use segments. In the following we overlay the black abline with a wider red segments line segment: set.seed(1) x - rnorm(50) y - rnorm(50) plot(y ~ x) y.lm - lm(y ~ x) abline(y.lm) # omit this line if black abline not wanted x0 - c(-2, 4) y0 - predict(y.lm, list(x = x0)) segments(x0[1],

Re: [R] plot portion of a line

2007-01-16 Thread Gabor Grothendieck
As in Dmitris' post lines is a somewhat more succint so here it is again replacing segments with lines: set.seed(1) x - rnorm(50) y - rnorm(50) plot(y ~ x) y.lm - lm(y ~ x) abline(y.lm) # omit this line if black abline not wanted x0 - c(-2, 4) y0 - predict(y.lm, list(x = x0)) lines(y0 ~

Re: [R] plot portion of a line

2007-01-16 Thread Greg Snow
Try the clipplot function from the TeachingDemos package: x - rnorm(50) y - rnorm(50) plot(x,y) clipplot( abline(lm(y~x), col='red'), xlim=c(1,3)) clipplot( abline(lm(y~x), col='blue'), xlim=c(-2,1)) Hope this helps, -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain

Re: [R] Plot .jpeg image in margins?

2007-01-08 Thread Oleg Sklyar
I am not sure what you mean by in margins, if this is keeping the aspect ration, then the answer is yes. Please check EBImage, http://www.ebi.ac.uk/~osklyar/EBImage/ . The package will allow to read/write images in most image formats, the method image() redefined for the Image class will produce

Re: [R] Plot .jpeg image in margins?

2007-01-08 Thread Greg Snow
Here is one example of a way to do it: library(rimage) # for the read.jpeg function library(TeachingDemos) # for the subplot function par(xpd=NA,mar=c(5,4,4,8)+0.1) plot(1:10,10:1) x - read.jpeg(system.file(data, cat.jpg, package=rimage)) subplot( plot(x), 12, 5 ) Hope this helps, --

Re: [R] Plot window - save as Postscript question

2006-12-28 Thread Uwe Ligges
Knut Krueger wrote: R 2.4.0 for Windows The following plot appears as a squared window (as all r-plots) Not all subtitles are visible, but all subtitle will appear, when changing the aspect ratio of the plot window with the mouse to a wide format. But does not work when using the save

Re: [R] Plot window - save as Postscript question

2006-12-28 Thread Knut Krueger
Uwe Ligges schrieb: Yes: Use the postscript() device explicitly and define the width and height in the function call. I tried it before but I think I did a mistake: Does the width and height command not work with If paper=letter ? The plot was cutted at the upper boarder of the paper

Re: [R] plot

2006-12-18 Thread Chuck Cleland
XinMeng wrote: Hello sir: a data with 2 columns: id x a 1 b 2 c 3 I wanna get such kind of plot: x: a b c y:1 2 3 But the plot command doesn't permit string character as x. How can I get it ? What sort of plot do you want? For a barplot() of x with bars labeled by id you

Re: [R] plot

2006-12-18 Thread John Kane
--- XinMeng [EMAIL PROTECTED] wrote: Hello sir: a data with 2 columns: id x a 1 b 2 c 3 I wanna get such kind of plot: x: a b c y:1 2 3 But the plot command doesn't permit string character as x. How can I get it ? Thanks a lot ! My best It is not clear exactly what

Re: [R] plot

2006-12-18 Thread Rene Braeckman
You can do something like this for a scatter plot: x - c(a,b,c) y - c(1,2,3) xnum - rep(1:length(x)) plot(x=xnum, y=y, xlab=x, xaxt=n) axis(side=1, at=xnum, labels=x) This fakes a numerical axis and suppresses the y-axis labels that you then draw with the axis function the way that you want

Re: [R] plot p(Y=1) vs as

2006-11-26 Thread David Barron
I'd recommend having a look at the lrm function in the Design package. Looking at the examples should show you how you can product this type of plot using some of the other components of this package. On 26/11/06, Aimin Yan [EMAIL PROTECTED] wrote: I am trying to fit a logistic regression model

Re: [R] Plot with two seperate y axis

2006-11-26 Thread Jim Lemon
Thorsten Muehge wrote: Hello, I would like to plot the following matrix: Wk=x achsis. Para 1 = left y-axis as a barplot para 2 right y-axis as a normal scatter plat. I could not find such a solution in any of my documentation. Can someone help me? Thanks a lot Thorsten WkPara

Re: [R] Plot with two seperate y axis

2006-11-24 Thread David Barron
Assuming the data are in a data frame called dt, this should work: plot(dt$Wk,dt$Para1,type=h) par(new=TRUE) plot(dt$Wk,dt$Para2,yaxt=n) axis(4,at=97:100) On 24/11/06, Thorsten Muehge [EMAIL PROTECTED] wrote: Hello, I would like to plot the following matrix: Wk=x achsis. Para 1 = left

Re: [R] Plot title with numeric variables

2006-11-15 Thread Thomas Lumley
On Tue, 14 Nov 2006, RMan54 wrote: This works for the original posted question: n-5 title - bquote(bold(paste(Figure , .(n), : Plot , C[max], versus CrCl))) plot(1, main=title) However, my problem is that I want to define the text before the value of n is known. The idea is that the

Re: [R] Plot title with numeric variables

2006-11-14 Thread rolf
The key thing is the function bquote(). E.g. N - 5 xxx - bquote(bold(Figure~.(N)~Plot~C[max]~versus CrCl)) plot(1:10,main=xxx) (Not sure about the ``bold'' business, but R doesn't object.) Or to take a simpler and clearer example: N - 5

Re: [R] Plot title with numeric variables

2006-11-14 Thread Rene Braeckman
To: [EMAIL PROTECTED] Cc: r-help@stat.math.ethz.ch Subject: Re: [R] Plot title with numeric variables The key thing is the function bquote(). E.g. N - 5 xxx - bquote(bold(Figure~.(N)~Plot~C[max]~versus CrCl)) plot(1:10,main=xxx) (Not sure about the ``bold'' business

Re: [R] Plot title with numeric variables

2006-11-14 Thread Rene Braeckman
cat doesn't work with bquoted arguments. At least not with the simple cat(xxx, ccc). Rene _ From: Jeffrey Robert Spies [mailto:[EMAIL PROTECTED] Sent: Tuesday, November 14, 2006 1:58 PM To: Rene Braeckman Cc: r-help Subject: Re: [R] Plot title with numeric variables How about using

Re: [R] Plot title with numeric variables

2006-11-14 Thread Jeffrey Robert Spies
@stat.math.ethz.ch Subject: Re: [R] Plot title with numeric variables The key thing is the function bquote(). E.g. N - 5 xxx - bquote(bold(Figure~.(N)~Plot~C[max]~versus CrCl)) plot(1:10,main=xxx) (Not sure about the ``bold'' business, but R doesn't object.) Or to take

Re: [R] Plot title with numeric variables

2006-11-14 Thread RMan54
This works for the original posted question: n-5 title - bquote(bold(paste(Figure , .(n), : Plot , C[max], versus CrCl))) plot(1, main=title) However, my problem is that I want to define the text before the value of n is known. The idea is that the title is defined ahead, passed to a function

Re: [R] plot pch

2006-11-09 Thread Joris De Wolf
Somebody will come up with a more elagant solution, but a quick fix would be: plot(df$Y[df$pch_type != 21],df$X[df$pch_type != 21], pch=df$pch_type[df$pch_type != 21]) points(df$Y[df$pch_type == 21],df$X[df$pch_type == 21],pch= 21) Marc Bernard wrote: Dear All, I have a data as

Re: [R] plot questions?

2006-11-07 Thread Uwe Ligges
zhijie zhang wrote: Dear Rusers, I want to know which function in R can perform the following tasks: 1.surface-data grid(x,y,z) #which could be done in splus, the name was from splus's options of graph 2. contourplot(x,y,z) #which could be done in splus By the way, where can i find

Re: [R] plot questions?-errors in persp(x1, x2, y) and contour(x1, x2, y)

2006-11-07 Thread zhijie zhang
Dear Uwe Ligges , I still can't finish it. * aa* #my data x1 x2 y 50.05 6 4.4180 10.50 3 2.6979 40.50 9 2.9000 70.95 6 2.6230 80.95 6 2.9078 90.95 6 2.6727 31.40 3 2.4203 21.40 9 2.5329 6 1.85 6 2.4867 * attach(aa)* * persp(x1,x2,y* error in

Re: [R] plot questions?-errors in persp(x1, x2, y) and contour(x1, x2, y)

2006-11-07 Thread Uwe Ligges
zhijie zhang wrote: Dear Uwe Ligges , I still can't finish it. * aa* #my data x1 x2 y 50.05 6 4.4180 10.50 3 2.6979 40.50 9 2.9000 70.95 6 2.6230 80.95 6 2.9078 90.95 6 2.6727 31.40 3 2.4203 21.40 9 2.5329 6 1.85 6 2.4867 *

Re: [R] plot history

2006-10-30 Thread David Barron
Are you working in Windows? If so, you can turn on recording either in the History menu on the active graphics device window, or by using windows(record=TRUE) to open a new device. On 30/10/06, Rohini Mulford [EMAIL PROTECTED] wrote:

Re: [R] plot history

2006-10-30 Thread Leeds, Mark \(IED\)
I send them all to one postscript file and then bring it up in ghostview but maybe there is another way. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Rohini Mulford Sent: Monday, October 30, 2006 5:29 PM To: r-help@stat.math.ethz.ch Subject: [R] plot

Re: [R] plot history

2006-10-30 Thread Mihai Nica
Or maybe see ?win.graph. Before each graph use something like: win.graph(width=3,height=3, pointsize=8) You will get a sandwich of graphs. hth, Mihai Nica 170 East Griffith St. G5 Jackson, MS 39201 601-914-0361 - Original Message From: Rohini Mulford [EMAIL PROTECTED] To:

Re: [R] plot correlation matrix

2006-09-21 Thread Earl F. Glynn
Vladimir Eremeev [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Dear useRs, While exploring new R packages, I have found the Rattle. This screenshot http://rattle.togaware.com/rattle-correlation.png is very interesting Which function was used to produce this plot?

Re: [R] plot correlation matrix

2006-09-21 Thread BBands
On 9/21/06, Earl F. Glynn [EMAIL PROTECTED] wrote: Which function was used to produce this plot? library(ellipse) ?plotcorr Look at the third example for the color plot. That's pretty nice. I have been using symnum(). Are there any other neat visualisations for correlation matrices?

Re: [R] plot correlation matrix

2006-09-21 Thread mel
BBands a écrit : That's pretty nice. I have been using symnum(). Are there any other neat visualisations for correlation matrices? Although very simple, I find often image() sufficient. Plus some ordering if needed. __ R-help@stat.math.ethz.ch

Re: [R] plot region too large

2006-09-15 Thread Prof Brian Ripley
On Fri, 15 Sep 2006, Kiermeier, Andreas (PIRSA - SARDI) wrote: The figure margins come from what is set in par(mar), eg layout(matrix(c(1:10),5,2),heights=c(1,rep(2,4))) par(mar) [1] 5.1 4.1 4.1 2.1 There is not enough space left to plot anything with those margins. You will need to

Re: [R] plot region too large

2006-09-14 Thread Kiermeier, Andreas \(PIRSA - SARDI\)
The figure margins come from what is set in par(mar), eg layout(matrix(c(1:10),5,2),heights=c(1,rep(2,4))) par(mar) [1] 5.1 4.1 4.1 2.1 There is not enough space left to plot anything with those margins. You will need to make them smaller first, e.g. par(mar=c(1,1,1,1,)) plot(1,1) In

Re: [R] plot axises on both sides of a graph

2006-09-06 Thread JeeBee
Look at: ?axis (try the examples) Further, a nice example I found on this mailing lists archive, from somebody who says this has been asked many times already :) x - 1:10 y1 - 1:10 y2 - rev(seq(1,1000, length=10)) plot(x,y1,ann=FALSE) axis(2, at=c(2,4,6,8), labels=as.character(c(2,4,6,8)))

Re: [R] plot a new picture against an old one to see the difference between them

2006-09-05 Thread Ales Ziberna
, that's really helpful, do you know how to deal with it if the two plots are generated by plot(), not by contour(). Best, Leon - Original Message - From: roger koenker [EMAIL PROTECTED] To: Am Stat [EMAIL PROTECTED] Sent: Monday, September 04, 2006 8:06 PM Subject: Re: [R

  1   2   3   4   >