Displaying 20 results from an estimated 10000 matches similar to: "Shrink Trellis margins settings (when printed to png file)"
2008 Dec 12
0
Trellis margins settings so that they are like a base graphic with no figure region when printed to png file?
Dear R-experts,
I want to produce a very small png file (35 x 18 px) that contains a
histogram without a figure region or margins, only the pure heights. 
In the base graphic this was easy:
  png(filename = "hist.png", res = 72, width=35, height=18)
        par(mar=c(0,0,0,0), oma=c(0,0,0,0))
        hist(rnorm(100), main="")
  dev.off()
Now I want a grid graphics output as
2012 Mar 08
3
"figure margins too large" in RGtk2 drawing area as cairo device - why?
When using a gtkDrawingArea as a Cairo device I very often encounter the error: "figure margins too large" 
Even for the below "getting started" example from http://www.ggobi.org/rgtk2/ this is the case.
> win = gtkWindow()
> da = gtkDrawingArea()
> win$add(da)
> asCairoDevice(da)
[1] TRUE
> plot(1:10)   
Fehler in plot.new() : Grafikr?nder zu gro?
> 
Also
2012 Jul 12
2
trellis margin sizes in absolute units
Dear R users,
I have a lot of experience with traditional R graphics, but I decided to turn to trellis as
it was recommended for spatial graphs by the sp package. In traditional R graphics
I always first set the size of the device region absolute units (e.g.  mm) and then I
firmly fix the inner margins with mai and the outer margins with oma also in absolute units.
What is left from the device
2012 Mar 05
2
changing the drawing context using Cairo and RGtk2
I am not too familiar with Cairo and RGtk2 and have the following problem:
I have a container with two GTK drawing areas converted into Cairo devices. 
I know that I can set the current drawing context e.g. using dev.set().
But this is tedious. How can I set the context using the objects da1 or da2?
 w <- gtkWindow()
 w$setSizeRequest(400, 400)
 vbox <- gtkVBox()
 da1 <- gtkDrawingArea()
2010 Nov 15
1
plot.dendrogram() plot margins
Hello,
Is it possible to remove those extra margins on the "sample" axis from
plot.dendrogram:
par(oma=c(0,0,0,0),mar=c(0,0,0,0))
ddr<-as.dendrogram(hclust(dist(matrix(sample(1:1000,200),nrow=100))))
stats:::plot.dendrogram(ddr,horiz=F,axes=F,yaxs="i",leaflab="none")
vs.
stats:::plot.dendrogram(ddr,horiz=T,axes=F,yaxs="i",leaflab="none")
2010 Feb 12
2
Multiple figures margin problem
Hello All, 
I am trying to make a figure with 3x2 plots in it. Let us name the plots as
such: 
1 2 
3 4 
5 6 
I begin my script with: 
par(mfcol=c(3,2)) 
par(oma=c(0,0,0,0)) --> This is for a postscript figure so I really don't
need the outer margins. 
d=5 
par(mar=c(d,d,d,d))  --> This applies to all the 6 plots. 
Now if d=0, plots 1-2,3-4 and 5-6 will have no gap between them and
2008 Oct 06
1
Margin on trellis plot
Dear all
I have a problem when I make a trellis plot - I would like to reduce the white margin surrounding the plot.
I used S some years age, as I remember it was possible to use the "par" and "oma" to control margin size even on a trelllis plot (see the plot below).
However, it does not seem to work in R.
All suggestions will be highly appreciated.
Br Henrik
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 =
2005 Nov 11
1
Lattice (Trellis) plot margins
Is there an equivalent way to set plotting parameters
as in
par(mai=c(......))
in the Lattice package? I searched trellis.par.get(), but am not
sure which one can be used.
Paul E. Green
	[[alternative HTML version deleted]]
