Displaying 20 results from an estimated 600 matches similar to: "How to get legend outside of plot?"
2012 Jan 10
2
stacked barplot colour coding
Hi all,
i'm fairly new to R and its graphing, but having unsuccessfully 'googled'
and checked this forum to find answer to my problem, i'm posting my question
here.
I'm trying to plot stacked barplot. I have simple data that looks like this:
bg ag
0.41 2.81
0.37 2.91
0.31 2.06
0.32 2.39
every row indicates a factor (1,2,3,4, see below in names.arg). Now when i
plot
1999 Sep 11
1
legend(): adjust space between symbol and tex
Hello,
I'd like to ask, how to adjust the space between symbol/line and text in a
legend. My legend() is build like that
legend(xmax-netzdiff/11, # shouldn't matter here
ifelse(ydiff>=0, #
ymin-6.5*(netzdiff/11), #
ymax-netzdiff/11), #
c("stehender Stamm","Windwurf",
2023 Mar 06
1
legend: interplay between title and y.intersp
Hi,
I think you are right, legend cannot do it. I have now created my own
legend function where I changed only one line and now it works the way I
want it to. But I'm not sure if that might not have other side effects.
I have the impression that the legend and the title start at the same
y-position (try y.intersp=0). Only if y.intersp is big enough, then it
leads to a non-overlap of
2001 Jun 29
3
Fail to build R (PR#1005)
Full_Name: Ziying Sherwin
Version: 1.3.0
OS: Solaris 2.8
Submission from: (NULL) (130.14.31.32)
We tried to install R on our Sun Solaris 2.8 machine using gcc 3.0. During the
compilation,
we got error messages like:
gcc -I. -I../../../src/include -I../../../src/include -I/usr/local/include
-DHAVE_CONFIG_H -g -O2 -c sockconn.c -o sockconn.o
gcc -shared -o internet.so Rsock.o internet.o
2023 Mar 04
1
legend: interplay between title and y.intersp
Set the legend position explicitly with x and y values and add xpd = TRUE
to the legend call to clip the plot to the figure region and not the plot
region (the default). Something like this (you may have to fool around with
y.intersp, etc. to allow enough space between the legend lines):
plot(c(0,1), c(0,1), type="n")
legend(x = .4, y = 1.25, legend=c("", "",
2003 Dec 12
1
legend() graphics output bug (PR#5725)
Full_Name: Daniel Gasser
Version: 1.8.1
OS: Win XP
Submission from: (NULL) (130.60.20.92)
The legend()-Function shows a different behaviour than it did in Version 1.6.1.
It plots a black box left of the legend lines on each legend row. In 1.6.1 there
was just the line in appropriate color for each row in the legend (i was using
exactly the same legend statement and same plot function).
My legend
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>
2023 Mar 04
1
legend: interplay between title and y.intersp
Hi,
my MWE is not working as expected:
plot(c(0,1), c(0,1), type="n")
legend("top", legend=c("", "", "a"), col=c("blue", "red", "green"),
title="test", y.intersp=0.2, lwd=1)
The lines are not below the title. I want (nearby) lines as in the plot,
but below the title. Is there a way to achieve this?
2001 Aug 27
1
colorbar legend for image()
Hi,
are there any plans to add a colorbar legend to image()?
Or such a possibility already implemented which I just haven't
discovered yet. Anyway, I will be willing to spent some time on the
implementation if there isn't anyone working on that already.
Thanks
Thomas
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-devel mailing list -- Read
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
2015 Jun 29
2
CPAN issues
?CPAN is a core module which can be tricky to update on the RedHat based
systems.
Suggest investigating:
local::lib
App::cpanminus
Pinto?
?If you need a newer Perl, check out www.softwarecollections.org.
2015 Jun 29
2
CPAN issues
Hello List,
Running CentOS Linux release 7.0.1406 (Core), and trying to update CPAN from version 1.98 to version 2.10, but it fails.
<snip>
t/97-process_setup_options.t .. ok
t/97-return_values.t .......... 6/10
# Failed test 'blib/script/cpan -j t/97-lib_cpan1/CPAN/Config.pm Local::Prereq::Fails'
# at t/97-return_values.t line 49.
# got: '2'
# expected:
2009 Nov 30
1
Continuous legend colors
Dear List,
I am trying to get a basic plot to show a continuous range of fill colors. It is probably easiest to demonstrate. I would like a legend like in the following example:
Satellite.Palette <-colorRampPalette(c("blue3","cyan","aquamarine","yellow","orange","red"))
require(fields)
image.plot(volcano, col = Satellite.Palette
2009 Mar 24
2
Legend containing maths symbol and values of variables
I need to have the maths symbol for >= in the legend, and to
substitute threshold variable with its value. Somehow, various
attempts weren't successful. Please help.
threshold <- 0.5
plot(NA, xlab="", ylab="", main="", axes=F, xlim=c(0,1), ylim=c(0,1),
xaxs="i", yaxs="i")
legend(x=0, y=1, fill=c("orange", "white",
2012 Jul 30
2
barplot question
Dear r-help members.
I would like to:
a) control the margin around my legend box. Unfortunately I did not find an appropriate command under "?legend". The margin around the actual legend is way too wide. There is a lot of unnecessary "empty space" on the right side.
b) increase the width of the individual barplots. I saw that this can be obtained with the command
1998 Dec 15
1
legend
I am trying to put a legend below some plots as follows:
x11()
par(mfcol = c(2, 1), mar = c(5.1, 6.1, 4.1, 2.1))
matplot(matrix(1:30,15,2), type="l", lty=1:2)
par(mfg = c(2, 1, 2, 1))
legend((par()$usr)[1:2], (par()$usr)[3:4], c("a","b"), lty = 1:2, col=1:2, bty
= "y")
The letters "a" and "b" print but not the lines. If I omit
1997 Nov 03
1
R-beta: math in legends
A non-text attachment was scrubbed...
Name: not available
Type: text
Size: 478 bytes
Desc: not available
Url : https://stat.ethz.ch/pipermail/r-help/attachments/19971103/ae2f1119/attachment.pl
2010 May 07
2
How to re-arrange data in R
Dear users,
I have monthly station data (44) stations data for 45 years which I have
read in R using read.table. the data is in the format:
Year Month Station1 Station2 ......................................
Station 44 (i.e the column names in the 1st row), I also have the
latitude and longitude of the stations in a separate file in R (in the
format : Station LAT LON).
I wish to
2023 Mar 06
1
legend: interplay between title and y.intersp
What about
plot(c(0,1), c(0,1), type="n")
legend("top", legend=c("", "a", ""), col=c("blue", "red", "green"),
title="test", y.intersp=c(1,-0.4), lwd=1)
(in recent versions of R)
Best,
Uwe
On 06.03.2023 11:34, Sigbert Klinke wrote:
> Hi,
>
> I think you are right, legend cannot do
2009 Aug 27
1
Wishlist: specify the border color of boxes in legend() (PR#13913)
I could not find a way to specify the border color of the boxes drawn in
a legend, so that the legend can match exactly the colors of the actual
plot (e.g. in the case of two superimposed histograms which have
different shading and different borders).
Indeed, the legend function seems to hard code the color "black" for the
borders in this call:
rect2(left = xt, top = yt +