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 the Performance Check (PC) method, see
sunpeek/core_methods/pc_method
.
Similar plots are generated for the D-CAT methods, see sunpeek/core_methods/dcat
(Note: D-CAT methods currently under development).
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://stackoverflow.com/questions/63659519/plotting-text-using-textarea-and-annotationbbox-in-matplotlib - https://matplotlib.org/stable/gallery/ticks/date_concise_formatter.html - https://matplotlib.org/stable/api/ticker_api.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. |
|
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. |
|
Update plot parameters, depending on plot target. |
|
Pretty-print a timezone-aware datetime to e.g. '2017-05-25 10:31 (UTC+1)'. |
Classes
|
|
|
|
|
|
|
Settings for PC Method plots & pdf report generation. |
|
|
|