search for: scale_y_discrete

Displaying 4 results from an estimated 4 matches for "scale_y_discrete".

Did you mean: scale_x_discrete
2013 Apr 14
1
Problem plotting continuous and discrete series in ggplot with facet
...39;)) mcsm <- melt(data.frame(date=economics$date, q=quarters(economics$date)), id='date') mcsm$value <- factor(mcsm$value) ggplot(subm, aes(date, value, col=variable, group=1)) + geom_line() + facet_grid(variable~., scale='free_y') + geom_step(data=mcsm, aes(date, value)) + scale_y_discrete(breaks=levels(mcsm$value)) If I leave out scale_y_discrete, R complains that I'm trying to combine discrete value with continuous scale. If I include scale_y_discreate my continuous series miss their scale. Is there any neat way of solving this issue ? I also see that the legend is alphabetic...
2011 Nov 08
3
ggplot2 reorder factors for faceting
...lt;- hp2 + scale_fill_gradient2(name=NULL, low="#0571B0", mid="#F7F7F7", high="#CA0020", midpoint=0, breaks=NULL, labels=NULL, limits=NULL, trans="identity") # set up text (size, colour etc etc) hp2 <- hp2 + labs(x = "Time", y = "") + scale_y_discrete(expand = c(0, 0)) + opts(axis.ticks = theme_blank(), axis.text.x = theme_text(size = 10, angle = 360, hjust = 0, colour = "grey25"), axis.text.y = theme_text(size=10, colour = 'gray25')) hp2 <- hp2 + theme_bw() In the resulting plot I would like infections infA and infC plott...
2019 Jul 18
4
Gráfico tiempos de supervivencia
...r(sample(c(0,1), 10, replace=T)) ) library(ggplot2) ggplot( data = DATOS ) + geom_point( aes(x = TIEMPO, y = ID , shape = DEF, color = DEF), size = 5 ) + geom_segment( aes( x = 0, y = ID, xend = TIEMPO, yend = ID ) ) + guides(colour = FALSE) + labs(shape = 'LEGEND') + scale_y_discrete() + theme_minimal() #----------------- E incluso puedes reproducirlo usando fuentes parecidas a la de los comics con el paquete "xkcd". Saludos, Carlos Ortega www.qualityexcellence.es El jue., 18 jul. 2019 a las 13:05, Griera-yandex (<griera en yandex.com>) escribió: > H...
2019 Jul 18
3
Gráfico tiempos de supervivencia
Hola, te vale esto? Es forma estandar de representar graficos supervivencia Basado en esto: https://rviews.rstudio.com/2017/09/25/survival-analysis-with-r/ set.seed(20) DATOS <- data.frame ( ID = c (1:10) , TIEMPO = sample(1:40, 10, replace=F) , DEF = sample(0:1, 10, replace=T) ) DATOS library(survival) DATOS$DEF <- as.numeric(DATOS$DEF) DATOS$TIEMPO <-