in ggplot for python specify global xlim in facet_wrap

Viewed 1573

I'm using ggplot for python (still only version 0.4 so that may be the issue). However I wish to plot create a facet-wrapped histogram, and have each facet share the same xlim. The command I use seems to apply the xlim only to the last of the facets. (Also you can see that the labels are applied to the last of the facets only). Is there a way to specificy a global xlim? (And global labels)?

This example looks at the number of intrawiki links on Wikipedia pages that are about a country, and the facets are which Wikipedia we are inspecting, English, French, or Swahili. The data inf_df is a pandas dataframe.

inf_df = metric_df_dict['completeness']

plotinfo = ggplot(aes(x='val', colour='lang'), data=inf_df)  + geom_histogram() + labs("Score", "Frequency") \
+ facet_wrap('lang') + xlim(0,1500)


print plotinfo

I would show my output inline here but I don't have 10 reputation yet, but here's the output png

enter image description here

1 Answers
Related