0

I was wondering if it is possible to call a plot from a value. Something like this:

MyPlot <- plot(1:10,2:11)
MyPlot # Now the plot should appear

But this is not working. I also tried plot(MyPlot) and print(MyPlot).

Do you guy have any ideas?

My intention is to fill a matrix of plots

layout(matrix(1:4,ncol=2))
MyPlot
MyPlot2
MyPlot3
MyPlot4
layout(1)

Thank you!

Frosi
  • 177
  • 5
  • 12
  • 1
    see http://stackoverflow.com/questions/29583849/r-saving-a-plot-in-an-object. If you want to display multiple plots (e.g. 4) use `par(mfrow=c(2,2))` – timfaber Apr 24 '17 at 15:53
  • Hi, thanks! I did it with recordPlot , but those recorded Plots do not work with par(mfrow). They appear as a single Plot. Do you have any ideas? Thanks! – Frosi Apr 25 '17 at 14:38
  • I like the second solution better, the one requiring `(pryr)`. Try something like: `par(mfrow=c(2,2)); a % – timfaber Apr 25 '17 at 14:44
  • Maybe can I ask one more question please? The plot I want to save has this layout: par(mar=c(0.1,0.1,0.1,0.1)+1); par(plt=c(0.05,1,0,1)) - so it's containing two plots. When I call this plot, it always appears as a new plot and it's not ordering itself in par(mfrow...) . Is there a trick? – Frosi May 03 '17 at 15:31
  • Defining the mar and plt part does not define the number of plots being called, do you want to plot a two times using the plt/mar settings? – timfaber May 04 '17 at 07:22

0 Answers0