xy_data_plotter
xy_data_plotter ¶
XYDataPlotter ¶
Plots xy data from user-specified directories to a single axis figure
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
in_dirs
|
List[Path]
|
Directories in which to search for data products from JSON files |
required |
out_dir
|
Path
|
directory to which figure will be output |
required |
dpi
|
int
|
Saved image resolution |
500
|
Source code in src/trendify/api/generator/xy_data_plotter.py
handle_points_and_traces
classmethod
¶
handle_points_and_traces(
tag: Tag,
points: List[Point2D],
traces: List[Trace2D],
axlines: List[AxLine],
dir_out: Path,
dpi: int,
saf: SingleAxisFigure | None = None,
)
Plots points, traces, and axlines, formats figure, saves figure, and closes matplotlinb figure.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
tag
|
Tag
|
Tag corresponding to the provided points and traces |
required |
points
|
List[Point2D]
|
Points to be scattered |
required |
traces
|
List[Trace2D]
|
List of traces to be plotted |
required |
axlines
|
List[AxLine]
|
List of axis lines to be plotted |
required |
dir_out
|
Path
|
directory to output the plot |
required |
dpi
|
int
|
resolution of plot |
required |
Source code in src/trendify/api/generator/xy_data_plotter.py
plot ¶
plot(tag: Tag, data_products_fname: str = DATA_PRODUCTS_FNAME_DEFAULT)
- Collects data from json files in stored
self.in_dirs, - plots the relevant products,
- applies labels and formatting,
- saves the figure
- closes matplotlib figure
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
tag
|
Tag
|
data tag for which products are to be collected and plotted. |
required |
data_products_fname
|
str
|
Data products file name |
DATA_PRODUCTS_FNAME_DEFAULT
|