Displaying 20 results from an estimated 8000 matches similar to: "add text to a plot, create character labels"
2009 Jul 09
2
X-axis labels not displayed when changing ylim
Dear R users,
I am encountering a x axis labeling problem on quite basic plots...
I use the following code which displays the labels on the x-axis with a
45 degrees angle:
p <- plot(myobject1, type="b", col="red",cex=1, lwd=2, axes=FALSE,
ann=FALSE, ylim=c(0,70))
title(main="title", font.main=4)
axis(side=1, lab=F)
text(axTicks(1), par("usr")[3] - 2,
2008 Mar 01
1
jpeg and margin text
Hi guys,
I use R 2.6.2 and Windows XP.
I’ve got the following question: I wrote a lot of text into the margin of a
plot. When I use the “jpeg”-function, only a little part of the margin text
is displayed in the final jpeg? Any ideas to change it?
Source-Code:
datenbankdaten<-data.frame(LETTERS[1:20],
2003 Aug 16
1
equivalent of Splus command axis(..., srt=45, adj=1) in R
Dear R-users
moving from Splus to R (under Windows), I notice that command "srt" within a
plot in the original Splus code is ignored by R.
For example, if a plot something and then include the line of code
axis(1, at=Time, labels=Text, srt=45, adj=1)
the srt=45 command within the axis() command fails to draw Text at 45
degrees on the x-axis in R but it works properly in Splus.
I will
2009 Dec 15
2
Diagonal Labels on "Beside" Bars in Barplot
My question is based on an example provided in the following:
Referencing:
Statistics with R
Vincent Zoonekynd
<zoonek at math.jussieu.fr>
6th January 2007
URL:
http://zoonek2.free.fr/UNIX/48_R/all.html
data(HairEyeColor)
a <- as.table( apply(HairEyeColor, c(1,2), sum) )
# Provided Example
barplot(a, beside = TRUE,
legend.text = attr(a, "dimnames")$Hair)
# I
2011 Apr 16
2
Rotating the x-axis labels of a barplot
Dear listserv,
Here is my latest formatting problem. I would like to rotate the x-axis labels
by 45 degrees on a _barplot_. Apparently this is slightly different from the
example given in the R FAQ, which is for rotating the x-axis labels on a
scatterplot
(http://cran.r-project.org/doc/FAQ/R-FAQ.html#How-can-I-create-rotated-axis-labels_003f).
I have adapted that code, as best I could, and
2009 Dec 01
1
Aligning Diagonally Oriented Labels Under Bar Chart
I searched the forms (i.e., R Search)?and come up with the following suggested link:
?http://cran.r-project.org/doc/FAQ/R-FAQ.html#How-can-I-create-rotated-axis-labels_003f
I tried to implement what I believe was being implied by that URL and came up with the below:
barplot(WorldPhones[1,],
??????? ylim=c(0, 50000),
??????? axes=FALSE, ann=FALSE,
???????
2006 Feb 21
2
rotated labels in barplot with beside=T and multiple groups
I have a data set that I display using barplot. I don't know what you
call it, but when I look at it, it looks like this:
> lsu
(0,0.1] (0.1,0.2] (0.2,0.3] (0.3,0.4] (0.4,0.5] (0.5,0.6]
A 0.052631579 0.000000000 0.000000000 0.000000000 0.000000000 0.000000000
B 0.000000000 0.000000000 0.001007049 0.003021148 0.000000000 0.000000000
E 0.200000000 0.000000000
2013 Apr 26
2
sample size in box plot labels
Hi,
I would like to put the sample number beside each lable in a boxplot.
How do I do this? Essentially, I need to count the sample size for each
factor, see below:
Thanks
boxplot(DATA$K_Merge~factor(DATA$UnitName_1),axes=FALSE,col=colours)
title(main=list("Tukey Boxplot by Geology:\n K(%)",cex=cexlb))
axis(1, 1:21, labels=FALSE, las=2)
text(seq(1, 21, by=1), par("usr")[3],
2006 Apr 27
1
losing x-label when exporting to PNG
I have a simple barplot that looks fine in the R
graphics device window. However when I export it to
png I am losing the x-label. It must be an obvious
problem but I cannot see it. Trying to resize the plot
does not seem to help. Code is below.
Any help gratefully received.
###### Start Code############
Groups <-c(21.8,45, 43, 17.2, 8.3, 18)
names(Groups) <- c("Exeter",
2010 Jul 08
1
download gplots and caTools
Dear list,
I am using R.2.11.1 version on a PC. I downloaded successfully gplots_2.8.0 but I could not find where to download caTools
> library("gplots")
Loading required package: caTools
Error: package 'caTools' could not be loaded
In addition: Warning message:
In library(pkg, character.only = TRUE, logical.return = TRUE, lib.loc = lib.loc) :
there is no package called
2012 Jul 16
4
Error in as.xts
Hi
I got the following error using as.xts
Error in xts(x, order.by = order.by, frequency = frequency, ...) :
NROW(x) must match length(order.by)
Here is how the data looks like
> d1 <- read.csv(file.path(dataDir,"AppendixA-FishCountsTable-2009.csv"),
as.is=T)
> d1[1:3,]
dive_id date time species count size site depth level
TRANSECT VIS_M
1 62 10/12/2009
2010 Oct 07
2
text/mtext axis labels on graphs
Hello everyone
I have problem with axis labels on graphs, I have my code as below:
plot(0,0,xlim=c(1,ncol(PA)),ylim=c(1,nrow(PA)),main="Stratigraphic
Range",xlab="Time
Bins",ylab="Taxa",cex.axis=1.5,cex.lab=2,cex.main=2.5,mgp=c(5,1.5,0),xaxt="n")
text(1:(length(strat_name)), y= 0, adj=1,
srt=45,labels=strat_name,xpd=TRUE, cex=1) #adds text to x
2006 Jun 09
1
Rotate values on Y axis
Hi,
I have been working through one of the examples on the FAQ about
rotating the labels on the x axis, I need to do the same but for the y
axis. I have managed to change some of the code, but I am still not
getting there, there is still something wrong. My syntax is as follows:
> par(mar = c(5, 7, 4, 2) + 0.1)
> plot(1 : 8, yaxt = "n", ylab = "")
> axis(2,
2012 Aug 03
5
replacement has length zero. In addition: Warning message: In max(i) : no non-missing arguments to max; returning -Inf
Hi,
Here is my data, the first 10 rows
> u=regCond_all[1:10,]
> dput(u)
structure(c(999, 999, 999, 999, 999, 999, 999, 999, 999, 999,
99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99,
99, 99, 99, 99, 1.9, 2, 1.97, 1.99, 1.83, 1.78, 1.6, 1.52, 1.52,
1.36, 10.53, 9.88, 9.88, 10.53, 10.53, 10.53, 5.26, 9.88, 10.53,
10.53, 5.4, 5.57, 5.46, 5.34, 5.5, 5.59, 5.62, 5.76, 6.23, 6.19,
2012 Mar 02
2
Spacing of text does not match spacing of bars in barplot
I have a very standard barplot. My labels are too long to be printed
horizontally under each bar, so I am using text to put the labels on a 45
degree slant.
However, the labels are spaced more narrowly than the bars, so on an 8
vertical bar plot, the end of the eighth label is lined up with the seventh
bar.
Preferably I don't want to do every text label separately (I'm having this
2011 Jun 16
1
lines(..., lwd=3) inaccuracy
Using a line width > 1 results in not only a thicker line but also some fuzz
in the other direction, as shown in this example program. You will see that
the thick vertical black lines extend below the gray scale horizontal lines.
Does anyone know whether this is intended or is it a bug? The application
is for displaying a correlation matrix (here just some random U(0,1)s).
Thanks -Frank
2012 Jul 20
2
convert date to a factor
Hello,
I would like to convert date as a factor to represent time in a repeated
measure situation in the following code. How would I do that?
> d <- read.csv(file.path(dataDir,"data.csv"), as.is=T,stringsAsFactors =
FALSE)
> d[1:2,]
id date a b c y
1 1 8/6/2008 Red 15 B 22
2 1 8/6/2008 Green 15 B
2011 Jul 26
1
adjusting x-axis labels
I am trying to tweak how my categorical x-axis labels are formatted in
my bar graph. Specifically, I would like to a) decrease the spacing
between lines (e.g. spacing between Dialium and guianensis) b) right
justify the text and c) have each species name align with the center
of the corresponding bar graph.
A simplified version of my code thus far is as follows. I am using
RStudio v.
2006 Oct 18
1
trying to rotate barplot labels
hi everyone : i'm trying to rotate the x axis labels in my barlot ( yes,
since yesterday ) and my prob12matrix is 2 rows and 16 columns and i
followed the instructions in the
archive "rotate barplot labels". i was really looking forward to seeing
my labels turned but the plot just came back with no labels ? can anyone
see what might be going on ?
it worked when i followed the
2009 Jan 28
2
help with plot layout
It takes a lot of sweat to generate a composite plot with R ... sigh.
I though I was almost done when I met the umpteenth hurdle. I cannot place a nice title on the 2nd plot (raw signal)
on the layout. I do not have control on where either the "main" option of "plot" function, or "title", place the text
string which keeps dysplaying chopped from above. I also tried