Displaying 20 results from an estimated 300 matches similar to: "ggplot2 - bar colour"
2010 Dec 08
1
ggplot - line_range help, second tier axis label
Hi All,
Will try and keep brief, excuse the poor graphics skills, first time using
GIMP. I would like to make the first one look (somewhat) like the second if
possible.
From: http://d.imagehost.org/0519/Screen_shot_2010-12-08_at_3_50_23_PM.png
To here:
http://d.imagehost.org/0293/Screen_shot_2010-12-08_at_3_50_23_PM2.png
I imagine the line going over the top with the p-values is probably not
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
2012 Jan 29
1
ColorBrewer question
Hello, R friends,
I'm trying to change colors of my horizontal bars so that they show a sequence.
I chose the ColorBrewer palette "Blues". However the resulting plot doesn't show any changes to the default.
I tried several places of "+ scale_colour_brewer(type="seq", pal = "Blues")" with no effect.
This is my code:
p <- ggplot(data, aes(x =
2010 Apr 23
1
help with plotting lines linking two sets of points?
Hello everyone,
I'm trying to plot the initial and final size of some tadpoles and look at
their growth rates (slope of line). They are divided into 6 densities, and
so far I have plotted the initial and final sizes (these are means for a
pool), and color coded for the 6 densities, but I want a line to connect the
initial and final value for each pool (also color coded by density). Any
ideas?
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??:
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 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
2010 Jun 14
7
"NoMethodError in AdminController#index" error
hi, im totally a newbie so i have got no idea whatsoever why i got this
error, the thing that happend was i was doing a little coding along with
the lynda.com rails series that i got this error.
well as u can see this is the error which i get on terminal, but there
is another one in browser too which says : "NoMethodError in
AdminController#index " u can see it in the picture here :
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,
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?:
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"))
2023 Nov 24
1
ggplot adjust two y-axis
Hi,
Just find a scaling factor that would make the two sets of data comparable.
Here I divided the second row by 5 and did the same for the second axis.
Charles-?douard
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")) axis(2,
at=c(0,10,20,30,40,50,60, labels=c(0,10,20,30,40,50,60))) axis(4, at =
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
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),
2013 Oct 01
5
Análisis de componentes principales con ade4 y FactoMineR
Hola compañeros de la lista, qué tal.
Estoy haciendo un análisis de componentes principales utilizando
las funciones "dudi.pca" (paquete "ade4") y "PCA" (paquete
"FactoMineR"). Sucede que al comparar las coordenadas de cada individuo
que obtiene cada función, las que corresponden al segundo componente
principal tienen idéntica magnitud pero con
2008 May 05
1
Problems using rfImpute
Hello R-user!
I am running R 2.7.0 on a Power Book (Tiger). (I am still R and
statistics beginner)
I tried rfImpute (randomForest) and as far as I understood should it
replace NA`s using a proximity matrix:
> set.seed(100000)
> Subset5Imputed<-rfImpute(Sex~., data=Subset5)
ntree OOB 1 2
300: 11.78% 12.36% 11.21%
ntree OOB 1 2
300: 12.07% 12.64%
2017 Oct 13
2
How to define proper breaks in RFM analysis
Hey,
i want to define 3 ideal breaks (bin) for each variable one of those
variables is attached in the previous email,
i don't want to consider quartile method because quartile is not working
ideally for that data set because data distribution is non normal.
so i want you to suggest another method so that i can define 3 breaks with
the ideal interval for Recency, frequency and monetary to
2009 Oct 28
4
Insertar filas en un data frame
Hola,
Por favor, necesito insertar una fila debajo de las filas que tengan DV
distinto de cero, pero no me deja insertar hasta el final de la tabla.
Esta es mi tabla y este es el código con el que estoy apurado.
C ID TIME DV AMT RATE CMT SS II EVID GRUPO VISITA DOSIS VECES FORMA NAP
EDAD SEXO ALTURA PESO
11 0 0 3 0 1 1 12 1 3 0 3 2 1 0 77 2 147 74
11 1.417 0.001 0 0 2 0 0 0 3 0 3 2 1 0.001