similar to: Two Y axes (same scale) in ggplot2 or plot

Displaying 20 results from an estimated 20000 matches similar to: "Two Y axes (same scale) in ggplot2 or plot"

2012 May 08
1
two Y Axes (in the same scale) in ggplot2
Dear R users, I'm plotting housing prices in City A over past 30 years in ggplot2. The Xs are years since 1980. I have two housing price variables: new home prices and old home prices, both of them measured by $/sqft. I have searched related threads on multiple Y axes in ggplot2 and I understand that multiple Y axes in different scales are not possible. I'm wondering if it is possible to
2007 Aug 22
3
tackle memory insufficiency for large dataset using save() & load()??
Hello List, i have been agonizing over this for days, any reply would be greatly appreciated! Situation:___________________________________ My original dataset is a .csv dataset (w/ 2M records) with 4 variables: job_id (Primary key, won't be used for analysis, just used for join tables), sector_id (categorical variable, for 19 industry sectors), sqft (con't variable for square
2013 Apr 18
1
Arranging two different types of ggplot2 plots with axes lined up
Hi all, I want to arrange two ggplot2 plots on the same page with their x-axes lined up - even though one is a boxplot and the other is a line plot. Is there a simple way to do this? I know I could do this using facetting if they were both the same type of plot (for example, if they were both boxplots), but I haven't been able to figure it out for two different types of plots. Below is my
2011 May 30
1
Need help reading website info with XML package and XPath
Hi, I'm looking for help extracting some information of the zillow website. I'd like to do this for the general case where I manually change the address by modifying the url (see code below). With the url containing the address, I'd like to be able to extract the same information each time. The specific information I'd like to be able to extract includes the homedetails url, price
2016 Jul 13
2
par() y ggplot2
Hola. Tengo 4 gráficos: a <- qqnorm(total$ImpTotal) #con lattice y b, c y d son variaciones de este tipo?, creados con ggplot2: ?b <- g <- ggplot(data = total, aes(x=ImpTotal, fill=Convenio)) g + geom_histogram(binwidth = 90) ? Los quiero representar de la forma: par(mfrow=c(2,2)) a b c d Pero los que crea con ggplot2 aparecen en par(mfrow=c(1,1)), es decir: ignora la instrucción.
2007 Jul 25
1
Ggplot2 equivalent of axis and problem with log scale
Dear useRs, Recently I've discorved ggplot2 and I must say that I really like it, although the documentation still is a working in progress. My first question: How can I change the position of the labels and the text of the labels? With a basic plot I would use axis(2, at = position.of.the.ticks, labels = text.at.the.ticks). Could someone provide me with an example of how to do this with
2011 Jan 26
2
plot with 2 y axes
Dear R users, apologies for the total beginner's question. I would like to create a barchart for some temperature values with the y axis on the right hand side of the plot. On this plot would like to overlay some time series data (in the form of a line) for some other variable called Index. The y axis for this latter variable should be on the left hand side of the plot. An example of what I
2011 Sep 30
2
ggplot2 - extracting values of smooth
Suppose that I'm working on Hadley's diamond dataset and I want to review the relationship between price, colour and carat. I might run the following: library(ggplot2) #plot scatter and add some hex binning q<-qplot(carat,price,data=diamonds, geom=c("hex"), main="Variability of Diamond Prices by Carat and Colour") #facet to get one scatter for
2012 Feb 06
1
ggplot2 geom_polygon fill
Hi everyone, i've been trying to make a special plot with ggplot2, but I can't get it to fill the polygon I'd like to see filled so very very much. I want to display the difference or change in the distribution of the modified Rankin Scale between two groups. mRS is a scale for disability or daily activities competence. It looks like this.
2008 Feb 17
1
ggplot2: bug in geom_ribbon + log scale!?
Hi everyone, Hadley, it seems there's a bug in geom_ribbon() when using it in a log-scaled plot: d<-data.frame(x=c(1:20),y1=rnorm(20)+3,y2=rnorm(20)+5) p<-ggplot() p<-p+geom_ribbon(data=d,aes(x=d[["x"]],min=d[["y1"]],max=d[["y2"]])) p<-p+geom_line(data=d,aes(x=d[["x"]],y=d[["y1"]]),colour="blue")
2008 Oct 17
1
ggplot2 scale relation free
I don't know if there is a way to use the scale relation free argument in ggplot2 like in lattice. I have a feeling that there is not, but I would like to make a plea for this feature. It would be nice to be able to plot Total Inorganic Nitrogen Total Phosphorus and the ratio of the two- the numbers on the axis are not related, but the previous two are surely related to the last (this ratio
2010 Feb 04
2
ggplot2 / time series with different scales
I am trying to plot this dataset using ggplot2: df <- data.frame( sid = c(rep('11',30),rep('22',30)), time = rep(ISOdate(year = 2010, month = 1, day = 1:30),2), sales = c(rnorm(30, 1000, 20),rnorm(30, 900, 10)), price = c(rnorm(30, 2, 0.5),rnorm(30, 3,0.5)) ) Plotting just the sales can be done easily: ggplot(data=df, aes(x=time, y=sales, group=sid, color=sid)) +
2013 Feb 25
3
How to plot 2 continous variables on double y-axis with 2 factors: ggplot2, gplot, lattice, sciplot?
Hi, I have a data set with two continous variables that I want to plot MEANS (I am not intrerested in median values) on a double-y graph. I also have 2 factors. I want the factor combinations plotted in different panes. Dummy dataset: mydata <- data.frame(factor1 = factor(rep(LETTERS[1:3], each = 40)), factor2 = factor(rep(c(1:4), each = 10)), y1 =
2007 Jul 16
2
Different axis limits for each facet in ggplot2
Hi! Is it possible to have different axis limit for each facet in a ggplot2 plot? Here is an example: -------------------------------------------------------------- library(ggplot2) x=seq(-10,10,.1) y=cos(x) z=sin(x)*10 dat=melt(data.frame(x,y,z), id.var="x") qplot( x, value, data=dat, facets=variable~., geom="line" )
2011 May 28
1
newbie xml parsing question
I am trying to read some data off the zillow site. Newbie to xml, html, parsing and the xml package. I've been able to load the web page I'm interested with the following code but I'm not sure of the next step to get the information I'm interested in into R : library(XML) url <- "http://www.zillow.com/homes/511 W Lafayette St, Norristown, PA_rb" doc <-doc <-
2009 Feb 18
1
ggplot2 Y axis labels
Hi all: Using the example below, is there a way to add Y axis titles to each graphic instead of sharing the same title? library(ggplot2) RT = matrix(c(814, 500, 424, 394, 967, 574, 472, 446),4,2) colnames(RT) = c('repetition','alternation') rownames(RT) = c('7-yrs','11-yrs','15-yrs','21-yrs') rt <- melt(RT) names(rt) <- c("age",
2012 Aug 05
2
how to put barchart and line chart in the same plot in ggplot2
dear userR: I am trying to plot two dependent variables in the same plot in ggplot2. because these two variables have very different magnitude, I have to use a second Y axis. I hope one variable to be line and the other to be barchart. The x axis is continuous. Yet since I have to make barchart, I guess I have to treat it as discrete or categorical. I have been google searching for the whole
2007 Jun 17
1
[ggplot2] Change color of grid lines
Hi, I am making myself familiar with ggplot2 (I really like the examples at <http://had.co.nz/ggplot2/>). One thing that really annoys me is the default use of white grid lines and a gray background [1, 2]. I simply would like to have black grid lines and a white background. No problem, I thought, "This is R. There is no if. Only how." (fortune("Simon Blomberg")).
2008 Sep 27
2
multiple plots - editing ggplot2 plot
Hi All, I am trying to build a composite plot, with multiple categories, using ggplot2. In principle, it could be done using facetting, but I do not seem to be able to get past the defaults, so I try building each plot separately, then putting them all together using frameGrob and placeGrob. For this, I need to know how to: 1) format the legend with a different layout (e.g 2 rows by 2 columns,
2009 Apr 01
2
help with ggplot2 -- ggpoint function missing?
I'm trying to follow the ggplot introduction here: http://had.co.nz/ggplot/ggplot-introduction.pdf I've installed ggplot2 with install.packages("ggplot2", dep=T) but when I try to run print(ggpoint(p, list(colour = sex))) I get an error: Error in print(ggpoint(p, list(colour = sex))) : could not find function "ggpoint" What is the problem? Has the function been