similar to: scaling of different data sets in ggplot

Displaying 20 results from an estimated 5000 matches similar to: "scaling of different data sets in ggplot"

2007 Dec 11
2
ggplot - Setting the y-scale in a bar plot
Dear All (probably Hadley), I am now trying to customise some plots using a bar geom. I do not want to use the default binning statistic, but rather calculate the bar heigths separately. I do manage this, but for comparison purposes I would like to have a set of plots all with the same y-axis height. But I do not seem to find out how to fix the scale of the y-axis in this case. Any tips?
2012 Sep 19
2
ggplot formato dígitos en ggplot2
Hola de nuevo. Resulta que al actualizar a la versión 0.9.2 de ggplot2 , ahora en mi eje continuo y , los valores se etiquetan en formato científico , cuando antes era normal. Es decir, mis valores máximos están sobre 300000, pero en el eje ahora pone 3e+05 y no he encontrado como cambiarlo. He visto que se puede cambiar utilizando el paquete scales y utilizando por ejemplo , siendo p un
2010 Jun 30
2
ggplot qplot bar removing bars when truncating scale
I'm having problems with this example, it is posted with reproduceable code below, both with the normal 0-6 scale and the desired 3-6 scale (with bars removed). How can I get the graph to have the desired 3-6 scale without removing the bars. Thanks! #Data
2017 Oct 12
2
dual y-axis for ggplot
Hi, To my knowledge, an excellent of ggplot with a second y-axis is https://rpubs.com/MarkusLoew/226759 In this example, the author uses two colors for the two lines, but the line shapes are the same -- both are solid. Could each line have its own color as well as its own shape? For example, can I make the red line with the linetype "twodash", while the blue line with the
2007 Oct 31
1
reversing the scale on ggplot
Dear All, I am trying to build a simple ggplot, but where the scale is reversed, i.e. the largest numbers are on the bottom. An example of the code I am using is > plotdata<-data.frame(x=1:10, y=runif(10)) > plot<-ggplot() > plot<-plot+layer(data=plotdata, mapping=aes_string(x='x',y='y'), geom='point', stat='identity', size=4) >
2008 Oct 22
1
ggplot scale limit and stat_smooth
In the change log of ggplot2, version 0.7, I find this: "* scales: any point outside of limits is dropped (this was previously the behaviour for discrete scales, but not continuous scales)" and that makes sense for some applications. But what about if I want to summarize the data with a smooth, and (a) include the effect of all values, but (b) "zoom in" on the smooth by
2017 Oct 12
0
dual y-axis for ggplot
Sorry let me clarify. If I modify the line p <- p + geom_line(aes(y = air_temp, colour = "Temperature")) by p <- p + geom_line(aes(y = air_temp, colour = "Temperature", linetype ="Temperature")) and p <- p + geom_line(aes(y = rel_hum/5, colour = "Humidity")) by p <- p + geom_line(aes(y = rel_hum/5, colour = "Humidity",
2017 Oct 12
1
dual y-axis for ggplot
Hi John, You can try the following: override.linetype=c("twodash","solid") p <- ggplot(obs, aes(x = Timestamp)) p <- p + geom_line(aes(y = air_temp, colour = "Temperature", linetype ="Temperature")) p <- p + geom_line(aes(y = rel_hum/5, colour = "Humidity", linetype="Humidity")) p <- p +
2017 Oct 17
2
ggplot / second axis / just a notation problem
Hi, I have a question on ggplot2 with the second axis, but I don't think one needs to know ggplot2 package in order to answer this question. In this example, https://rpubs.com/MarkusLoew/226759 since the transformation of the second axis is given by y1=y2*5, ##### p <- p + scale_y_continuous(sec.axis = sec_axis(~.*5, name = "Relative humidity [%]")) ##### Note
2011 Jan 06
1
Help spruce up a ggplot graph
Given the data structure below and the call to ggplot2, how can I increase the size of the axis scale points, the line weight, and the size of the legend? ddata <-structure(list(year = structure(c(1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 2L, 2L, 2L), .Label = c("2003", "2007"), class = "factor"), area = structure(c(7L, 6L, 1L, 2L, 3L, 4L, 5L, 7L, 6L, 1L,
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??:
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"))+
2008 Jun 17
1
ggplot facet spacing, wrapping
I'm running into some problems with the spacing of some faceted ggplot plots. I have a number of time series faceted to be one above another, but the scale labels of the y axes all clobber each other at the bottom/top of each. for example, try: qplot(x, y, data = data.frame(x = 1:10, y = 1:10, size = 1:10), facets = size ~ ., size = size) + scale_x_continuous(breaks = 1:10) +
2012 Mar 16
1
ggplot axis limit
Hi, This is probably an easy one, but I am new to ggplot2 and cannot find an answer online. I am bar plotting values of 10 groups. These values are all within a 90-100 range, so I would like leave out the area of the bars below 90. If I say "graph + scale_y_continuous(limit=c(90, 100))", it does limit the axis but the bars disappear completely. Any solution here? Thanks a lot!
2017 Oct 17
0
ggplot / second axis / just a notation problem
Hi John, Why not just try both and see which one makes sense? On Tue, Oct 17, 2017 at 12:24 PM, John <miaojpm at gmail.com> wrote: > Hi, > > I have a question on ggplot2 with the second axis, but I don't think one > needs to know ggplot2 package in order to answer this question. > > In this example, > https://rpubs.com/MarkusLoew/226759 > since the
2011 Sep 07
1
linear regression, log-transformation and plotting
Hello, I've some questions concerning log-transformations and plotting of the regression lines. So far as I know is it a problem to log-transform values smaller than 1 (0-1). In my statistics lecture I was told to do a log(x+1) transformation in such cases. So I provide here a small example to explain my questions: # Some example data for testing a1
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?:
2007 Nov 01
1
ggplot2 - expand range?
Dear UserRs, I am trying to use systematically ggplot2 for most of my plots, but I am fighting some lack of documentation, which I try to overcome. I want to build a scatterplot where the axes cross exactly at (0,0). I tried using scale_y_continuous(limits=c(0,10)), but I always get an extra space at the bottom of the axes. The code I used is below. > plotdata<-data.frame(x=1:10,
2017 Jun 18
2
Problema con Histograma con porcentajes usando ggplot
Estimados Soy un nuevo usario de R, y estoy usando como base de datos el European Social Survey, que tiene datos de 40,000 individuos, y alrededor de 23 países europeos. Lo que he seleccionado es la útima ola, el round 7, para el año 2014. He leido los datos, desde SPSS y aquí tienen la base de datos y que tipo de objetos se han generado, y tambíen la distribución por pais de la muestra. No he
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"))