sunpeek.common.plot_utils#
This module is intended to hold some plot-related utilities that are used in the SunPeek Python package.
Plotting is primarily used to generate visual results for a Power Check analysis, see
sunpeek/core_methods/power_check.
Similar plots are generated for the D-CAT methods, see sunpeek/core_methods/dcat.
The goal is to have common settings for matplotlib based plot creation (like colorblind-friendly colors etc.),
and a common interface to plot methods (see PlotResult etc.).
Some helpful matplotlib-related resources: - https://matplotlib.org/stable/gallery/text_labels_and_annotations/demo_annotation_box.html - https://matplotlib.org/stable/tutorials/intermediate/legend_guide.html - https://matplotlib.org/stable/tutorials/advanced/transforms_tutorial.html - packing text (HPacker, VPacker):
https://matplotlib.org/stable/gallery/ticks/date_concise_formatter.html
Customize matplotlib rc params: https://matplotlib.org/stable/tutorials/introductory/customizing.html
matplotlib mathtext: https://matplotlib.org/stable/tutorials/text/mathtext.html
Functions
|
Create matplotlib table using only standard components (text, plot etc.). |
|
Returns a normal AnnotationBbox. |
|
Replace empty values with 'N/A', and sensitive information with '<anonymized>' string. |
|
Create default title text box used on most pages. |
|
Combine matplotlib figures into a pdf report and save file to disk. |
|
Arrange dictionary keys and values aligned in tabular format. |
|
Return string that is valid as a filename from given string s. |
|
Create & return Path to store figure. |
|
Load image from given relative path. |
|
Like get_xy_below(), but returns rectangle (left, bottom, width, height) as required by fig.add_axes(). |
|
Given some artist, get the vertical position where the "next lower" element can be drawn, in figure fraction. |
|
Transform an offset value in points to data coordinates. |
|
Transform a value in points to figure fraction coordinates in y direction. |
|
Create default matplotlib figure in given dimensions, set backend, update rcParams, add footer. |
|
Add footer string and SunPeek small logo at bottom right of fig page. |
|
Add page number at top right of fig page. |
|
Return string or formatted Quantity, if argument not empty, else return the default NA string. |
|
Update plot parameters, depending on plot target. |
|
Pretty-print a timezone-aware datetime to e.g. '2017-05-25 10:31 (UTC+1)'. |
Classes
alias of |
|
alias of |
|
alias of |
|
|
|
|
Settings for Power Check plots & pdf report generation. |
|
|
alias of |
|
|