-2

I have two scatter plot :

qplot(Date,Min,data=baseSenior,color=Type,facets=Rating~Amount.Outstanding)
qplot(Date,Max,data=baseSenior,color=Type,facets=Rating~Amount.Outstanding)

baseSenior is my dataframe, i'd like to obtain one Scatter plot with Max and Min on it. Of course, i want to keep the same sort with Type, Rating and Amount.Outstanding who are categorial variables.

I'm really a newbie with ggplot2, thank you for your time.

ArthurC
  • 3
  • 1
  • reproducible example?? – Koundy Apr 23 '15 at 09:16
  • Hi! Could you please provide [a subset of your real data](http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) as a part of your question so that other users can follow along what the plots should look like? It would also make the question useful for people who face a similar problem later. – musically_ut Apr 23 '15 at 09:24

1 Answers1

0

Basically, you need to reshape your data with melt() into one long data_frame

library(reshape)
M <- melt(baseSenior,id.vars=c("Date","Type","Rating","Amount.Outstanding"),measure.vars=c("Min","Max"))

library(ggplot2)
ggplot(data=M,aes(x=Date,y=value,colour=Type,shape=variable)) +
   geom_point() + 
   facet_grid(Rating~Amount.Outstanding)
scoa
  • 19,359
  • 5
  • 65
  • 80