0
votes

I was trying to create a plot for each of the 4 quarters in my data. So I used:

qplot(date, mape, data = df, facets = .~quarter)

The resulting plot was: enter image description here

The X-axis is using all the months present in the "date" column - from Jan - Dec. But the data on the chart is limited to the months of the quarter for e.g. Jan-Feb-March in the Q1 facet, Apr-May-June for Q2 etc. How can I limit the x-axis to the months corresponding to the quarter only?

as an alternate, I did this but its not exactly how I want to display my data: qplot(strftime(df$date, format = "%b"), mape, data = predicted.modelset)

1
as an alternate, I did this but its not exactly how I want to display my data: qplot(strftime(df$date, format = "%b"), mape, data = predicted.modelset) - vagabond
Hard to know without your data, but try this: qplot(date, mape, data = df) + facet_grid(.~quarter,scales="free_x") - jlhoward

1 Answers

0
votes

It would be best if you could provide data for this but I am pretty sure the following will work:

qplot(date, mape, data = df) + facet_wrap(~quarter,scales="free_x") #without a dot before ~