Displaying 20 results from an estimated 20000 matches similar to: "add data symbol to axis label"
2007 Mar 22
1
Labelling a second y-axis
Hi,
I am using the following code as an example function to create
multiple y-axes on one plot. I have it working fine however, I can't
seem to add a label on the second (right) axis. I have tried adding
ylab="y2" in the axis call but, that didn't work; any ideas?
Thanks,
Jesse
Code:
function() {
par(las=1,xaxs="r",mai=c(1,0.75,1,1))
x<-1:10
y1<-x
2010 Aug 30
3
Putting legend *outside* plotting area
Is there a simple way to put a legend outside the plot area for a simple
plot?
I found... (at http://www.harding.edu/fmccown/R/)
# Expand right side of clipping rect to make room for the legend
*par(xpd=T, mar=par()$mar+c(0,0,0,4))*
# Graph autos (transposing the matrix) using heat colors,
# put 10% of the space between each bar, and make labels
# smaller with horizontal y-axis labels
How to plot 2 continous variables on double y-axis with 2 factors: ggplot2, gplot, lattice, sciplot?
2013 Feb 25
3
How to plot 2 continous variables on double y-axis with 2 factors: ggplot2, gplot, lattice, sciplot?
Hi,
I have a data set with two continous variables that I want to plot MEANS (I
am not intrerested in median values) on a double-y graph. I also have 2
factors. I want the factor combinations plotted in different panes.
Dummy dataset:
mydata <- data.frame(factor1 = factor(rep(LETTERS[1:3], each = 40)),
factor2 = factor(rep(c(1:4), each = 10)),
y1 =
2006 May 24
3
Regression line limited by the rage of values
Hi
In R, using plot(x,y) followed by abline(lm(y~x)) produces a graph
with a regression line spanning the whole plot . This means that the
line extends beyond the swarm of data points to the defined of default
plot region. With par(xpd=T) it will span the entire figure region. But
how can I limit a regression line to the data range, i.e between
(xmin,ymin) and (xmax,ymax)?
Sorry for
2008 Feb 22
1
Clipping using par(plt=..., xpd=FALSE) inconsistencies
Here is a demonstration of behaviour that is probably an optimization by
someone far smarter than me that did not anticipate anyone wanting to do
this, but for my purposes it looks more like a bug than a feature.
I have tested this with R2.6.2 on Windows, no additional packages loaded
(beyond the default), I have tested using the default graphics object,
pdf, jpeg, and cairoDevice (ok I loaded a
2013 Jul 01
1
Male and female signs as subscript in plot
Hello,
I'd like to add labels to my plot that include a male or female symbol as
subscript.
I'm working in Windows Vista and R 3.0.0.
I am able to add the male symbol to the plot as regular text (NOT as
subscript), e.g. with:
mtext("Male\u2642")
This displays the word "Male" followed by the male symbol on the plot.
But "\u2642" does not work when I try to
2010 Aug 15
2
legend outside plot area
Hi, please can you help me. When I add a legend to a boxplot it appears inside the plot area, how do you get it into the margins? I have already changed the parameters so there is space for it on the margin on the right hand side of the graph.
Thanks, Emily
[[alternative HTML version deleted]]
2013 Mar 26
6
How do I show real values on a log10 histogram
Hi,
I have a histogram with values logged to the base 10
hist(log10(x),breaks=60)
How do I show the log values on the x-axis and a second x-axis showing the
real values?
Thanks
--
Shane
[[alternative HTML version deleted]]
2005 May 27
3
Soil texture triangle in R?
Dear R users,
has anybody made an attempt to create the soil texture triangle graph in
R? For an example see here:
http://www.teachingkate.org/images/soiltria.gif
I would like to get the lines in black and texture labels in gray to
allow for plotting my texture results on top.
Any examples or suggestions are very welcome!
Thanks in advance,
Sander.
--
2013 Feb 14
5
plot custom x axis ticks values
Readers,
For this data set:
testvalues<-c(10,20,30,40)
How to amend the plot instruction:
plot(testvalues,ann=FALSE,type='l',yaxt='n',xaxt='n')
so that x axis ticks labels can be added to existing graph with
arbitrary value such as 0,100,200,300)?
Thanks in advance.
--
r2151
2006 Oct 09
2
lines at margin?
Hi list,
I want to add some lines at margin area of one figure. mtext could add text
to these margins, can I add lines with different lty parameters? Thanks,
mike
[[alternative HTML version deleted]]
2005 May 05
3
documenation for arrows() is backwards (PR#7839)
Full_Name: Michael Hoffman
Version: 2.1.0
OS: Linux (Fedora Core 3, kernel 2.6.11-1.14_FC3)
Submission from: (NULL) (193.62.199.8)
help(arrows) says:
"""
arrows(x0, y0, x1, y1, length = 0.25, angle = 30, code = 2,
col = par("fg"), lty = NULL, lwd = par("lwd"), xpd = NULL)
...
If 'code=2' an arrowhead is drawn at
2010 Jan 12
1
barplot: border color when stacked
Dear R-users,
I am using R version 2.10.1 under windows.
In a barplot, I want to mark one of the bars with a special border color.
For example:
barplot(c(3, 7, 11), border = c(NA, "red", NA))
But how to do this when the bars are stacked?
for example:
barplot(matrix(1:6, ncol=3)) # border of second bar (i.e. the one with total height = 7) should be red again, I try:
barplot(matrix(1:6,
2013 Feb 08
1
plot ᵒ C in graph axis label
Readers,
For a part of the 'plot' command:
...ylab=expression(paste('rate (',degree~C^-1,')'))...
Is it possible to introduce 'thinspace' (e.g. '\thinspace' in LaTeX)
between the degree (?) sign and the centigrade (C) symbol?
--
r2151
2013 Jan 30
1
remove label from specific axis
Readers,
For a graph plot instruction:
plot(seq(10:50),type='h',yaxt='n',yaxs='i',lab=c(20,2,2),xlab='x axis
label',bty='l',main='graph title')
how to remove y-axis label and keep the x-axis label?
_
r2151
2007 Nov 10
1
Add another set of labels in a plot for X axis
I have a protein sequence alignement and for each position of the
alignement, I want to plot two values (one per sequence). Alignements look
like this:
MVAFKGVWTQAFWKAVTAEFL
--------MCSISRKMAAEFI
So, data for the plot would be something like this
Prot 1 values: 1 5 2 7 4 3 5 6 8 2 2 7 6 4 2 8 5 8 2 3 7 3
Prot 2 values: 1 8 5 0 5 3 4 1 2 2 3 7 0
Aligned Prot 1
2013 Jan 29
2
remove margin between plot and axis
Readers,
Am trying to plot a graph with type 'h' and want to remove the white
space between the plot lines and the x axis. The help section 'par'
suggests that the option 'mai' controls this feature, but the syntax
plot(...mai=c(0,1,1))
is ineffective
Any advice please?
--
r2151
2017 Oct 17
2
ggplot / second axis / just a notation problem
Hi,
I have a question on ggplot2 with the second axis, but I don't think one
needs to know ggplot2 package in order to answer this question.
In this example,
https://rpubs.com/MarkusLoew/226759
since the transformation of the second axis is given by y1=y2*5,
#####
p <- p + scale_y_continuous(sec.axis = sec_axis(~.*5, name = "Relative
humidity [%]"))
#####
Note
2007 Nov 14
1
Changing the text in the strips of lattice plots and y axis
Dear R-helpers,
I am sorry for asking something I know has been
asked before, I have tried different combinations in
the strip function without success...
I am using version 2.5.1 and work on a PC.
I have barcharts generated from the following
formula:
barchart(y1+y2+y3~x | g)
I need to change the names of the variables y1,y2 or
y3 that currently appear in the strips, I have two
2009 Oct 07
2
Second y-axis --- alternative to par(new=
Hi
is there an alternative to par(new), for ading data to a plot for a
different y-axis?
My problem with par(new=TRUE) is, that it re-defines all axis and labels (as
in example 1) and one has to use xlim=... to fix the x-axis.
I am looking for something, which simply resets the y-axis, so that a new
plot() (or points()/lines()) keeps the x-axis, but re-defines the y-axis.
Is there something