Displaying 20 results from an estimated 1000 matches similar to: "ColorBrewer question"
2013 Feb 01
2
Change default order of colors & line types
Dear R users,
I'd like to change the default order of colors & line types.
Especially I am using ggplot2 and using color Set1.
In Set1, the default color order is red, blue, green, violet,.. ect.
However, I want to put red in fourth (not first).
Likewise, I want to change the order of default linetype. I want to
put "solid" line in fourth.
How can I do thses?
R code to draw the
2009 Dec 04
2
[ggplot2] Wind rose orientation
Aloha all,
I love using ggplot. It took a while to get used to the grammar of
graphics, but it is starting to get easy now that I am thinking in a
more structured way.
A question. I'm making a wind rose that I'd like to be oriented with
due north straight up. I've discovered that the orientation is
sensitive to how north is represented. When north is represented as
0,
2010 Nov 23
1
specifying colours in a ggplot2 piechart
Someone was asking how to do a 16 category piechart in OpenOffice Calc and it appears that it can not be done (which we, probably, should be happy about) but I thought that I'd try it in ggplot2.
It works but I then thought I'd like to make the colours more distinctive but fro some reason I don't seem to be able to use manually assigned colours.
Can anyone suggest where I'm
2012 Jun 06
5
ggplot incorrect legend
How do I create a legend with ggplot?
I think should be getting the FuelTypeNum in the legend.
Plot:
http://r.789695.n4.nabble.com/file/n4632471/Rplot.jpeg
My code is:
ggplot(data=tempTable, aes(x=Bands8, y=SubPercent, fill=FuelTypeNum)) +
geom_bar(position="stack", stat="identity") +
scale_colour_hue('my legend', breaks = levels(tempTable$FuelTypeNum),
2011 Jul 09
1
Suppressing the labelling of tick marks on ggplot2
Hi,
I have the follow ggplot2 code I am running:
ggplot(data=bb.res.math,aes(x=factor(id.bb),y=bb.math.comb,fill=BB)) + geom_bar() + facet_grid(BB~.) + scale_fill_brewer(pal="Set1") + ylab("Average Student Residual (Math)") + xlab("Student ID")
The number of unique id.bb is 2207 and so my X-axis has a couple of thousands, indistinguishable tick marks that correspond
2011 Oct 18
3
Ordering of stack in ggplot (package ggplot2)
I'm trying to reproduce the 3rd graph on the page of this site:
http://learnr.wordpress.com/2009/03/17/ggplot2-barplots/ . However, the data
below produces a ggplot with the stacks sorted in alphabetical order from
the bottom up. I'd like the stacks to be in the order "Europe", "Asia",
"Americas, "Africa", "Oceania". Is there an easy way to
2016 Apr 09
1
Run script R
hi all ,?
i have an problem in script R . But when I execute the script R I face this error . can you help me please ???error:-----------------------------------------
Error in FUN(X[[i]], ...) :?? Theme element 'text' has NULL property: margin, debugIn addition: Warning messages:1: Removed 361 rows containing non-finite values (stat_smooth).?2: Removed 361 rows containing missing values
2020 Sep 23
2
ORDEN GRÁFICO POR MESES
Hola,
Estoy haciendo un gráfico con:
#############################################################################
## GRAFICO BARRAS : VALORES AL DEBE MENSUALIZADO
ggplot(Diario_S2, aes(x=mes_AAA, by = MES , y=ARS_DEB))+ # ASIGNAR
VARIABLES
geom_bar(stat="identity", width=0.7, # ANCHO BARRAS
colour="grey", fill="darkgreen", #
2011 Aug 04
1
Plotting just a portion of a smoother graph in ggplot2
Hi,
I am using ggplot2 to with the following code:
gmathk2 <-
qplot(time,math,colour=Kids,data=kids.ach.lm.k5,geom="smooth",method="lm",formula=y~ns(x,1))
+ opts(title="Smoother Plot: Math K-5") + xlab("Time") + ylab("Math") +
scale_colour_brewer(pal="Set1"); gmathk2
This plots all the smoother for all the x values. What I'd like
2008 Dec 19
1
diagonal lines in legends of ggplot2
Hi, I have the following problem with ggplot2: When I specify black contours
for bars in a barplot, ggplot automatically shows diagonal lines in the
legend boxes. Is there a way, to remove these diagonal lines?
Here's a simple example:
library(ggplot2)
df<-data.frame(x=gl(6,1),y=rnorm(6,100,50))
ggplot(df,aes(y=y,x=x,fill=x))+geom_bar(aes(group=x),colour='black',size=1)+
2023 Nov 24
1
ggplot adjust two y-axis
Dear R-users
Is it possible to adjust two y-axis in a ggplot differently?
- First y axis (0-60)
- Second y axis (0-2500)
### Figure 1
ggplot(Fig1,aes(BFF,Wert,fill=Studien_Flaeche))+
geom_bar(stat="identity",position='dodge')+
scale_y_continuous(name="First Axis", sec.axis=sec_axis(trans=~.*50,
name="Second Axis"))+
2023 Nov 24
1
ggplot adjust two y-axis
Hi Sibylle,
For that kind of data with two different scales, I generally use two graphs
that I name gg1 and gg2 and join them using gridExtra::grid.arrange(gg1,
gg2). This way, the red part of your graph is easier to interpret.
Have a nice day,
Charles-?douard
-----Message d'origine-----
De?: R-help <r-help-bounces at r-project.org> De la part de
sibylle.stoeckli at gmx.ch
Envoy??:
2010 Sep 10
3
ggplot bar geom: control the filling in the colour legend
Hi all,
Is it possible to change the filling of the squares used to represent
the colour legend in a bar plot with ggplot?
in this example, fillings are raven black, I'd like them white.
ggplot(diamonds, aes(clarity, colour = cut)) + geom_bar()
Regards
--
-------------
Benoit Boulinguiez
Ph.D student
Ecole de Chimie de Rennes (ENSCR) Bureau 1.20
Equipe CIP UMR CNRS 6226 "Sciences
2005 Jul 07
2
Brewer colours
Anyone who is interested in using optimal colour palettes should
look at the work of Cindy Brewer: www.colorbrewer.org
I have written code to use her colour schemes in R. It is
included below. Perhaps someone may find this interesting enough
to work into a package.
Included also is a function showpalette, which was posted here a
while back. I don't remember who wrote it.
I have copied all
2011 Dec 04
1
Polishing my geom_bar for publication
Dear list,
I am new with ggplot2 and I have spend quiet some time putting together the following code to create the attached plot. However there's still a few things that I'm having trouble with!
I would be grateful if someone can tell me how to fix (1) the colour of my bars into grey scales (2) removing the y-axis (species name) on the right figure to avoid duplication, and (3) fix the
2023 Nov 24
1
ggplot adjust two y-axis
Hi,
I don't know the axis mecanism well enough in ggplot but using the original
barplot function you can add an axis on the right using the axis function.
Here is an example:
test <- as.table(matrix(c(2,10,3,11), 2,2))
barplot(test, beside = TRUE, col = scales::brewer_pal(palette = 1)(2))
axis(4, at = c(0, 5, 10), labels = c(0,50,100))
-----Message d'origine-----
De?:
2012 Dec 21
2
ggplot2: setting martin
Is it possible to set the margin in ggplot2 to a fixed size? I create many
plots, and I want them to look the same.
Especially I want them to have the same left margin.
But
P<-ggplot()+geom_bar(aes(c("short label1","short
label2"),runif(2)))+coord_flip()
P<-creates a plot with another margin as
ggplot()+geom_bar(aes(c("very very very very long
2010 Sep 20
1
ggplot2 - bar colour
Hi All,
I have trying to do what I thought was a reasonably simple graph but I think
I'm now going in circles with the colour. Attached is a picture of where I'm
up to.
The line creating this is:
qplot(ageincgraph$age, ageincgraph$rate, position="dodge", stat="identity",
geom="bar" ) + aes( colour=ageincgraph$era) +
2010 Sep 01
2
ggplot2 multiple group barchart
hi there.. i got a problem with ggplot2.
here my example:
library (ggplot2)
v1 <- c(1,2,3,3,4)
v2 <- c(4,3,1,1,9)
v3 <- c(3,5,7,2,9)
gender <- c("m","f","m","f","f")
d.data <- data.frame (v1, v2, v3, gender)
d.data
x <- names (d.data[1:3])
y <- mean (d.data[1:3])
pl <- ggplot (data=d.data, aes (x=x,y=y))
pl
2023 Nov 24
1
ggplot adjust two y-axis
Dear Charles-Edouard
Thanks a lot. Yes indeed barplot sounds excellent.
Unfortunately, the scale of the smaller axis is fixed, even If I am able to
draw to axes. The idea is to expand the scale to the scale to the second
axis for comparison.
F1 <- as.table(matrix(c(50,11,6,17,16,3,1,2237,611,403,240,280,0,0), 2,7))
barplot(F1, beside = TRUE, col = c("blue", "grey"))