Displaying 20 results from an estimated 30000 matches similar to: "Different results based on the order of arguments to par"
2016 Mar 15
2
[FORGED] Different results based on the order of arguments to par
Paul,
I was trying to make a minimal self contained example, but I guess I
went too far on the minimizing. The original problem came from code
more like:
library(TeachingDemos)
hist(rexp(1000), main='')
abline( v=1, col='red')
sp.par <- subplot(hist(rnorm(100), main=''), x='topright')
op <- par(sp.par[c('usr', 'plt')])
abline(v=0,
2016 Mar 15
0
[FORGED] Different results based on the order of arguments to par
Hi
The main issue here is that the 'graphics' package has no real concept
of going back to a previous plot (the 'grid' package has explicit
support for that sort of thing). In 'graphics' you can only go forwards
to the next plot; you can fake going back by creating a new plot that
is like a previous plot.
par(plt=, usr=) is not designed to return you to a previous
2016 Mar 15
0
[FORGED] Different results based on the order of arguments to par
Hi
I'm going to try to blame user error here.
par(usr) is used to reset the coordinates on the CURRENT plot.
par(plt) is used to specify the location of the NEXT plot.
The correct approach should be to set up the location for the next plot,
start a new plot, set up coordinates on the new plot.
Neither of your examples performs the "start a new plot" step.
I would expect to see
2008 Feb 22
1
Clipping using par(plt=..., xpd=FALSE) inconsistencies
Here is a demonstration of behaviour that is probably an optimization by
someone far smarter than me that did not anticipate anyone wanting to do
this, but for my purposes it looks more like a bug than a feature.
I have tested this with R2.6.2 on Windows, no additional packages loaded
(beyond the default), I have tested using the default graphics object,
pdf, jpeg, and cairoDevice (ok I loaded a
2007 Feb 26
3
PLotting R graphics/symbols without user x-y scaling
Is it possible to add lines or other
user defined graphics
to a plot in R that does not depend on
the user scale for the plot?
For example I have a plot
plot(x,y)
and I want to add some graphic that is
scaled in inches or cm but I do not want the
graphic to change when the x-y scales are
changed - like a thermometer, scale bar or
other symbol -
How does one do this?
I want to build my own
2017 Jul 26
2
axis() after image.plot() does not work except if points() is inserted between
Thanks... I agree that the problem was explained in the documentation
but I can't find a way to have axis() working even manipulating
par("plt") or with graphics.reset = TRUE:
- adding graphics.reset=TRUE does not allow axis() to be shown;
- I see that par()$plt is involved but it is the not sufficient to
explain why axis() works because if it is changed by hand, axes are not
2007 Jul 26
2
multiple graphs
Does anyone have a simple explanation and example on how to add histograms or barcharts to an other graph like in the example at the R-graph gallery:
http://addictedtor.free.fr/graphiques/RGraphGallery.php?graph=109
looking at the code I'not undertand very well how to add graphs in arbitrary/clever position with an adequate scale.
If somebody have a simplier example with explanations it
2008 Aug 08
2
gridBase and new.page() / grid.newpage()
Hello all,
I'm trying to write a function using the gridBase package. I'd like
to push several base subplots to a larger plot constructed with grid.
However, I'm having trouble getting consistent results when running
the function when the plotting window (quartz) is closed, when it is
left open and the plot function is repeated to the same window, and
when the output is saved to a
2010 Nov 23
2
overlay histograms on map at map coordinates
Hi all,
I'm trying to visualize animal movement data characteristics
spatiotemporally by overlaying many different histograms on a map. I
want the histograms to be plotted at coordinates in the map that
matches a region they describe. If I was just doing this once, I'd
fiddle in Illustrator after R and avoid the headache. But I'll be
doing it many many times so it seems
2003 Oct 13
1
Rotate a plot, and subplot
Hi all,
Is there a way to rotate a plot, e.g. a histogram, by a certain angle
(90/180/270 degress)? I spent hours trying to figure out how this is
done, but without success.
Also, I'm looking for an equivalent to the S-Plus "subplot" command to
insert a kind of "thumbnail" graphic into a bigger one. How is this best
done in R?
Thanks for your help
Pascal
2008 Mar 20
4
little subplot in corner
I want to draw a little subplot ("overview") into my detailed plot. It
should be placed in say the top right corner and have the size of some
legend (like legend(x="topright", inset=0.03, ...)
#main plot
plot(rnorm(100))
#give little density in corner
plot(seq(-2,2,length=300),dnorm(seq(-2,2,length=300)),type="l")
I don't want something like par(mfrow=c(1,2)) as
2009 Dec 02
4
Again on overlaying plots (a plot region within a plot region)
Dear R-users,
after seeking for help in R-search
I did not find any hint on my particular problem.
Countless help on "true" overlay, but nothing on this.
Please consider the following:
par(mfrow = c(2, 1))
T <- seq(0, 20, by = 0.01)
## PLOT 1
plot(T, 30*exp(-0.65*T),
type = "l"
)
points(T, 30*exp(-0.26 * T), type = "l", lty = "F8")
points(T,
2017 Jul 25
0
axis() after image.plot() does not work except if points() is inserted between
>>>>> Marc Girondot via R-help <r-help at r-project.org>
>>>>> on Mon, 24 Jul 2017 09:35:06 +0200 writes:
> Thanks for the proposition. As you see bellow, par("usr") is the same
> before and after the points() (the full code is bellow):
> ....
>> par("usr")
> [1] -0.2500000 1.2500000 -0.1666667
2007 Jan 14
4
Controlling size of boxplot when it is added in a plot
Greetings,
I am trying to add a boxplot to the bottom of a histogram, right
between the histogram bars and the x axis. Here is the code I am
using at the moment (the par line is probably not relevant for our
discussion):
hs <- hist(x, breaks = 20, plot = F)
par(mar = c(3,3,2,1))
hist(x, breaks = 20, main = NULL, ylim = c(-2, max(hs$counts)))
boxplot(x, horizontal = T, axes = T, add =
2011 Oct 05
2
subplot strange behavoir
Hello,
Below is some example code that should reproduce an error I'm encountering
while trying to create a tiff plot with two subplots. If I run just the
following bit of code through the R GUI the result is what I'd like to have
appear in the saved tiff image:
x<-seq(0:20)
y<-c(1,1,2,2,3,4,5,4,3,6,7,1,1,2,2,3,4,5,4,3,6)
plot(x,y,type="l",las=1,ylim=c(0,12))
2005 Jul 13
1
unexpected par('pin') behaviour
hi everybody,
I noticed the following: in one of my scripts 'layout' is used to
generate a (approx. square) grid of variable dimensions (depending on
no. of input files). if the no. of subplots (grid cells) becomes
moderately large (say > 9) I use a construct like
###layout grid computation and set up occurs here###
...
opar <- par(no.readonly = T);
2007 Nov 02
2
add histograms or distributions on regression line
hello, does anyone know how to add histograms or distributions
on regression like just like quantiles regression in RGraphGallery
below, a very
delicate codes. Thanks alot.
http://addictedtor.free.fr/graphiques/RGraphGallery.php?graph=109
2008 Apr 08
2
diagonally fill a rectangle with color gradient
Hi,
Is it possible to diagonally fill a rectangle with a color gradient? I
noticed that the gradient.rect of plotrix could fill a rect either up and
down or from side to side. I am looking for something similar but fills
diagonally instead, e.g., from the upper left corner to the bottom right.
Does anyone know how to do it in R?
Thanks,
--
Tom
[[alternative HTML version deleted]]
2007 Jun 19
2
axis labels in multiple plots
Hi,
I'am trying to make a multiple bar plot over a map and I'm having difficulties with the distance
between axes labels and the axis. Trying to control this with mgp does not help because it
controls both axes simultaneously. For example, with default values (mgp = c(3, 1, 0)) y-axis
labels are ok, but x-axis labels are not. Setting mgp = c(3, 0, 0) gives good x-axis labels but
the
2010 Jul 02
3
Combining several plots besides a dendrogram?
Hello all,
I would like to recreate the plot shown here (from a useR 2009
presentation):
http://www.agrocampus-ouest.fr/math/useR-2009/abstracts/pdf/Hocking.pdf
I downloaded the code for that image, and discovered that it relies on
external web services, and also having PERL installed on the computer.
I believe this could be done "locally" using the "seqLogo"