Displaying 20 results from an estimated 10000 matches similar to: "Plotting a legend outside the figure - units"
2009 Jan 14
4
How to get legend outside of plot?
I am creating a CDF plot function more user-friendly than any default r
function. Depending upon the bimodality of the data (it is often bimodal),
or any other strange data trends, the points can end up gathering in just
about any corner of the plot. So, when I add a legend, whether I choose to
add it in the bottom right, top left, or wherever, it will sometimes end up
putting the legend right
2006 May 10
2
Legend titles in log plots broken? (ver. 2.2.1)
Legend titles work in linear plots:
curve(1/x, xlim = c(0, 1))
legend(x = 'topright', inset = 0.04,
legend = '1/x', lty = 1,
title = 'Legend Title')
But when you change to a log plot on either dimension things get screwy:
curve(1/x, xlim = c(0, 1), log = 'y')
legend(x = 'topright', inset = 0.04,
legend = '1/x', lty = 1,
2012 Feb 16
2
Legend vanishes when placed outside the graph
Hello everyone,
i’ve got a problem with my diagram’s legend. I know i should be able to figure it out by reading the ‘plot’ and ‘legend’ reference. However nothing works so it would be kind if anyone could point me to the necessary parameters.
The problem is that i’m moving the legend using the ‘inset’-parameter so it does not overlap with the graph. However it vanishes outside the graph, so
2008 Jul 02
2
position legend below x-axis title
Dear helpers,
I'm using a R script on several different datasets, which makes that
axis scales may vary quite a lot from dataset to dataset. So what I'm
looking for now, is how to automagically find out how to position the
legend (horizontal) in the space below the x-axis title, and how to
make sure that the legend is within the limits of the lower inner or
outer margin?
I'm aware of
2011 Nov 24
1
Legend
Hi everyone.
I have a linear regression where I retrieve the R2 like this:
r2 = sprintf('%4.2f %s',(summary(reg1)$r.squared))
In my figure I have a legend where I would like to add that R2 value to the
legend text.
Something like: My text R^2 = r2
legend('topright', inset = .05, title='light ratios', pch = c(21),
c(paste('Green/Red', R^2, '=', r2)),
2010 Jan 12
1
Multiple symbols per single line in a legend
Hello everybody,
Is it possible to coax legend() into displaying more than one simbol per
line in legend? I have a graph like the one attached to this mail; I would
like to reorganize the legend in such a way that the duplicate text would be
omitted, i.e., the first line would read <square> <triangledown> "increasing
frequency" and the second one would read <circle>
2017 Nov 20
3
Σχετ: change colour in barplot
Dear all,?
I am really sorry for this. I have attached the script and a .csv file with an example.?
Hope this will help.
Many thanks,Maria
???? 11:53 ?.?. ???????, 20 ????????? 2017, ?/? Duncan Murdoch <murdoch.duncan at gmail.com> ??????:
On 20/11/2017 6:38 AM, Maria Lathouri via R-help wrote:
>? Dear all
> I know that it is a very simple question but it seems that I cannot
2017 Nov 20
0
change colour in barplot
On 20/11/2017 6:38 AM, Maria Lathouri via R-help wrote:
> Dear all
> I know that it is a very simple question but it seems that I cannot change the colour in the bars.
> I have the following dataframe:
> A ? ? ? ? ? ? ? ?? B ? ? ? ? ? ? ? ? C ? ? ? ? ? D ? ? ? ?? E ? ? ? ? ? ? ? ? ?? F ? ? ? ? ? ? ? ? ?? G ? ? ? ? ? ? ? ?0.0.24 ? ? ? ?? 152460 ? ? ? ? 474 ? ? ? 5.5 ? ? ?? 612000 ? ?
2008 Dec 22
0
Align legend title
Dear R developers,
I needed to align the title of legend for some of my plots. If there is interest to include
this into base R, bellow are the examples and the relevent diffs.
Regards, Gregor
x <- 1:10
y1 <- 1.5 * x
y2 <- 2.0 * x
y <- cbind(y1, y2)
source(file=url("http://gregor.gorjanc.googlepages.com/legend.R"))
matplot(x, y, type="l", lty=c(1, 2))
##
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]]
2017 Nov 20
2
change colour in barplot
Dear all
I know that it is a very simple question but it seems that I cannot change the colour in the bars.
I have the following dataframe:?
A ? ? ? ? ? ? ? ?? B ? ? ? ? ? ? ? ? C ? ? ? ? ? D ? ? ? ?? E ? ? ? ? ? ? ? ? ?? F ? ? ? ? ? ? ? ? ?? G ? ? ? ? ? ? ? ?0.0.24 ? ? ? ?? 152460 ? ? ? ? 474 ? ? ? 5.5 ? ? ?? 612000 ? ? ? ? ? 59061000 ? ? ? 1540313
and here is the script:
2017 Nov 20
0
Σχετ: change colour in barplot
On 20/11/2017 7:09 AM, Maria Lathouri wrote:
> Dear all,
>
> I am really sorry for this. I have attached the script and a .csv file
> with an example.
The problem is that you have dat as a matrix with only one row.
barplot() applies the colours to the rows of dat; since you have only
one row, everything ends up blue.
You can fix this by creating dat as a vector using
2012 Feb 10
5
how to plot a nice legend?
i'd like to plot a legend in my diagram. The diagram will be included
in a TikZ LaTeX document later.
I tried the legend() function, but
- it can not find a good place it self where the legend fits
and playing around with coordinates and scaling consumes a lot time
- standard settings for the text need adjustment
(linespacing is quite large and so on)
Is there an alternative to
2008 Dec 05
1
Trouble with gridBase and inset plots
Dear All,
I ma having a trouble in generating a figure containing 3 insets with
the gridBase package.
I always get an error message of the kind:
Error in gridPLT() : Figure region too small and/or viewport too large
No matter which parameters I choose. The plots works nicely with two
insets only, but when I try adding the third one, my troubles begin.
I am probably doing something wrong in the
2009 Feb 18
1
interaction.plot - gridlines and formatting legend title...
Thank you for providing advice on this graphics question.
I am building an interaction.plot.
d=data.frame(xx=c(3,3,2,2,1,1),yy=c(4,3,4,3,4,3),zz=c(5.1,4.2,4.4,3.5,3.3,-1.1,-1.3)
d[[1]]<-as.factor(d[[1]])
d[[2]]<-as.factor(d[[2]])
print(d)
interaction.plot(d$xx, d$yy, d$zz,
type="b", col=c("red","blue"), legend=F,
lty=c(1,2), lwd=2, pch=c(18,24),
2005 Aug 16
1
Overall Legend
Hello. I am using R version 2.1.1 on Windows 2000.
I am using a par(mfrow=c(2,2)) statement to produce 4 plots on one screen. I want a single horizontal legend to appear at the top of the four plots. My code is something like this:
par(mfrow=c(2,2))
plot(x,y1)
lines(x,y2)
lines(x,y3)
plot(x,z1)
lines(x,z2)
lines(x,z3)
plot(x,t1)
lines(x,t2)
lines(x,t3)
plot(x,w1)
lines(x,w2)
lines(x,w3)
2009 May 06
1
Positioning a legend via X and Y coordinates
Dear R Users,
I'm able to display a legend using the following code:
> legend("topright", c("Simulation", "Observation"), fill=2:3, bty="n")
However, this causes the legend to be positioned too close to the bars in my barplot. I'd like to move the legend up slightly. I have been trying to determine the necessary values by trial and error to do
2004 Aug 20
3
legends on the outside of the "box"
Hi R People:
Here is a simple set of commands:
>x1 <- 1:10
>x2 <- sqrt(x1)
>plot(x1)
>points(x2,col="red",pch=3)
>legend(2,8,legend=c("First","Second"),col=c("black","red"),pch=c(1,3))
>
Fine.
Now, I would like to put the legend box on the outside of the plot itself,
perhaps in the lower
left hand corner.
I've been
2008 Mar 20
4
little subplot in corner
I want to draw a little subplot ("overview") into my detailed plot. It
should be placed in say the top right corner and have the size of some
legend (like legend(x="topright", inset=0.03, ...)
#main plot
plot(rnorm(100))
#give little density in corner
plot(seq(-2,2,length=300),dnorm(seq(-2,2,length=300)),type="l")
I don't want something like par(mfrow=c(1,2)) as
2007 Jul 31
1
legend()
Hi Sir
How can I use legend() outside th e plot.
Please guid in this regard.
Thanks
--
AMINA SHAHZADI
Department of Statistics
GC University Lahore, Pakistan.
Email:
amnakhan493 at gmail.com
amna_989 at hotmail.com
amna_989 at yahoo.com