Hi there, I hope to draw a plot like this: http://www.sg-chem.net/swizard/Ru-bqdi-spectra.gif is it possible to draw it using R? thanks for any suggestions. regards, Jinsong
Jinsong Zhao wrote:> > Hi there, > > I hope to draw a plot like this: > http://www.sg-chem.net/swizard/Ru-bqdi-spectra.gif > > is it possible to draw it using R? > > thanks for any suggestions. >My intuition would say yes it is possible as R graphics are highly flexible. I'm afraid I don't know how though, but the following may be useful resources in working out the code... R Graphics Gallery (including sample code): http://addictedtor.free.fr/graphiques/ R Graphics by Paul Murrell (web-site to accompany book, which you have to buy) : http://www.stat.auckland.ac.nz/~paul/RGraphics/rgraphics.html Another R Graphics Gallery : http://research.stowers-institute.org/efg/R/ A number of links in the R wiki to graphics resources : http://wiki.r-project.org/rwiki/doku.php?id=links:links ...in particular the following site which contains ~8000 graph examples (again including example code) :http://bm2.genes.nig.ac.jp/RGM2/index.php Neil -- View this message in context: http://www.nabble.com/How-to-draw-a-plot-like-this--tp19486984p19489416.html Sent from the R help mailing list archive at Nabble.com.
Jinsong Zhao wrote:> Hi there, > > I hope to draw a plot like this: > http://www.sg-chem.net/swizard/Ru-bqdi-spectra.gif > > is it possible to draw it using R? > >Hi Jinsong, Look at the subplot function in the TeachingDemos package. Jim
I think the function split.screen() in 'graphics' package is enough
for this task. For example,
##
fig.loc = matrix(c(0, 1, 0, 1, 0.1, 0.6, 0.5, 0.9),
2, byrow = T)
x = split.screen(fig.loc)
par(mar = c(3, 3, 1, 1))
screen(1)
plot(rnorm(100))
screen(2)
plot(rnorm(20), type = "h")
Yihui
On Mon, Sep 15, 2008 at 12:00 PM, Jinsong Zhao <jszhao at
mail.hzau.edu.cn> wrote:> Hi there,
>
> I hope to draw a plot like this:
> http://www.sg-chem.net/swizard/Ru-bqdi-spectra.gif
>
> is it possible to draw it using R?
>
> thanks for any suggestions.
>
> regards,
> Jinsong
>
--
Yihui Xie <xieyihui at gmail.com>
Phone: +86-(0)10-82509086 Fax: +86-(0)10-82509086
Mobile: +86-15810805877
Homepage: http://www.yihui.name
School of Statistics, Room 1037, Mingde Main Building,
Renmin University of China, Beijing, 100872, China
Neil Shephard wrote:> > Jinsong Zhao wrote: >> Hi there, >> >> I hope to draw a plot like this: >> http://www.sg-chem.net/swizard/Ru-bqdi-spectra.gif >> >> is it possible to draw it using R? >> >> thanks for any suggestions. >> > > My intuition would say yes it is possible as R graphics are highly flexible. > > I'm afraid I don't know how though, but the following may be useful > resources in working out the code... > > R Graphics Gallery (including sample code): > http://addictedtor.free.fr/graphiques/ > > R Graphics by Paul Murrell (web-site to accompany book, which you have to > buy) : http://www.stat.auckland.ac.nz/~paul/RGraphics/rgraphics.html > > Another R Graphics Gallery : http://research.stowers-institute.org/efg/R/ > > A number of links in the R wiki to graphics resources : > http://wiki.r-project.org/rwiki/doku.php?id=links:links > > ...in particular the following site which contains ~8000 graph examples > (again including example code) :http://bm2.genes.nig.ac.jp/RGM2/index.php > > > NeilThank you very much for your information. I have try to draw it with dirty tricks, something like: # first plot the large plot op <- par() par(mar = c(15, 6, 6, 15) + 0.1) par(new = TRUE) # the plot the small one par(op) In the last step, it give some warnings: 1: In par(op) : graphical parameter "cin" cannot be set 2: In par(op) : graphical parameter "cra" cannot be set 3: In par(op) : graphical parameter "csi" cannot be set 4: In par(op) : graphical parameter "cxy" cannot be set 5: In par(op) : graphical parameter "din" cannot be set however, it seems that it dose not affect the results. Thanks again, Jinsong