Hi all I want to apply different colors on a simple plot: If I type par(br="gray") before a plot it puts all the image in gray but (imagine I run a simple plot) want to let the centrall box (where the dots are plotted) in white or image in lightblue. Can anyone guide me to apply this second step (make the box where the series are plotted in different colours). Thanks in advance. [[alternative HTML version deleted]]
If I understand what you want correctly, you'll probably want to use the "col" argument in whatever base graphics function you're using, rather than changing something in the graphical parameters. For example, if I wanted to add red points to an existing plot, I would use something like points(c(1:10), col="red") Or, if I wanted to generate a barplot using a shading color other than gray, barplot(c(1:10), col="steelblue") Does that answer your question? Kyle H. Ambert Fellow, National Library of Medicine Department of Medical Informatics & Clinical Epidemiology Oregon Health & Science University On Tue, Jan 26, 2010 at 6:44 AM, Jose Narillos de Santos < narillosdesantos@gmail.com> wrote:> Hi all I want to apply different colors on a simple plot: > > If I type par(br="gray") before a plot it puts all the image in gray but > (imagine I run a simple plot) want to let the centrall box (where the dots > are plotted) in white or image in lightblue. > > Can anyone guide me to apply this second step (make the box where the > series > are plotted in different colours). > > Thanks in advance. > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help@r-project.org 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, self-contained, reproducible code. >[[alternative HTML version deleted]]
Hi Jim, Last question. I´m using a spanish version (there are some documents on how constructing good plots and I have found them althought not very intuitive...) I will read them in a next days. Only if you know the way. Imagine I have made a plot like plot(x,y) and I use labels (on each cross point appears a name) but they appear on the dot ¿Do you know some way to show the label below the dot? there is some way to indicate the program try to not to overlap labels (if they are very near?) Happy nice wekend all¡¡¡ 2010/1/29 Jim Lemon <jim@bitwrit.com.au>> On 01/29/2010 10:08 AM, Jose Narillos de Santos wrote: > >> Hi Jim your suggestion doesn´t work properly. I have find some documents >> on graphs so let me think till monday and if not I will detail where it >> fails. >> Sorry again...I feel very silly, really, it is not a joke but I will >> continue trying... >> I have a question also, in a general plot (please if you can help me it >> would be fantastic) >> Imagine again a plot >> >> > x <- rnorm(10) >> >> > y <- rnorm(10) >> >> If I plot(x,y) >> >> it appears a scatter plot. >> >> If you see y axis (the y axis on the left) has numbers. But the parallel >> (imaginary) y axis on the right appears only as a line (without the >> numbers, the scale). >> >> Do you know how to show the scale the same numbers in both (left and >> right axis)? I think this way the graphs seem more simetrical. >> > Hi Jose, > Try this: > > par(mar=c(5,4,4,4)) > plot(rnorm(10),rnorm(10)) > axis(4) > > Jim > >[[alternative HTML version deleted]]
On 01/30/2010 10:29 AM, Jose Narillos de Santos wrote:> Hi Jim, > Last question. > I?m using a spanish version (there are some documents on how > constructing good plots and I have found them althought not very > intuitive...) I will read them in a next days. > Only if you know the way. > Imagine I have made a plot like plot(x,y) > and I use labels (on each cross point appears a name) but they appear on > the dot ?Do you know some way to show the label below the dot? there is > some way to indicate the program try to not to overlap labels (if they > are very near?)Hi Jose, In fact, I can point you to the thigmophobe.labels function in the plotrix package, which attempts to avoid collisions between labels in just that manner. Jim