search for: yax

Displaying 20 results from an estimated 210 matches for "yax".

Did you mean: eax
2004 Mar 19
5
asp=1 and aspect ratio
...n is exactly square, and that the axis limits are identical. x <- 1:20 y <- x+rep(c(-1,1),10) lims <- range(c(x,y)) None of the following do this: plot(x,y) ; abline(0,1) #not square plot(x,y,asp=1);abline(0,1) #diagonal line misses corners plot(x,y,asp=1,xaxs="i",yaxs="i");abline(0,1) #diagonal line misses corners plot(x,y,xaxs="i",yaxs="i");abline(0,1) #not square and diag misses corners plot(x,y,xlim=lims,ylim=lims,xaxs="i",yaxs="i");abline(0,1) #not square plot(x,y,asp=1,xlim=lims,ylim=lims,xaxs="i&qu...
2007 Jun 26
4
boxplot and bxp do not respect xlim by default (PR#9754)
...prevents simple added plots (eg if add=T, with at=(1:n)+0.5, the last box is partly off the plot. The 'offending' code is in bxp: if (!add) { plot.new() if (horizontal) plot.window(ylim = c(0.5, n + 0.5), xlim = ylim, log = log, xaxs = pars$yaxs) else plot.window(xlim = c(0.5, n + 0.5), ylim = ylim, log = log, yaxs = pars$yaxs) } Suggested fix: if (!add) { plot.new() bxp.limits <- if(!is.null(at)) { c(at[1]-(at[2]-at[1])/2, at[n]+(at[n]-at[n-1])/2 ) } else {...
2006 Aug 08
1
parameter yaxs / function hist (graphics)
Dear R users, The parameters xaxs and yaxs (function par, package graphics) seem not to work with the function hist (package graphics), even when the parameters xlim and ylim are defined. Is there any way to make yaxs="i" and xaxs="i" work properly with the function hist, mainly to produce histograms that "touch&q...
2012 Jan 08
2
need help with axis ticks
...tance between the ticks and their values (y axis values).the part of the code that i am using (after reading in the data) to create the top row is: par(mfrow=c(6,6), oma=c(4,4,3,1), mar=par()$mar*0.25, family="serif",font=1) plot(flow1500,scf1500, type="p", xaxs="i", yaxs="i", xaxt = 'n',xlim = c(0,300), ylim=c(0,0.6)) plot(flow1500,ph1500, type="p", xaxs="i", yaxs="i", xaxt = 'n',xlim = c(0,300), ylim=c(0,10)) plot(flow1500,toc1500, type="p", xaxs="i", yaxs="i", xaxt = 'n'...
2007 Oct 24
1
Adding a second y axis and specifying yaxs="i"
Hello All, I have plotted a barplot and placed a line plot over top using par(new=TRUE). In the first plot I have specified that yaxs="i" and xaxs="i". However when I add a new axis to side 4 (right) and try to specify yaxs="i" it does nothing and the axis line begins above the x axis when I want the two points to meet. Can anyone tell me how to specify the secondary y axis to be in the "...
2008 Aug 21
2
barplot with anchored bars
Dear R list members, How to produce barplots anchored to the x-axis (not floating above the x-axis) with a box around? With both following codes, the lower horizontal line of the box is below the y = 0 line: # first code x <- c(1,2,3,4) barplot(x,yaxs='i') box() # second code x <- c(1,2,3,4) op <- par(yaxs='i') barplot(x) box() par(op) The parameter yaxs='i' does not seem to work with barplot. I use R version 2.7.1, running on Windows XP. Thank you very much. Paulo Barata -------------------------------------...
2003 Jan 16
1
graphics
...lts of some simulations I did using QTL Cartographer. I am plotting LOD scores over three chromosomes. The three plot have to be one next to the other. The procedure I am using is: par(mfrow=c(1,3)) plot(x$x, x$y, ylim=c(0,35), type="l", col="blue", las=1, xaxs="i", yaxs="i", xlab="X Chromosome", ylab="LOD") abline(h=3.055) plot(ch2$x, ch2$y, ylim=c(0,35), type="l", col="blue", yaxt="n", xaxs="i", yaxs="i", xlab="Chromosome 2", ylab="") abline(h=3.055) plot(ch3$x,...
2010 Feb 19
1
color graph in multiple plots
...lots using colors but I got error message.  How do I correct that?     plot(ecdf(z), main ="CDF for observed and simulated weighted sum",type="l",lwd=2,col="blue", xlab="Weighted sum (mm)", ylab="Cumulative Percent", xlim=c(0,15), xaxs ='i', yaxs ='i',ylim=c(0,1)) par(new=TRUE) plot(gen[,1],gen[,2],type="l",lwd=2,ann=FALSE,axes=FALSE, col="red",xlim=c(0,15),ylim=c(0,1),xaxs ='i', yaxs ='i') legend(10,.2,c("obs","pre"),col=c("blue","red"),lwd=c(1,2)) > p...
2011 Feb 16
3
image() with a vector
Hi, I have a vectors x and z, for example, x <- 0:20 z <- round(runif(20,1,7)) y <- 0.5 and I want to display z as an image. However if I then call image() with a vector image(x,y,t(z),zlim=c(1,7),col=heat.colors(7),xlab="Year",ylab="Action",yaxt="n",xaxs="r",yaxs="r") then I get the error Error in image.default(x, y, t(z), zlim = c(1, 7), col = heat.colors(7), : dimensions of z are not length(x)(-1) times length(y)(-1) However, transforming z into a matrix with two rows, where both rows are the same as...
2006 Mar 13
1
Newbie error or bug?
...2*pi*(time)) alias = -sin(aliasfreqin1msec*2*pi*(time)) undersamplinginterval = max(time)/8 seq (0, max(time), by=undersamplinginterval) -> undersamplingtimes undersampled = sin(freqin1msec*2*pi*undersamplingtimes) plot(time,signal,type="l", col="blue", xaxs="r", yaxs="r", xlab="Time (msec)", ylab="Signal", main="Aliasing", sub="Sampling 5KHz source (blue) at 8KHz (dots) gives 2.5KHz alias(red)") par(new=TRUE) plot (time, alias, xaxs="r", yaxs="r", type="l", lty=2, col="red&qu...
2009 Jan 05
1
adding a curve with xaxs="i"
...axis like the curve touches the upper boundary. How can I eliminate the margin between axis and curve on the left side? x1 <- c(1,2,3,4,5) x2 <- c(2,4,6,8,10) mod <- lm (x2~x1) hm <- function (x) (mod$coe[1]+x*mod$coe[2]) plot.new() # ... box() curve (hm,lty=1,add=T,xaxs="i",yaxs="i") (R 2.8.1) -- Sensationsangebot verl?ngert: GMX FreeDSL - Telefonanschluss + DSL f?r nur 16,37 Euro/mtl.!* http://dsl.gmx.de/?ac=OM.AD.PD003K1308T4569a
2002 Oct 14
2
barplot + plot
Dear all, I've got another question, By default barplot and plot seem to produce slightly different y-axis. The problem I've got is when using a mix figure with both, barplot and plot. For example: barplot(1:5, ylim=c(0, 6)) par(new= T) plot(1:5, 9:5, type="b", axes=FALSE, ylim=c(0,9)) axis(4) box() note that both plots (barplot and plot) should start at 0, but the exact
2002 Dec 05
2
Two different yaxes with lattice plots
In "normal" plots, I can do an axis at side = 2 and a different one at side = 4. I've not been able to figure out how to do the same thing with lattice plots. The scales list can have only one sublist named y. I had thought of using a separate viewport alongside with the text for the axis label, but I can't see how I could get the ticks to work. Ideas appreciated. Thanks.
2010 Sep 22
2
plot.ts versus plot.zoo
plot.ts has an argument yax.flip, plot.zoo does not. Is there a way to make the yaxis flip in plot.zoo? I tried using a custom panel function: panel.yaxis<-function(...) { npnl<-parent.frame$panel.number if (npnl %% 2 == 0) { axis(side=3) } else { axis(side=2) } } This leads to...
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") What variable / line of code corresponds to this additional margin space? I would like to modify the code to remove the extra space and have that margin equal to t...
2010 Nov 22
1
plot start at origin
Hi r-users, I would like my axes to intersect at (0,0).  I tried  xaxs="i",yaxs="i" but it does not change anything.  I hope anybody can help me with this problem.  Here is my code. hist(datobs, prob=TRUE, main ="PDF of the sum of two stations",col="yellowgreen", cex.axis=1.2, xlab="Rainfall (mm)", ylab="Relative frequency&quot...
2010 Nov 25
1
overlap cdf plots and add colors and etc
Hi r-users, I would like to overlap 2 ecdf plots.  I tried this below and it gives me two plots of ecdf but just both just in black. par(mar=c(4,4,2,1.2),oma=c(0,0,0,0),xaxs="i", yaxs="i") plot(ecdf(datobs)) lines(ecdf(gam_sum_gen)) Then I try to add colors etc and also the legend but fail. par(mar=c(4,4,2,1.2),oma=c(0,0,0,0),xaxs="i", yaxs="i") plot(ecdf(datobs),main ="CDF of the sum for winter season-Hume",cex.axis=1.2,xlab="Rai...
2011 Dec 31
2
How to color a region in a contour plot with the contour being the boundary?
...rmine colors zcols <- c(gray(0.2), gray(seq(0.5, 1, length.out=50)), rep("#FFFFFF", max(z)-51)) # colors with dark gray in the beginning for z <= 0.02 and many whites for z > 50 ## trial 1 pdf(file="levelplot1.pdf", width=6, height=6) image(x, y, z, xaxs="r", yaxs="r", col=zcols) contour(x, y, z, levels=c(0.02, 1, 5, 10, 20, 50, 500), add=TRUE) dev.off() ## trial 2 pdf(file="levelplot2.pdf", width=6, height=6) image(x, y, z, xaxs="r", yaxs="r", col=zcols, oldstyle=TRUE) contour(x, y, z, levels=c(0.02, 1, 5, 10, 20, 5...
2006 Dec 27
4
axis and times() problem
...example here .... # working library(chron) # for times() library(graphics)# for axis par(cex=1.2,lwd=1) x <- c(times("12:15:00"),times("15:30:00")) y <- c(1,5) plot(x, y, type="n",adj=0, asp=0, xlab="", ylab="",font.axis=2,yaxt='n') # axis() command problem: par(cex=1.2,lwd=1) x <- c(times("12:15:00"),times("15:30:00")) y <- c(1,5) plot(x, y,axes=FALSE, type="n",adj=0, asp=0, xlab="", ylab="",font.axis=2,yaxt='n') axis(1) Maybe an...
2006 Dec 27
4
axis and times() problem
...example here .... # working library(chron) # for times() library(graphics)# for axis par(cex=1.2,lwd=1) x <- c(times("12:15:00"),times("15:30:00")) y <- c(1,5) plot(x, y, type="n",adj=0, asp=0, xlab="", ylab="",font.axis=2,yaxt='n') # axis() command problem: par(cex=1.2,lwd=1) x <- c(times("12:15:00"),times("15:30:00")) y <- c(1,5) plot(x, y,axes=FALSE, type="n",adj=0, asp=0, xlab="", ylab="",font.axis=2,yaxt='n') axis(1) Maybe an...