2006 Aug 18
3
Lattice package par.settings/trellis.par.settings questions
Hi All,
I'm trying to modify some of the default graphic parameters in a 
conditional histogram. While I was able to change the default grey 
background to white, I couldn't change the axis.font or the xlab font.
I used the following code:
/histogram(~V751|V013+V025, finalbase, xlab="Heard of HIV/AIDS 
(No/Yes)", col=c("cyan","magenta"),
2010 May 14
2
help color coding map in R
I am trying to create a map with selected states based on highest to lowest mean cost. The following code properly selects the correct states, and the legend is properly color coded with ranges, but the colors per range does not match the state colors. I need help getting the state colors to match the ranges outlined in the legend. I have tried ordering the mean amounts and this correctly creates
2006 Jul 21
2
png() and image()
Hi,
I try to create PNG images of a certain size where each pixel
intensity corresponds to exactly one probe signal in an Affymetrix
array.  I try to use png() and image() with zero margins to do this.
Example:
z <- matrix(1:15, nrow=45, ncol=30)
png("large.png", height=nrow(z), width=ncol(z), bg="red")
par(mar=c(0,0,0,0))
image(z, col=gray.colors(16), axes=FALSE)
2011 Dec 22
1
RGtk2: How to overlay a gtkDrawingArea with a button or any other widget?
I try to overlay a plot inside a gtkDrawingArea with a button (or any other widget).
I tried to put both into a gtkFixed container.
But this does not work, no printing occurs.
Does someone know a solution?
What I tried:
w <- gtkWindow()
w$setSizeRequest(400,400)
fx <- gtkFixed()
da <- gtkDrawingArea()  
fx$put(da, 100, 100) 
asCairoDevice(da)  
par(mar=c(0,0,0,0))
plot(1:10)  
btn.1
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
2010 Nov 11
3
overlap histogram and density
Hi,
Does anybody encounter the same problem when we overlap histogram and density 
    that the density line seem to shift to the right a little bit?
     
    If you do have the same problem, what should we do to correct that?
     
    Thank you.
     
    par(mar=c(4,4,2,1.2),oma=c(0,0,0,0))
    hist(datobs,prob=TRUE, main ="Volume of a catchment from four 
   
2005 Mar 09
4
Lattice device page options-margins
I am using lattice to make figures as pdfs:
trellis.device(device = "pdf",file = "Figure6.pdf",color = FALSE)
I need to specify some blank space on the left-hand margins (the pages
will be bound so we need about 0.5 inch)). I have tried a number of
solutions but none seems to work (e.g. par.set). Can this be done when
initiating the plotting device? Or is the some other way
2012 Mar 02
1
acf() plot of matrix cuts y-axis labels
Hello all,
I found a funny problem with y-axis labels when plotting acf(matrix) -
the labels are too close to one of the margins and cut in half.
Here's the problem:
test<-matrix(rnorm(200),ncol=4)
acf(test)
This doesn't fix the problem:
test<-matrix(rnorm(200),ncol=4)
par(mar=c(3,3,2,0.2),oma=c(0,0,0,0))
acf(test)
This does fix the margin. I understand why, but not sure why ONLY
2009 Apr 07
2
change default output size when using Sweave
I am trying to create a graphic output in Sweave but I do not want it to be
standard size. I want the whole graphic to be 80mm of height only, just like
the viewport below.
<<fig=TRUE, echo=TRUE>>=
   pushViewport(viewport(height = unit(80, "mm")))    
   grid.rect()
   grid.text("I want this viewport to be the whole output size")
   popViewport()
@
How can I make
2004 Oct 01
3
controlling colour in Trellis histogram
Hello.  I am sorry for posting a (seemingly) simple question, but I have
just spent 2 hours trying to find the answer, without success.  I want
to make a histogram with conditioning on a factor, using Trellis
graphics.  However, I do not want any colours (only black and white)
either in the histograms or in the strip.  There must be some simple
argument but I can’t find it.  Here is my code so
2010 Sep 29
1
graph margins
Hello All,
I am drawing a graph having 18 small graphs inside using par(mfrow = c(6,3))
command. My problem is how to specify the margins of the whole 18 graphs. I
used par(mar=c(6.5, 6.5, 1.5, 1.5)) for each graph separately already but it
does not left any margins for the 'mtext()' for the margins of the whole 18
graphs. Any comments please.
Thanks,
MJK
	[[alternative HTML version