Development

NAVIGATION
CATEGORIES
REFERRENCE
LINKS
  • wireplot margins and additional z-axis

    5 answers - 1326 bytes - related search similar search Add To My Delicious Add To My Stumble Upon Add To My Google Mark Add To My Facebook Add To My Digg Add To My Reddit

    Dear R experts,
    it would be very kind if you could help me with two wireplot problems.
    First, when I make a wireplot and transform it into an .eps using the postscript function the eps-file leaves always a lot of space below the plot, as if it would leave space for a legend or something like that.
    How can i get the plot into the bottom corner without the space below? The space is not there when I just display the plot in R on my screen (I use R.2.3.1 on Windows XP). in general, how can I get the margins on all sides as small as possible since I wnat to include the eps into a report and do not need the space around.
    The following code has the space on the eps:
    library(lattice)
    plot.vol <- wireframe(volcano, aspect = 1, scales=list(arrows=F) ,zlab=list("Z-axis",rot=90))
    postscript("example_plot.eps", width = 14.0/2.54, height = 19.0/2.54,
    horizontal = FALSE, onefile = FALSE,paper="special")
    trellis.par.set("axis.line",list(alpha=1,col=1,lty=0,lwd=1))
    print(plot.vol)
    dev.off()
    Secondly, is it possible to add to the wireplot a further z-axis. I found only how to choose at which veritcal line I want the tickmarks and label, but is it also possible to have it at two vertical lines?
    Thank you very much for your help!
    Klaus
  • No.1 | | 1703 bytes | |

    9/11/06, Klaus Nordhausen <klausch (AT) gmx (DOT) dewrote:
    Dear R experts,

    it would be very kind if you could help me with two wireplot problems.

    First, when I make a wireplot and transform it into an .eps using the postscript function the eps-file leaves always a lot of space below the plot, as if it would leave space for a legend or something like that.
    How can i get the plot into the bottom corner without the space below? The space is not there when I just display the plot in R on my screen (I use R.2.3.1 on Windows XP). in general, how can I get the margins on all sides as small as possible since I wnat to include the eps into a report and do not need the space around.

    The following code has the space on the eps:

    library(lattice)
    plot.vol <- wireframe(volcano, aspect = 1, scales=list(arrows=F) ,zlab=list("Z-axis",rot=90))

    Perhaps you want something like

    aspect = c(1, 1.5)

    instead.

    postscript("example_plot.eps", width = 14.0/2.54, height = 19.0/2.54,
    horizontal = FALSE, onefile = FALSE,paper="special")

    trellis.par.set("axis.line",list(alpha=1,col=1,lty=0,lwd=1))

    print(plot.vol)

    dev.off()
    --
    Secondly, is it possible to add to the wireplot a further z-axis. I found only how to choose at which veritcal line I want the tickmarks and label, but is it also possible to have it at two vertical lines?

    No (but it shouldn't be too hard to add that feature; I'll have to check).

    Deepayan

    R-help (AT) stat (DOT) math.ethz.ch mailing list

    PLEASE do read the posting guide
    and provide commented, minimal, self-contained, reproducible code.
  • No.2 | | 2414 bytes | |

    9/12/06, Klaus Nordhausen <klausch (AT) gmx (DOT) dewrote:
    Dear Deepayan,

    thanks for your reply, the change of the aspect does however not solve my problem with the space below the graph on the .eps
    I attached the .eps (still with the old aspect) so that it is maybe clearer what my
    problem is.

    No, it's not clearer; this is basically the same EPS that I got, so it
    gives me no new information. What do you get with the new aspect? If
    it's not what you want, you'll have to explain what you want more
    clearly. Also, don't make the panel borders transparent, as it makes
    it difficult to understand what's going on.

    Deepayan

    Any other suggestions?

    Klaus
    --
    Dear R experts,

    it would be very kind if you could help me with two wireplot problems.

    First, when I make a wireplot and transform it into an .eps using the
    postscript function the eps-file leaves always a lot of space below the plot,
    as if it would leave space for a legend or something like that.
    How can i get the plot into the bottom corner without the space below?
    The space is not there when I just display the plot in R on my screen (I use
    R.2.3.1 on Windows XP). in general, how can I get the margins on all
    sides as small as possible since I wnat to include the eps into a report and
    do not need the space around.

    The following code has the space on the eps:

    library(lattice)
    plot.vol <- wireframe(volcano, aspect = 1, scales=list(arrows=F)
    ,zlab=list("Z-axis",rot=90))
    --
    Perhaps you want something like

    aspect = c(1, 1.5)

    instead.

    postscript("example_plot.eps", width = 14.0/2.54, height = 19.0/2.54,
    horizontal = FALSE, onefile = FALSE,paper="special")

    trellis.par.set("axis.line",list(alpha=1,col=1,lty=0,lwd=1))

    print(plot.vol)

    dev.off()
    --
    Secondly, is it possible to add to the wireplot a further z-axis. I
    found only how to choose at which veritcal line I want the tickmarks and label,
    but is it also possible to have it at two vertical lines?
    --
    No (but it shouldn't be too hard to add that feature; I'll have to check).

    Deepayan

    R-help (AT) stat (DOT) math.ethz.ch mailing list

    PLEASE do read the posting guide
    and provide commented, minimal, self-contained, reproducible code.
  • No.3 | | 3786 bytes | |

    Dear Deepayan,

    sorry for not being clear - but my problem has nothing to do with the aspect. If I create the eps the following way

    library(lattice)
    plot.vol<- wireframe(volcano,
    aspect = c(1,1.5), scales=list(arrows=F),zlab=list("Z-axis",rot=90))

    postscript("example_plot_3.eps", width = 14.0/2.54, height = 19.0/2.54,
    horizontal = FALSE, onefile = FALSE,paper="special")
    trellis.par.set("axis.line",list(alpha=1,col=1,lty=1,lwd=1))
    print(plot.vol)
    dev.off()

    The plot is still not in the left bottom corner of the file. There is a lot of space below the outer box line. If I include this eps in latex it will also include this space and if I put for example the figure caption below it I have this huge gap between actual graph and caption.

    And for comparison, if I create with xyplot an eps like

    postscript("example_plot_4.eps", width = 14.0/2.54, height = 19.0/2.54,
    horizontal = FALSE, onefile = FALSE,paper="special")

    Depth <- equal.count(quakes$depth, number=8, overlap=.1)
    plot.depth<-xyplot(lat ~ long | Depth, data = quakes)
    update(trellis.last.object(),
    strip = strip.custom(strip.names = TRUE, strip.levels = TRUE),
    par.strip.text = list(cex = 0.75),
    aspect = "iso")

    print(plot.depth)
    dev.off()

    the figure is really in the left bottom corner and included in latex has not that gap between caption and actual figure.

    I hope this describes my problem better.

    Klaus

    9/12/06, Klaus Nordhausen <klausch (AT) gmx (DOT) dewrote:
    Dear Deepayan,

    thanks for your reply, the change of the aspect does however not solve
    my problem with the space below the graph on the .eps
    I attached the .eps (still with the old aspect) so that it is maybe
    clearer what my
    problem is.

    No, it's not clearer; this is basically the same EPS that I got, so it
    gives me no new information. What do you get with the new aspect? If
    it's not what you want, you'll have to explain what you want more
    clearly. Also, don't make the panel borders transparent, as it makes
    it difficult to understand what's going on.

    Deepayan

    Any other suggestions?

    Klaus
    --
    Dear R experts,

    it would be very kind if you could help me with two wireplot
    problems.

    First, when I make a wireplot and transform it into an .eps using
    the
    postscript function the eps-file leaves always a lot of space below
    the plot,
    as if it would leave space for a legend or something like that.
    How can i get the plot into the bottom corner without the space
    below?
    The space is not there when I just display the plot in R on my screen
    (I use
    R.2.3.1 on Windows XP). in general, how can I get the margins on
    all
    sides as small as possible since I wnat to include the eps into a
    report and
    do not need the space around.

    The following code has the space on the eps:

    library(lattice)
    plot.vol <- wireframe(volcano, aspect = 1, scales=list(arrows=F)
    ,zlab=list("Z-axis",rot=90))
    --
    Perhaps you want something like

    aspect = c(1, 1.5)

    instead.

    postscript("example_plot.eps", width = 14.0/2.54, height =
    19.0/2.54,
    horizontal = FALSE, onefile = FALSE,paper="special")

    trellis.par.set("axis.line",list(alpha=1,col=1,lty=0,lwd=1))

    print(plot.vol)

    dev.off()
    --
    Secondly, is it possible to add to the wireplot a further z-axis. I
    found only how to choose at which veritcal line I want the tickmarks
    and label,
    but is it also possible to have it at two vertical lines?
    --
    No (but it shouldn't be too hard to add that feature; I'll have to
    check).

    Deepayan
  • No.4 | | 5402 bytes | |

    9/13/2006 4:04 AM, Klaus Nordhausen wrote:
    Dear Deepayan,

    sorry for not being clear - but my problem has nothing to do with the aspect. If I create the eps the following way

    There is some ambiguity here. The "aspect" arg to wireframe controls
    the 3D aspect ratio. You want to control the 2D aspect ratio in the
    displayed plot. It is stored in the aspect.ratio member of the
    resulting object, and can be changed using

    plot.vol$aspect.ratio <- 1.5

    for example. You shouldn't really be fiddling around inside the object
    like that, but I don't know how to avoid it in this case.

    Duncan Murdoch

    library(lattice)
    plot.vol<- wireframe(volcano,
    aspect = c(1,1.5), scales=list(arrows=F),zlab=list("Z-axis",rot=90))

    postscript("example_plot_3.eps", width = 14.0/2.54, height = 19.0/2.54,
    horizontal = FALSE, onefile = FALSE,paper="special")
    trellis.par.set("axis.line",list(alpha=1,col=1,lty=1,lwd=1))
    print(plot.vol)
    dev.off()

    The plot is still not in the left bottom corner of the file. There is a lot of space below the outer box line. If I include this eps in latex it will also include this space and if I put for example the figure caption below it I have this huge gap between actual graph and caption.

    And for comparison, if I create with xyplot an eps like

    postscript("example_plot_4.eps", width = 14.0/2.54, height = 19.0/2.54,
    horizontal = FALSE, onefile = FALSE,paper="special")

    Depth <- equal.count(quakes$depth, number=8, overlap=.1)
    plot.depth<-xyplot(lat ~ long | Depth, data = quakes)
    update(trellis.last.object(),
    strip = strip.custom(strip.names = TRUE, strip.levels = TRUE),
    par.strip.text = list(cex = 0.75),
    aspect = "iso")

    print(plot.depth)
    dev.off()

    the figure is really in the left bottom corner and included in latex has not that gap between caption and actual figure.

    I hope this describes my problem better.

    Klaus


    >9/12/06, Klaus Nordhausen <klausch (AT) gmx (DOT) dewrote:
    >Dear Deepayan,
    >>

    >thanks for your reply, the change of the aspect does however not solve
    >my problem with the space below the graph on the .eps
    >I attached the .eps (still with the old aspect) so that it is maybe
    >clearer what my
    >problem is.
    >
    >No, it's not clearer; this is basically the same EPS that I got, so it
    >gives me no new information. What do you get with the new aspect? If
    >it's not what you want, you'll have to explain what you want more
    >clearly. Also, don't make the panel borders transparent, as it makes
    >it difficult to understand what's going on.
    >
    >Deepayan
    >
    >Any other suggestions?
    >>

    >Klaus
    >>
    >>

    >Dear R experts,
    >>

    >it would be very kind if you could help me with two wireplot
    >problems.
    >>

    >First, when I make a wireplot and transform it into an .eps using
    >the
    >postscript function the eps-file leaves always a lot of space below
    >the plot,
    >as if it would leave space for a legend or something like that.
    >How can i get the plot into the bottom corner without the space
    >below?
    >The space is not there when I just display the plot in R on my screen
    >(I use
    >R.2.3.1 on Windows XP). in general, how can I get the margins on
    >all
    >sides as small as possible since I wnat to include the eps into a
    >report and
    >do not need the space around.
    >>

    >The following code has the space on the eps:
    >>

    >library(lattice)
    >plot.vol <- wireframe(volcano, aspect = 1, scales=list(arrows=F)
    >,zlab=list("Z-axis",rot=90))
    >>
    >>

    >Perhaps you want something like
    >>

    >aspect = c(1, 1.5)
    >>

    >instead.
    >>

    >postscript("example_plot.eps", width = 14.0/2.54, height =
    >19.0/2.54,
    >horizontal = FALSE, onefile = FALSE,paper="special")
    >>

    >trellis.par.set("axis.line",list(alpha=1,col=1,lty=0,lwd=1))
    >>

    >print(plot.vol)
    >>

    >dev.off()
    >>
    >>

    >Secondly, is it possible to add to the wireplot a further z-axis. I
    >found only how to choose at which veritcal line I want the tickmarks
    >and label,
    >but is it also possible to have it at two vertical lines?
    >>
    >>

    >No (but it shouldn't be too hard to add that feature; I'll have to
    >check).
    >>

    >Deepayan
    >>

    >


    R-help (AT) stat (DOT) math.ethz.ch mailing list

    PLEASE do read the posting guide
    and provide commented, minimal, self-contained, reproducible code.
  • No.5 | | 5644 bytes | |

    9/13/06, Duncan Murdoch <murdoch (AT) stats (DOT) uwo.cawrote:
    9/13/2006 4:04 AM, Klaus Nordhausen wrote:
    Dear Deepayan,

    sorry for not being clear - but my problem has nothing to do with the aspect. If I create the eps the following way

    There is some ambiguity here. The "aspect" arg to wireframe controls
    the 3D aspect ratio. You want to control the 2D aspect ratio in the
    displayed plot. It is stored in the aspect.ratio member of the
    resulting object, and can be changed using

    plot.vol$aspect.ratio <- 1.5

    for example. You shouldn't really be fiddling around inside the object
    like that, but I don't know how to avoid it in this case.

    update(plot.vol, aspect = "fill")

    seems to work, but I don't know if that should be considered a bug or
    a feature.

    I wonder what S-PLUS does (I no longer have access to a copy).

    Deepayan

    Duncan Murdoch
    --
    library(lattice)
    plot.vol<- wireframe(volcano,
    aspect = c(1,1.5), scales=list(arrows=F),zlab=list("Z-axis",rot=90))

    postscript("example_plot_3.eps", width = 14.0/2.54, height = 19.0/2.54,
    horizontal = FALSE, onefile = FALSE,paper="special")
    trellis.par.set("axis.line",list(alpha=1,col=1,lty=1,lwd=1))
    print(plot.vol)
    dev.off()

    The plot is still not in the left bottom corner of the file. There is a lot of space below the outer box line. If I include this eps in latex it will also include this space and if I put for example the figure caption below it I have this huge gap between actual graph and caption.

    And for comparison, if I create with xyplot an eps like

    postscript("example_plot_4.eps", width = 14.0/2.54, height = 19.0/2.54,
    horizontal = FALSE, onefile = FALSE,paper="special")

    Depth <- equal.count(quakes$depth, number=8, overlap=.1)
    plot.depth<-xyplot(lat ~ long | Depth, data = quakes)
    update(trellis.last.object(),
    strip = strip.custom(strip.names = TRUE, strip.levels = TRUE),
    par.strip.text = list(cex = 0.75),
    aspect = "iso")

    print(plot.depth)
    dev.off()

    the figure is really in the left bottom corner and included in latex has not that gap between caption and actual figure.

    I hope this describes my problem better.

    Klaus
    >
    >
    >
    >9/12/06, Klaus Nordhausen <klausch (AT) gmx (DOT) dewrote:
    >Dear Deepayan,
    >>

    >thanks for your reply, the change of the aspect does however not solve
    >my problem with the space below the graph on the .eps
    >I attached the .eps (still with the old aspect) so that it is maybe
    >clearer what my
    >problem is.
    >>

    >No, it's not clearer; this is basically the same EPS that I got, so it
    >gives me no new information. What do you get with the new aspect? If
    >it's not what you want, you'll have to explain what you want more
    >clearly. Also, don't make the panel borders transparent, as it makes
    >it difficult to understand what's going on.
    >>

    >Deepayan
    >>

    >Any other suggestions?
    >>

    >Klaus
    >>
    >>

    >Dear R experts,
    >>

    >it would be very kind if you could help me with two wireplot
    >problems.
    >>

    >First, when I make a wireplot and transform it into an .eps using
    >the
    >postscript function the eps-file leaves always a lot of space below
    >the plot,
    >as if it would leave space for a legend or something like that.
    >How can i get the plot into the bottom corner without the space
    >below?
    >The space is not there when I just display the plot in R on my screen
    >(I use
    >R.2.3.1 on Windows XP). in general, how can I get the margins on
    >all
    >sides as small as possible since I wnat to include the eps into a
    >report and
    >do not need the space around.
    >>

    >The following code has the space on the eps:
    >>

    >library(lattice)
    >plot.vol <- wireframe(volcano, aspect = 1, scales=list(arrows=F)
    >,zlab=list("Z-axis",rot=90))
    >>
    >>

    >Perhaps you want something like
    >>

    >aspect = c(1, 1.5)
    >>

    >instead.
    >>

    >postscript("example_plot.eps", width = 14.0/2.54, height =
    >19.0/2.54,
    >horizontal = FALSE, onefile = FALSE,paper="special")
    >>

    >trellis.par.set("axis.line",list(alpha=1,col=1,lty=0,lwd=1))
    >>

    >print(plot.vol)
    >>

    >dev.off()
    >>
    >>

    >Secondly, is it possible to add to the wireplot a further z-axis. I
    >found only how to choose at which veritcal line I want the tickmarks
    >and label,
    >but is it also possible to have it at two vertical lines?
    >>
    >>

    >No (but it shouldn't be too hard to add that feature; I'll have to
    >check).
    >>

    >Deepayan
    >>

    >
    >
    >

Re: wireplot margins and additional z-axis


max 4000 letters.
Your nickname that display:
In order to stop the spam: 0 + 9 =
QUESTION ON "Development"

EMSDN.COM