You're on the right track, I think.
Try this example:
plot(21:30, xaxt='n')
labs <- paste(1:10,'units',sep='\n')
axis(1, at=1:10, labels=labs, mgp=c(3, 1.75, 0) )
Documentation for the mgp option is found in
?par
and it's not something that I would expect someone new to R to find easily.
In m
Yes, the initial question is answered and the code works.
I suppose that I should not have added more to it.
I should have posted a new topic.
Sorry that I am not at all an R user.
Just trying to determine if I want to use it.
I just read your link.
Sorry to be more stupid than you expect.
I did no
On Apr 9, 2014, at 6:17 PM, Hurr wrote:
> What we've covered so far is of great value.
> For a neater plot,
> the next step will be to learn how to put
> numbers with units at each tick mark.
> I suppose I can form the number-unit string myself in
> separate code and put the tickmark in a place t
What we've covered so far is of great value.
For a neater plot,
the next step will be to learn how to put
numbers with units at each tick mark.
I suppose I can form the number-unit string myself in
separate code and put the tickmark in a place that
I calculate in separate code.
But I need to learn
On 04/09/2014 06:17 PM, Hurr wrote:
Thanks Jim, Labels for the following are at 0,2,4,6,8,10,12, not data, good.
and omitted where lack of room.
h=c(1.2,2.4,3.1,4.7,5.3,6.2,7.6,8.8,9.7)
v=c(9,8,7,6,5,4,3,2,1)
plot(h,v,xaxt='n',xlim=c(-1,13))
x<-c(1.6,2.6,6.6,9.6,12.9)
axis_labels<-1/pretty(x)
ax
Thanks Jim, Labels for the following are at 0,2,4,6,8,10,12, not data, good.
and omitted where lack of room.
h=c(1.2,2.4,3.1,4.7,5.3,6.2,7.6,8.8,9.7)
v=c(9,8,7,6,5,4,3,2,1)
plot(h,v,xaxt='n',xlim=c(-1,13))
x<-c(1.6,2.6,6.6,9.6,12.9)
axis_labels<-1/pretty(x)
axis(1,at=pretty(x),labels=axis_labels)
On 04/09/2014 01:12 PM, Hurr wrote:
This still puts tick marks at data points:
h=c(1,2,3,4,5,6,7,8,9)
v=c(9,8,7,6,5,4,3,2,1)
plot(h,v,xaxt='n')
x<-c(1.6,2.6,6.6,9.6,12.9)
axis_labels<-1/pretty(x)
axis(1,at=pretty(x),labels=axis_labels)
How do I get the axis to approx 13 ?
plot(x,xaxt="n",xlim
This still puts tick marks at data points:
h=c(1,2,3,4,5,6,7,8,9)
v=c(9,8,7,6,5,4,3,2,1)
plot(h,v,xaxt='n')
x<-c(1.6,2.6,6.6,9.6,12.9)
axis_labels<-1/pretty(x)
axis(1,at=pretty(x),labels=axis_labels)
How do I get the axis to approx 13 ?
--
View this message in context:
http://r.789695.n4.nabb
On 04/09/2014 02:06 AM, Hurr wrote:
Don suggested something like this:
h=c(1,2,3,4,5,6,7,8,9)
v=c(9,8,7,6,5,4,3,2,1)
plot(h,v,xaxt='n')
xat=pretty(h)
axis(1,at=xat,labels=1/xat)
But it puts the tick marks at the data-x-locations.
If the tick locations are not automatic or
automatically separate f
Don suggested something like this:
h=c(1,2,3,4,5,6,7,8,9)
v=c(9,8,7,6,5,4,3,2,1)
plot(h,v,xaxt='n')
xat=pretty(h)
axis(1,at=xat,labels=1/xat)
But it puts the tick marks at the data-x-locations.
If the tick locations are not automatic or
automatically separate from the data locations, then
I want to
If you want to customize tick mark labels, use the axis() function.
Something along the lines of
plot(x,y, xaxt='n')
xat <- pretty(x)
axis(1, at=xat, labels=1/xat)
-Don
--
Don MacQueen
Lawrence Livermore National Laboratory
7000 East Ave., L-627
Livermore, CA 94550
925-423-1062
On 3/31/1
On 04/01/2014 09:25 AM, Hurr wrote:
How can I label existing axis tick marks with a
simple function of axis value like 1/AxisValue?
It seems like this should be an operation where
I just use the formula.
Hi Hurr,
You can do this with boxed.labels (plotrix) if you know the position of
the axis
How can I label existing axis tick marks with a
simple function of axis value like 1/AxisValue?
It seems like this should be an operation where
I just use the formula.
--
View this message in context:
http://r.789695.n4.nabble.com/Label-axis-tick-marks-with-a-simple-function-of-axis-value-tp4
13 matches
Mail list logo