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

Function plot_timehistory_at_height

windtools/plotting.py:392–715  ·  view source on GitHub ↗

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

(datasets,
                               fields=None,
                               heights=None,
                               extrapolate=True,
                               fig=None,ax=None,
                               fieldlimits=None,
                               timelimits=None,
                               fieldlabels={},
                               cmap=None,
                               stack_by_datasets=None,
                               labelsubplots=False,
                               showlegend=None,
                               ncols=1,
                               subfigsize=(12,3),
                               plot_local_time=False,
                               local_time_offset=0,
                               datasetkwargs={},
                               **kwargs
                               )

Source from the content-addressed store, hash-verified

390
391
392def plot_timehistory_at_height(datasets,
393 fields=None,
394 heights=None,
395 extrapolate=True,
396 fig=None,ax=None,
397 fieldlimits=None,
398 timelimits=None,
399 fieldlabels={},
400 cmap=None,
401 stack_by_datasets=None,
402 labelsubplots=False,
403 showlegend=None,
404 ncols=1,
405 subfigsize=(12,3),
406 plot_local_time=False,
407 local_time_offset=0,
408 datasetkwargs={},
409 **kwargs
410 ):
411 """
412 Plot time history at specified height(s) for various dataset(s)
413 and/or field(s).
414
415 By default, data for multiple datasets or multiple heights are
416 stacked in a single subplot. When multiple datasets and multiple
417 heights are specified together, heights are stacked in a subplot
418 per field and per dataset.
419
420 Usage
421 =====
422 datasets : pandas.DataFrame or dict
423 Dataset(s). If more than one set, datasets should
424 be a dictionary with entries <dataset_name>: dataset
425 fields : str, list, 'all' (or None)
426 Fieldname(s) corresponding to particular column(s) of
427 the datasets. fields can be None if input are Series.
428 'all' means all fields will be plotted (in this case all
429 datasets should have the same fields)
430 heights : float, list, 'all' (or None)
431 Height(s) for which time history is plotted. heights can be
432 None if all datasets combined have no more than one height
433 value. 'all' means the time history for all heights in the
434 datasets will be plotted (in this case all datasets should
435 have the same heights)
436 extrapolate : bool
437 If false, then output height(s) outside the data range will
438 not be plotted; default is true for backwards compatibility
439 fig : figure handle
440 Custom figure handle. Should be specified together with ax
441 ax : axes handle, or list or numpy ndarray with axes handles
442 Customand axes handle(s).
443 Size of ax should equal nfields * (ndatasets or nheights)
444 fieldlimits : list or tuple, or dict
445 Value range for the various fields. If only one field is
446 plotted, fieldlimits can be a list or tuple. Otherwise, it
447 should be a dictionary with entries <fieldname>: fieldlimit.
448 Missing fieldlimits are set automatically
449 timelimits : list or tuple

Callers

nothing calls this directly

Calls 14

PlottingInputClass · 0.85
_get_dim_valuesFunction · 0.85
_get_pivot_tableFunction · 0.85
_get_pivoted_fieldFunction · 0.85
_get_sliceFunction · 0.85
_get_fieldFunction · 0.85
_format_time_axisFunction · 0.85
addLabelsFunction · 0.85
_format_legendFunction · 0.85
_align_labelsFunction · 0.85

Tested by

no test coverage detected