Displaying 20 results from an estimated 30000 matches similar to: "Use of axis() in conjunction with plot(..., axes=F)"
2009 Jun 15
3
Aligning axis values when plotting more than one graph on same axes
Dear R Users,
I am trying to plot a barchart with a line graph superimposed (using par(new=TRUE)). There are 12 bars and 12 corresponding points for the line graph. This is fine, except that I'm encountering two problems:
1) The position of the points (of the line graph) are not centred on the middle (horizontally) of each corresponding bar. In fact, whilst the first point is located on the
2008 Oct 02
1
combining bar and line plots with multiple axes
Hey list,
I have a barplot with a line plot overlayed (on the 2nd y axis) and it
looks fine except that the origin (0) on the 2nd y axis (side=4) is not
lining up with the origin on the 1st y-axis (side=2, from the barplot).
Is there a way to either shift the 2nd y-axis (line plot) down or
readjust the barplot axis?
Just as a reference, here is the code:
barplot2(temp$precip,
2012 Aug 01
2
How to increase lenght of axis according input data?
Hi,
I am working on barplot. I need to plot x-axis but scale on x axis is very
upto 15 while my data is upto 19.
pdf("image.pdf", width=10 , height =13)
par(mar=c(5,22.5,2,2))
barplot(t(data[,2:3]), beside=TRUE, col=c(rgb(.537, .769, .933),rgb(.059,
.412, .659)), width = 1, horiz=TRUE,cex.names=.9, border ="white",las=1,
cex.axis= 1, cex.lab=1.2)
2010 Feb 01
2
Adding line plot to a barplot
Hi,
I am trying to add a line plot of barplot, and while the following script
works:
barplot(DATA1,bty='c')
par(new=T)
plot(DATA2,type="l",axes=F,xlab="",ylab="",bty='c')
axis(4)
for some reason the y axis' do not align (the 0s are not in the same
position). Is this because I am trying to overlay plot on barplot, and is
there any way around
2008 Dec 17
4
Plot multiple lines, same plot, different axes?
Dear list,
I would like to plot 2 series of numbers with very different ranges/scales as lines on the same plot. I assumed this is commonly done and easy, but I have not found any help files (e.g. axis() or matplot() that show how. I've searched many old posts to no avail.
I'll be very grateful for any suggestions on how this is done.
Best,
Zack
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
2001 Jan 30
1
Disappearing x axis in plot.factor (PR#830)
Hi.
While there is an x-axis set up for:
> plot.factor(factor(1:3))
this axis is not present for
> plot.factor(factor(1:3), col="red")
which actually should just be the same as the first plot and call
barplot(table(.)), shouldn't it? Where did the ticks and labels go?
Note that
> barplot (table(factor(1:3)), col="red")
has the x-axis.
Something funky is going
2010 Jul 28
2
Axes=F and plotting dual y axes
Howdy. Been running into a bit of trouble with plotting. Seems that
axes=F is not "working". Whenever I plot (either a dataframe or xts/zoo
series) and I set axes=F along with xlab/ylab="" I still get the default
axes printed in my chart. Consider this:
#Create some sample data, both 50 units of blah
series2 = c(1:50)
series1 = rep(25:74)
testdf1 = as.data.frame(series1)
2008 Jun 20
5
Plotting barplot and scatterplot on same device - x-axis problem
Hi R-users
I'm a relative newbie and uses R mostly for graphical purpose. I have a
layout problem when plotting a scatterplot and a barplot using
par(new=TRUE). The baseline of the x-axis is not positioned equal for the
two plotting functions (see picture) and I have been unable to find out how
this is changed.
http://www.nabble.com/file/p18025066/pic.jpeg
I have added the script if this
2004 Dec 06
3
barplot() options for intervals on axes
Hello,
I am a beginner with R. I read many tutorials and the FAQ but I cannot solve
my problem.
I use barplot() to view my graph. I try to get more interval marks on y axis.
I wasn't able to find options in 'help(barplot)' or 'help(par)' to do this
with barplot().
I seek for another option to print y values on my bars like on the graph of
the R homepage:
2011 Apr 19
1
Axes Alignment Problem for Multiple Plots
Dear all,
I'm trying to plot, in the same window, two different series, using barplot() for the first one and plot() for the second. What happens is that the second chart has a different axes origin, therefore the final plot is wrong. This piece of code shows the differences between the values of par()$usr:
barplot(coredata(Z0), beside=TRUE, ylim=c(0,100));
par()$usr;
2011 Jan 18
2
Barplot and line x-axis positions
Hello all,
Hoping that there is a fairly simple solution to my query...
I'm trying to overlay a line plot of some data onto a barplot of different data. The y-axes are different for each set of data but the x-axes are the same (1:12, corresponding with 12 months of observations). The problem I'm having is that the centre of the bars and the points on line don't match up, which is
2004 Aug 30
1
axes=F with pairs()
If I want to fiddle with the axes, I normally plot things like this for
instance
plot(1:5,axes=F)
axis(2,labels=letters[1:5])
BUT, if I want to do remove the axes from a scatter plot matrix using i.e.
pairs(cbind(runif(10),runif(10)),axes=F)
I get
Error in plot.default(x[, j], x[, i], xlab = "", ylab = "", axes =
FALSE, :
formal argument "axes" matched by
2006 Dec 07
2
barplot - how to force vertical axis to cover entire plot area
I'm using barplot with the following call:
barplot(stat_data[[5]][,],axes=TRUE,axisnames=TRUE,axis.lty=1,xlab=xlab,ylab=ylab,beside=TRUE,las=1,font.lab=2,font.axis=1,legend.text=TRUE)
On some data, the vertical axis does not cover the
whole plot area and the last tick mark is smaller than
the maximum value.
I tried setting the ylim values but even with that,
some plots are still not OK,
2010 May 06
3
Supressing axes 3 and 4 when using plot()
Is there a way of doing this? I'm using plot() to produce a scatter of
my data, but it routinely defaults to plotting 2 sets of x axes and 2
y axes. I'd like to not plot the upper and rightmost axes. I can use
'axes=F', and then manually add axes with 'axis', but then the newly
created axes do not intercept.
TIA,
Dan
2009 Apr 01
1
FW: How to specify axis interval unit...
Dear Duncan Murdoch:
Thanks for your tips. By the way, I think I didn't mentioned my question
very clear. What I mean to say is that, in Excel one could decide upon the
axis interval unit. Please see the attached file. Likewise, is it possible
in R...?
Regards,
Prasanth.
-----Original Message-----
From: Duncan Murdoch [mailto:murdoch at stats.uwo.ca]
Sent: Tuesday, March 31, 2009 6:25 PM
2000 Aug 31
2
plot(x,y,axes=F) (PR#650)
Full_Name: Kenny Ye
Version: R-1.1.1
OS: Solaris 2.6
Submission from: (NULL) (129.49.6.133)
when i use plot(x,y,axes=F), the axes and the box are still ploted.
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the
2010 Mar 24
1
shading an area of a graphic
Colleagues
OS 10.5
R: 2.10.1
I have a simple x-y plot for which I would like to shade the lower (or upper) part of the interior region (i.e., the area bounded by the axes). If the delineation between top and bottom were linear, it would be use to use the polygon function. However, the delineation is a curve (which I can describe by an equation). In theory, I could divide the x-axis into a
2007 Jun 19
4
plot only x- and y-axis with origin, no box()
hi all,
I'm trying for quite some time to have an x- and y-axis, but no entire box.
>plot(..,axes=F)
>axis(1)
>axis(2)
Gives this, but their axes do not go to the origin.
Quite a number of people find this gap between the two axes disturbing.
Has anyone an idea how to let these axes go to the origin?
thank you in advance
[[alternative HTML version deleted]]
2012 Apr 10
1
Rotating margin text
R 2.14.1
OS X
Colleagues,
I am making a graphic with two y-axes. I create the label for the right-side axis with:
mtext(side=4, line=1, "Some text")
The label is rotated 90° counterclockwise. I would prefer that it be rotated 90° clockwise. However, srt is not supported for mtext and las does not offer this option. Is there some other means to rotate the text string?
Thanks in