Displaying 20 results from an estimated 300 matches similar to: "ggplot2 - legend for fill coulours"
2008 Mar 25
2
ggplot2 - facetting
Dear All,
After having overcome the issue of legends (thanks, Thierry, once
more), I am trying to use facetting, but here also I can not find how
to do this. I do not want to use qplot, but rather the more flexible
options. However, it seems I am doing still something pretty stupid,
because I always get an error, even if it seems I am doing everything
like the examples.
My code is below.
2012 Apr 25
1
FW: Combined grouped and stacked bargraph
Dear R list,
It appears that my request from yesterday got a bit garbled. I have
tried to rephrase and retype it - please let me know if you can help me
- I am having some trouble drawing a bar-graph with two groups, both of
which are stacked.
I would like to plot the conservation status according to two
classifications (i.e. my groups - IUCN status and national status), and
for each of those
2012 Apr 24
2
Combined grouped and stacked bargraph
Dear R list,
I am having some trouble drawing a bar-graph with two groups, both of
which are stacked.
A sample of my data (IUCN and national conservation status for marine
and terrestrial species) look like this:
Status
IUCN Terrestrial
IUCN Marine
National CS Terrestrial
National CS Marine
NE
168
69
16
69
LC
41
6
148
6
NT
5
4
7
4
VU
4
2
7
2
EN
4
2
4
2
CR
1
2012 Feb 07
3
Lattice - different axis length
Dear all,
I have a question about the lattice package, more specifically about the
control of the x-axis length in the different panels. I use the following
code to make the stacked barchart:
barchart(country ~ climatechangefocalpoint + meteorologyservice +
adaptationorvulnerability + cdmcarbonmarkets + energy +
aviationmaritimetransport + forestry + pressofficer|period, data=graph5,
2005 Dec 15
2
Lattice graphics with combined plot types
The data is of two forms, ie one numeric and another ordinal ie 1.5 and
<.5. The X Value is a factor.
I'm trying to create a lattice conditioned plot with the following
characteristics:
1) The plot is conditioned using the form (Conductivity~Day|Valve)
2) The plot should use a barplot for the ordinal (<.5) and dots for the
numeric (1.5)
3) A line should be created specifying a
2009 Mar 23
1
changing order of lattice plots
Hi,
This is another question relating to my 2 factor figure.
densityplot(~End-Begin | Type * Chromosome, data=Mon, layout=c(5,12),
xlab="Element Length",type="percent", col="grey60",
strip=strip.custom(style=3, bg="grey90", par.strip.text=list(cex=0.5)))
I would like to flip the plot so those at the bottom are at the top and
so on. I have tried using a
2000 Jul 07
2
Question of programming style
This is really a question of how to program this *BETTER*. It works as I have
done it, but is quite ugly.
I want to do a 3d scatterplot of the upper triangle of a matrix, where the
z-values are the values in the matrix, and the row and column indices are the y-
and x-values. The complete (11 by 11) matrix is mmtop94.2. Here is my awkward
code:
mmtop94.2[lower.tri(mmtop94.2)] <- NA
# Here i
2000 Feb 29
0
mapping of colornames into hsv: half way done
Ok,
now we have the mapping of color names to color codes (see below) and
conversion to rgb (something like Ben Bolker's function), but how to convert
rgb to hsv?
Thanks to Brian Ripley, Peter Dalgaard and Ben Bolker
Details below
Regards
Jens
etc/colors.big maps 455 names to rgb in S syntax
etc/rgb.txt maps 657 names to rgb in C syntax, but unlike colors() it has
mixed upper and
2011 Sep 15
1
Colour code y-axis labels on a dot plot
Dear R helpers
I would like to be able to colour code the y-axis labels on a complex dot
plot by a variable known as company (of which there are only two). The code
is below and data attached.
Thanks
MarkM
library("lattice")
library(latticeExtra) # for mergedTrellisLegendGrob()
# set size of the window
windows(height=10, width=7,rescale=c("fixed"))
##read the data to a
2010 Aug 09
1
creating pdf of wireframe
Dear R list,
I have written some code to produce several wireframe plots in a panel. They
look good, but when I try to create a pdf, many (but not all) of the details
I have specified are not reproduced. For example, the line width I have
specified is not reproduced, and neither are the font sizes for the axis
labels. I'm an R novice, so I could really use some guidance.
Here is the code I am
2009 Dec 10
1
Detectar outliers en un gráfico de dispersión
Hola amigos, esta es mi primera duda, espero que no sea demasiado fácil.
Tengo unos datos de dos variables y quiero mostrar recta de regresión
y valor de correlación
serie0 <- c(0.651, 0.712, 0.614, 0.645, 0.559, 0.647, 0.642, 0.534,
0.616, 0.621, 0.623)
serie1 <- c(0.572, 0.641, 0.565, 0.596, 0.518, 0.604, 0.602, 0.501,
0.58, 0.589, 0.596)
data <- cbind(serie0, serie1)
colnames(data)
2009 Mar 23
1
lattice multipanel strip placement - with two factors
Hi,
I'm making a multipanel lattice densityplot figure with 2 factors (3 and
20 classes in each factor) with the following statement (the
type="percent" is there to prevent plotting the actual points which
detract from the figure - is there another way of doing this?):
densityplot(~End-Begin | Type * Chromosome, data=Mon, layout=c(5,12),
xlab="Element
2008 Jul 20
2
fill in area between 2 lines with a color
Hi - I'd like to have the area between 2 lines on a x-y plot be filled with
grey, but I haven't had
any luck using polygon or rect. (In reality, I'd like to do this for twice
- once for a low group and once for a high group - and then I'd like to plot
a set of data points for a 'normal' group together with these 2 grey areas.)
Here's a simple example of the 2 lines:
2010 Oct 20
2
histograms resulting from call to soil.texture
Hello,
Using the dataset below I produce a soil.texture plot (R code for this
included at the end). One will notice I have plotted the points based on
whether or not they are in a region called 'upstream' or 'downstream'. I'm
curious if there is a way to somehow extract counts of the number of points
(red points and blue points) falling within each classification (e.g. silty
2012 Nov 30
3
(no subject)
Hello R usuer,
The code given below superimposes a pie diagram on another plot
containing some points. However, I would like to center the pie
diagram on the xy location on the plot, but not on the center. is
there any way to re-center pic diagram.
Any suggestion or better alternative are highly appreciated.
Thank you in advance for your help.
Regards,
Bibke
library(visualFields)
library(car)
2011 Sep 15
1
Move the x-axis labels to the top of the dotplot
Dear R helpers
I would like to move the x-axis labels, which plot automatically at the base
of a dot plot to the top of the plot. Is there a way to do this?
Code snippet below
with(Cal_dat,
dotplot(reorder(paste(Mine,Company), Resc_Gt) ~ Resc_Gt,
fill_var = Commodity,
pch_var = factor(Year),
xlab_var = factor(Company),
pch = c(21, 22, 23),
2009 Jun 22
2
Help needed: Fraction for Histogram > 1 ???
I have been trying to draw histogram for my manscript and found some strange
things that I could not figure out why.
Using the same code listed below I have successfully draw histograms for a
few figures with fraction labeled on Y axis less than 1 (acturally between 0
to 0.1). But one dataset gives the Y axis label 0 to 5 as fraction. This
is not true, as fraction are less than 1, although the
2011 Jun 24
1
try to generate graph for each element of my list
Dear all,
I have the following problem. I have a List of time series dataframe.I'm
trying to produce specific graph for each element of my list. The code is:
This is my list:
Lista_import<-lapply(Lista_import, function(x){
x2<-subset(x, select=c("ANNO","DICHIARANTE","PARTNER", "quota"))
x2<-cast(x2, ANNO+DICHIARANTE~PARTNER)
x2<-
2012 Dec 12
1
Problems with plot maps
Hello,
I need plot map using ggplot()
I use such code:
library("ggplot2")
library(cshapes)
cshp.data <- cshp()
map <- cshp.data[cshp.data$COWCODE==369,]
map_mp<- list(
geom_polygon(aes(long, lat, group = group), data = map, fill = "grey70",
colour = "grey60", inherit.aes = FALSE, show_guide = FALSE),
scale_x_continuous("",
2010 Jul 06
2
grayscale wireframe??
I need grayscale formatting for a wireframe.
The only col.regions that I can find are color palettes are all colored:
rainbow(n, s = 1, v = 1, start = 0, end = max(1,n - 1)/n,
gamma = 1, alpha = 1)
heat.colors(n, alpha = 1)
terrain.colors(n, alpha = 1)
topo.colors(n, alpha = 1)
cm.colors(n, alpha = 1)
The code follows:
X11()
library(lattice)
par(family="serif", cex=1.2)