metobs_toolkit.Dataset.make_geo_plot#
- Dataset.make_geo_plot(variable='temp', title=None, timeinstance=None, legend=True, vmin=None, vmax=None, legend_title=None, boundbox=[])[source]#
Make geospatial plot.
This functions creates a geospatial plot for a field (observations or attributes) of all stations.
If the field is timedepending, than the timeinstance is used to plot the field status at that datetime.
If the field is categorical than the leged will have categorical values, else a colorbar is used.
All styling attributes are extracted from the Settings.
- Parameters:
variable (string, optional) – Fieldname to visualise. This can be an observation type or station or ‘lcz’. The default is ‘temp’.
title (string, optional) – Title of the figure, if None a default title is generated. The default is None.
timeinstance (datetime.datetime, optional) – Datetime moment of the geospatial plot. If None, the first occuring (not Nan) record is used. The default is None.
legend (bool, optional) – I True, a legend is added to the plot. The default is True.
vmin (numeric, optional) – The value corresponding with the minimum color. If None, the minimum of the presented observations is used. The default is None.
vmax (numeric, optional) – The value corresponding with the maximum color. If None, the maximum of the presented observations is used. The default is None.
legend_title (string, optional) – Title of the legend, if None a default title is generated. The default is None.
boundbox ([lon-west, lat-south, lon-east, lat-north], optional) – The boundbox to indicate the domain to plot. The elemenst are numeric. If the list is empty, a boundbox is created automatically. The default is [].
- Returns:
axis – The geoaxes of the plot is returned.
- Return type:
matplotlib.pyplot.geoaxes
Note
If a timezone unaware datetime is given as an argument, it is interpreted as if it has the same timezone as the observations.
Examples
>>> import metobs_toolkit >>> >>> # Import data into a Dataset >>> dataset = metobs_toolkit.Dataset() >>> dataset.update_settings( ... input_data_file=metobs_toolkit.demo_datafile, ... input_metadata_file=metobs_toolkit.demo_metadatafile, ... template_file=metobs_toolkit.demo_template, ... ) >>> dataset.import_data_from_file() >>> >>> # Make default geospatial plot >>> dataset.make_geo_plot() <GeoAxes:...