MCPcopy Create free account
hub / github.com/NatLabRockies/windtools / plot_profile

Function plot_profile

windtools/plotting.py:718–1053  ·  view source on GitHub ↗

Plot vertical profile at specified time(s) for various dataset(s) and/or field(s). By default, data for multiple datasets or multiple times are stacked in a single subplot. When multiple datasets and multiple times are specified together, times are stacked in a subplot per

(datasets,
                 fields=None,
                 times=None,
                 timerange=None,
                 fig=None,ax=None,
                 fieldlimits=None,
                 heightlimits=None,
                 fieldlabels={},
                 cmap=None,
                 stack_by_datasets=None,
                 labelsubplots=False,
                 showlegend=None,
                 fieldorder='C',
                 ncols=None,
                 subfigsize=(4,5),
                 plot_local_time=False,
                 local_time_offset=0,
                 datasetkwargs={},
                 **kwargs
                )

Source from the content-addressed store, hash-verified

716
717
718def plot_profile(datasets,
719 fields=None,
720 times=None,
721 timerange=None,
722 fig=None,ax=None,
723 fieldlimits=None,
724 heightlimits=None,
725 fieldlabels={},
726 cmap=None,
727 stack_by_datasets=None,
728 labelsubplots=False,
729 showlegend=None,
730 fieldorder='C',
731 ncols=None,
732 subfigsize=(4,5),
733 plot_local_time=False,
734 local_time_offset=0,
735 datasetkwargs={},
736 **kwargs
737 ):
738 """
739 Plot vertical profile at specified time(s) for various dataset(s)
740 and/or field(s).
741
742 By default, data for multiple datasets or multiple times are
743 stacked in a single subplot. When multiple datasets and multiple
744 times are specified together, times are stacked in a subplot
745 per field and per dataset.
746
747 Usage
748 =====
749 datasets : pandas.DataFrame or dict
750 Dataset(s). If more than one set, datasets should
751 be a dictionary with entries <dataset_name>: dataset
752 fields : str, list, 'all' (or None)
753 Fieldname(s) corresponding to particular column(s) of
754 the datasets. fields can be None if input are Series.
755 'all' means all fields will be plotted (in this case all
756 datasets should have the same fields)
757 times : str, int, float, list (or None)
758 Time(s) for which vertical profiles are plotted, specified as
759 either datetime strings or numerical values (seconds, e.g.,
760 simulation time). times can be None if all datasets combined
761 have no more than one time value, or if timerange is specified.
762 timerange : tuple or list
763 Start and end times (inclusive) between which all times are
764 plotted. If cmap is None, then it will automatically be set to
765 viridis by default. This overrides times when specified.
766 fig : figure handle
767 Custom figure handle. Should be specified together with ax
768 ax : axes handle, or list or numpy ndarray with axes handles
769 Customand axes handle(s).
770 Size of ax should equal nfields * (ndatasets or ntimes)
771 fieldlimits : list or tuple, or dict
772 Value range for the various fields. If only one field is
773 plotted, fieldlimits can be a list or tuple. Otherwise, it
774 should be a dictionary with entries <fieldname>: fieldlimit.
775 Missing fieldlimits are set automatically

Callers

nothing calls this directly

Calls 13

PlottingInputClass · 0.85
_get_dim_valuesFunction · 0.85
_get_pivot_tableFunction · 0.85
_get_fieldFunction · 0.85
_get_sliceFunction · 0.85
_get_pivoted_fieldFunction · 0.85
_align_labelsFunction · 0.85
addLabelsFunction · 0.85
_format_legendFunction · 0.85
set_titleMethod · 0.80

Tested by

no test coverage detected