Passing period_label
to plot_animated
on a GeoDataFrame has no effect if basemap set.
#39
Labels
help wanted
Extra attention is needed
Describe the bug
Plotting a GeoDataFrame using
plot_animated
takes an optionalperiod_label
parameter that can be used to style the date/time label that appears on the graph in each frame. Except, it turns out, if acontextily
basemap is specified, as is done with thebasemap_format
argument. If so, theperiod_label
parameter is ignored and it is not possible to style or position the period label text.To Reproduce
This is as per the documention, with the addition of the
period_label
argument.Expected behavior
The
period_label
key-value pairs to be interpreted as they are in the non-geopandas examples in the documentation.Additional context
The following diff on pandas_alive/geocharts.py fixes the issue. Turns out the problem is that the first frame is determined by the number of strings already added to the axes text (where the period label is set), but adding a basemap sets the axes text to the attribution string for that basemap, so there is always already one string already set. I have elected to leave the attribution text be, so the period label can be positioned elsewhere and styled differently so the attribution still appears as desired. A separate flag could be added to remove the attribution is desired.
The text was updated successfully, but these errors were encountered: