Displaying 20 results from an estimated 7000 matches similar to: "Spacing and margins in plot"
2005 Sep 01
1
Spacing and margins in lattice...
Similar to my last question, I want to tighten up the spacing and
margins in a plot I am doing with lattice.
Here are the commands I'm using:
data <- data.frame(x=c(1:3, 1:3), y=c(1:3, 1:3*2),
cat=c("foo","foo","foo","bar", "bar","bar"))
xyplot(panel=panel.superpose, y~x, data=data, groups=cat, type="b",
2005 Aug 09
1
Saving trellis output to files in scripts...
With much help from Chuck Cleland, I was able to get xyplot to
generate the plot I wanted. I'm trying to write a script (that can be
read using source("file")) to create the plots I want and save them to
files.
If I type the following lines into the R (in interactive mode), the
correct plot gets saved into the file myfile.ps with a size of 4,096
bytes:
----------------------------
2005 Sep 21
2
controlling usage of digits & scientific notation in R plots; postscript margins
Dear R users:
I assigned students to make some graphs and I'm having trouble answering
some questions that they have. We are all working on R 2.1 on Fedora
Core Linux 4 systems.
1. In the plot, the axis is not labeled by "numbers", but rather
scientific notation like "-2e+08" or such. We realize that means
-200,000,000. We want to beautify the plot. We would rather
2006 Jul 10
2
Setting the colors of lines in a trellis plot...
With some help from those with expertise on this list, I managed to
produce a plot using trellis that looked like I wanted it to look.
Now, I need to take the same plot and make the lines on it color, but
I want to specify the color for the lines myself.
I've managed to make the key use the colors I want. I've managed to
make the symbols of the actual plot use the colors I want. But I
2005 Aug 14
1
Labels on axes with log scales with lattice
I using lattice to make some plots and I want to make the y-axis on
some of these plots use a log scale. In the following plot:
x <- 1:10
y <- 2^x
xyplot(log10(y) ~ x)
I get tick marks on the y-axis at 0.5, 1.0, 1.5, 2.0, 2.5, and 3.0. I
would rather have just 3 tick marks at 1.0, 2.0, and 3.0 but labeled
10, 100, and 1000.
I know this can be done using the "at" and
2012 Nov 19
3
Plot Area Dimensions
Dear colleagues,
I wish to create a figure with 6 plots arranged vertically with no spacing
between them as they all have a common x-axis.
However, using the code below I'm unable to get the plot area the same size
for each plot.
The bottom plot with the x-axis label is smaller than the others, as is the
top plot which has larger margins.
How can I get the plot region the same size for
2005 Sep 15
5
Copying from graphics window in OS X
I'm running R from an Xterm window is OSX-Tiger. Graphical windows
appear as they should, but I'm having trouble copying from them--using
cmd+c or the Copy option in the Edit menu won't place the graph in the
clipboard (when I paste into a running OS X app, I get whatever was the
last copied thing from a non-x11 window). Any ideas on how to copy from
a xterm-launched graphical
2007 Dec 31
3
stack charts right on top of each other
Hi,
I tried to stack two charts on top of each other using the following
R functions:
par(mfrow=c(2,1))
plot(rnorm(1:3),xaxt="n",xlab="")
plot(rnorm(1:3))
This created two charts, one on top of the other, but there is too much
space between them. Does anyone know how to elimiate the space in between
the charts?
Thanks,
--
Tom
[[alternative HTML version deleted]]
2012 Sep 23
1
Background color in a grid plot seems to interfere with plot()
Hi,
Why does the upper left panel (in the plot below) not have a gray background?
Cheers,
Marius
require(grid)
require(gridBase)
pdf(file="Rplot.pdf", width=8, height=8, onefile=FALSE)
## set up the grid layout
gl <- grid.layout(5, 5, widths=unit(c(1.8, 8, 0.8, 8, 0.8), "cm"),
heights=unit(c(0.8, 8, 0.8, 8, 1.5), "cm"))
if(FALSE) grid.show.layout(gl)
2006 Mar 01
1
Width of bars in barplot2
I'm using barplot2 to plot some data. Is there any way to determine
the width of the bars in the generated plot? I know that barplot2
returns a list of the coordinates of the center of each bar, but since
there is some white space between each bar, I don't know how to get
the width of each bar.
Jamie
2006 Mar 03
1
R plots in PowerPoint
I have some plots that I generating using R (using trellis, plot, and
barplot2) that I want to include in a PowerPoint presentation I am
giving. My computer is running OS X. I find that presentations are
easier to read when there is light text on a dark background and would
like to generate plots that fit that style. The plots I am generating
are all grayscale. Is there an easy way to get R to
2006 Mar 08
1
Adding polygons to a barplot
I have a barplot I have created using barplot2 and I have been able to
add points and lines (using the points and lines methods,
respectively). I now need to add some polygons (triangles in
particular), that I want to be shaded to match bars in the plot. I
can get the coordinates of the corners of the triangles, but don't
know how to draw the triangles. I know there is the grid.polygon
2005 Aug 08
1
Help with doing overlays plots...
I have a data frame with three columns, type (a factor with two
values: "Monolithic" and "Compositional"), size (numeric), and states
(numeric). I want to create a plot where size goes on the x-axis and
states goes on the y-axis. In this plot, I want two lines, one where
the type is "Monolithic" and one where the type is "Compositional".
I think this can
2009 Jan 28
2
help with plot layout
It takes a lot of sweat to generate a composite plot with R ... sigh.
I though I was almost done when I met the umpteenth hurdle. I cannot place a nice title on the 2nd plot (raw signal)
on the layout. I do not have control on where either the "main" option of "plot" function, or "title", place the text
string which keeps dysplaying chopped from above. I also tried
2009 May 12
2
Multiple plot margins
Hello
I'm plotting 6 graphs using "mfrow = c(2, 3)". In these plots, only
graphs in the first column have titles for the y axis, and only the ones
in the last row have titles for the x axis.
I'd like all plots to be of the same size, and I'm trying to keep them
as near each other as possible, but I'm having the following problem.
If I make a single call to par(mar =
2006 Sep 11
3
wireplot margins and additional z-axis
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
2007 May 09
1
Error in plot.new() : figure margins too large
Yes, I already had a look on previous posts but nothing is really helpful to
me.
The code is:
postscript(filename, horizontal=FALSE, onefile=FALSE, paper="special",
bg="white", family="ComputerModern", pointsize=10);
par(mar=c(5, 4, 0, 0) + 0.1);
plot(x.nor, y.nor, xlim=c(3,6), ylim=c(20,90), pch=normal.mark);
gives error
Error in plot.new() : figure margins too
2005 Feb 21
4
49 histograms on one page
Hi,
I want to do something like this:
par(mfrow=c(7,7))
for (i in 1:49)
hist(RATDACOM[SUBJNO==i],breaks=0.5+(0:6),
main="",xlab="",ylab="",xaxt="n",yaxt="n")
(Don't think about what RATDACOM and SUBJNO are.)
I get an error
Error in plot.new() : Figure margins too large.
36 histograms with mfrow=c(6,6) work.
But the 36 histograms
2012 Jan 30
2
Help page of colors() : add a new example ?
Dear all,
May I suggest to add an example in the help page of the colors() function ?
The following code could be useful to easily choose any color from colors() :
## Millot G. (2011), p.71.
## Figure displaying all the 657 built-in color names of colors().
palette(colors())
tempo<-NULL
for(i in 14:1){tempo<-c(tempo, rep(i,50))}
windows(width=10) # replace by quartz(width=10) for MacOS and
2011 Mar 07
1
postscript cuts off left margin
I am using the following commands:
postscript(file="test.eps",paper="special",width=6,height=6,horizontal=FALSE)
# fake data
x <- c(12,13,14)
y <- c(41,42,43)
plot(x,y,type="n",xlab=expression(paste("log ",nu[peak],"
[Hz]",sep="")),ylab=expression(paste("log ",L[peak]," [",ergs,"