[GIS] GeoPandas GeoDataFrame plot statistics – how

geopandaspandaspython

The plot method of a GeoPandas GeoDataFrame overrides the DataFrame parent method to plot the geometries of the associated GeoSeries. This is very convenient, but I'd also like to use the easy ways Pandas provides to plot other properties of my dataset.

However, when I now try to make a scatterplot, or any other kind of plot, I get an error message:

mygeodataframe.plot(kind='scatter', x='somecolumn', 'y'='someothercolumn'...)
*** TypeError: plot_dataframe() got an unexpected keyword argument 'kind'

How do I get my plotting methods back? Converting a copy of the GeoDataFrame (minus the 'geometry' Series) into regular DataFrame helps, but it's clumsy.

I'm using GeoPandas version 0.1.1 and Pandas version 0.17.1.

Best Answer

The GeoPandas plotting methods are there for convenience. They do override the standard pandas plotting methods. For now, the easiest way to get access to basic pandas plotting is probably through their functional versions, something like this:

from pandas.tools.plotting import plot_frame
plot_frame(mygeodataframe, kind='scatter', ...)

Feel free to create an issue about this on the GitHub repository (or better yet, help implement a solution).