Displaying 20 results from an estimated 7000 matches similar to: "Removing tick marks and Adding labels to lattice plots"
2010 Dec 26
1
lattice splom: how to adjust space between tick marks and tick labels?
Dear expeRts,
how can I decrease the space between the tick marks and the corresponding labels in an splom?
See here:
library(lattice)
U <- matrix(runif(4000), ncol = 8)
splom(U, axis.text.cex = 0.2) # => space between the [small] tick labels and tick marks is/seems to be too large
I checked ?panel.pairs but could not find an option for that.
Cheers,
Marius
2011 Aug 24
3
Creating new variable with maximum visit date by group_id
Dear R users,
I am encoutering the following problem: I have a dataset with a 'unique_id' and different 'visit_date' (formatted as.Date, "%d/%m/%Y") per unique_id. I would like to create a new variable with the most recent date of visit per unique_id as shown below.
unique_id visit_date last_visit_date
1 01/06/2010 01/06/2011
1 01/01/2011 01/06/2011
1
2011 Jan 13
3
Rotated, Right-Justified Labels for Shortened Tick Marks
Hello R-help,
I'm trying to make a fairly simple plot axis that goes something like
this:
plot(-10:10,-10:10, yaxt='n')
axis(side=2, las=1, hadj=1, tck=-.01, cex.axis=.6)
...but as you can see, the labels are not close enough to the y-axis
(where I want them... to save space for publication).
Can anybody help me figure out how to move these labels over the the
right a bit?
2009 Jan 19
3
Month tick marks on a plot()
Hi All,
I have a small dataframe [dates, values) I am plotting with
plot(df,type=²l²)
And the date date covers a year. The graph only have marks at Œ2008¹ and
Œ2009¹.
How do I get the months labeled at the bottom please
Thanks as always
Glenn
[[alternative HTML version deleted]]
2006 Oct 31
1
[ggplot] controlling axis and major/minor tick marks
Hello there!
I'm starting with ggplot and was wondering how I could control the axis
of a plot. I would like the axis of the plot to be drawn black which I
thought to acheive with the option axis.colour="black". However, this
had no real effect on the plot. Then I found grid.colour which I changed
to black as well. Now I got my axis as I wanted them, but ggplot now
draws the grid
2003 Oct 06
3
tick marks: 0, 12, 24, 36 ...
Dear R-help list,
I have a problem with the tick marks of a Kaplan-Meier survival plot.
Here is a sample:
follow.up<-c(10,20,30,40,50,60,70,80,90,100) #months
dead<-c(1,1,1,0,1,1,0,0,0,0)
KM <-survfit(Surv(follow.up, dead))
plot(KM)
The result is a nice plot. However, our research group thinks it may be
a better idea to place the ticks to the years on the time scale, i.e. 0,
12, 24, 36
2004 Sep 17
1
thickness of tick marks
Hi,
I am unable to get the tick marks to appear thicker in plot. I have
tried things like
par(lw=2) but this only seems to affect other line thicknesses.
The use of axes directly fixes the problem because lw = 2 applies to
both the axis and the ticks.
Is there is way of feeding a single parameter to plot or setting a par
parameter to do this?
I am using R 1.9.0 on a windows 2000 platform.
2010 Jun 09
1
minor tick marks
Hi !
I need a plot for data extending over several orders of magnitude on the y axis.
The following command generates a nice looking semi-log plot for my data:
plot(x,y,log="y",type="l",lty=3, ylim=c(0.01,2),yaxp=c(0.01,1,1),las=1)
I would appreciate having also minor tick marks in-between the 3 major ticks obtained with the above command. The "minor.tick" function
2000 Oct 26
3
Tick marks for abline
Dear R People:
I am drawing graphs for a College Algebra class. I would like to have
the x and y axes, along with the lines that I am plotting. So I leave
off the axes, and use xlim and ylim. Then I add my abline(v=0).
However, I would like to have tick marks on the abline. How would I do
that, please?
Thanks in advance!
Sincerely,
Erin M. Hodgess, Ph.D.
Associate Professor
Department of
2011 Apr 23
3
Problem having tick marks aligned when plotting three graphs on top of one another.
R 2.10
Windows 7
I am trying to plot three graphs on top of each other. I need to have the axises perfectly aligned. For some reason the ticks on the y axes are slightly off so they do not perfectly align. Can someone tell me how I can get the to overlay each other perfectly? I thought the yaxp parameter would solve my problem, but it does not. My data and code follows:
>
2010 Dec 24
4
Removing rows with earlier dates
Hi all,
I'm new to the list but have benfited from it quite extensively. Straight to
my rather strange question:
I have a data frame that contains mapping rules in this way:
ACCOUNT, RULE COLUMNS, Effective Date
The dataframe comes from a database that stores all dates. What I would like
to do is to create a data frame with only the most recent rule for each
account. In traditional
2007 Nov 30
2
Organising tick-marks in plot()
Hi Folks,
I'm advising someone who's a beginner with R,
and therefore wants the simplest answer possible.
The issue is to produce a plot using
plot(x,y,...)
where, on the X-axis, the tick-marks should be
on the lines of:
-- Range of X-axis: 0:1000
-- tick-marks labelled "0","200",...,"800","1000"
-- unlabelled tick-marks every 50 from 0 to
2008 Jun 16
2
in axis() suppressing axis line but keeping tick marks
I've been trying to figure out a parameter that will let you separately
adjust the parameters for the axis line from the tick mark.
In the following example, I would like to suppress the axis line, but keep
the tick marks.
Thanks,
Andrew
foo <- data.frame(x=1:3, y=4:6)
plot(foo$x, foo$y, type="n", axes=F)
points(foo$x, foo$y)
axis(side=1, at=foo$x, lty=0) #would like to figure
2009 Jun 01
1
Minor tick marks for date/time ggplot2 (this is better, but not exactly what I want)
library(ggplot2)
melt.updn <- (structure(list(date = structure(c(11808, 11869, 11961, 11992,
12084, 12173, 12265, 12418, 12600, 12631, 12753, 12996, 13057,
13149, 11808, 11869, 11961, 11992, 12084, 12173, 12265, 12418,
12600, 12631, 12753, 12996, 13057, 13149), class = "Date"), site =
structure(c(1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L,
2L, 2L, 2L, 2L, 2L,
2011 Jul 09
1
Suppressing the labelling of tick marks on ggplot2
Hi,
I have the follow ggplot2 code I am running:
ggplot(data=bb.res.math,aes(x=factor(id.bb),y=bb.math.comb,fill=BB)) + geom_bar() + facet_grid(BB~.) + scale_fill_brewer(pal="Set1") + ylab("Average Student Residual (Math)") + xlab("Student ID")
The number of unique id.bb is 2207 and so my X-axis has a couple of thousands, indistinguishable tick marks that correspond
2011 May 16
2
conditional rowsums in sapply
Hi all
I have a data frame with duplicate columns and i want to remove duplicates
by adding rows in each group of duplicates, but have lots of NA's.
Data:
dfrm <- data.frame(a = 1:4, b= 1:4, cc= 1:4, dd=1:10, ee=1:4)
names(dfrm) <- c("a", "a", "b", "b", "b")
dfrm[3,2:3]<-NA
dfrm
a a b b b
1 1 1 1 1 1
2 2 2 2 2 2
3
2007 Jan 10
0
axis labels at subset of tick marks
For example, this works:
x = seq(-100, 1000, 25)
y = x * x
plot(x,y, xaxt="n")
axis(1,x,FALSE,tcl=-0.3)
axis(1,x[x %% 100 ==0])
It creates two axis objects and the values of the x-axis are the
labels. The following scenario is more difficult, because it uses
'image' to plot a grid of values:
a = matrix(rnorm(100),ncol=10)
image(1:ncol(a), 1:nrow(a), a, xaxt="n",
2009 Mar 20
1
minor tick marks for plots (PR#13616)
Hello,
I think I found a bug:
> windows(1,width = 10, height = 10, pointsize = 5,xpos = 0, ypos = 0 )
> hdata[1:3,1] <- c(1,10,15)
> hdata[1:3,2] <- c(2,1,4)
> plot(hdata[,1],hdata[,2],xaxt="n")
> axis(1,at=c(2,10,14))
> minor.tick(nx=2, ny=1,tick.ratio=1)
the minor tick marks appear between the tick marks which would have been
drawn without the option
2011 Jan 31
2
From data frame to list object
Dear all, let say I have following data frame:
> data.frame(x=rnorm(18), y=rep(c("a", "b", "c"), each=6))
x y
1 -1.072152537 a
2 0.382985265 a
3 0.058877377 a
4 -0.006911939 a
5 -2.355269051 a
6 -0.303095553 a
7 0.484038422 b
8 0.733928931 b
9 -1.136014346 b
10 0.503552090 b
11 1.708609658 b
12 -0.294599403 b
13
2003 Sep 09
1
Changing Tick Marks for Date Plots
I have been experimenting with various approaches to
plotting (irregular) time-series with reasonable
success. One thing I have been able to do is change
the number of tick marks on the axis. Consider the
following simple example:
> x <- as.data.frame(matrix(ncol=2,nrow=500))
> names(x) <- c("dates","values")
> x$dates <- as.POSIXct(Sys.time()+1:500*86400)