Plotting
Module containing the plotting functions for the ds class.
Styler
dataclass
A class for storing plotting styles for a dataset.
Source code in paramaterial\plotting.py
44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 | |
curve_formatters(di)
Return the curve formatters for the dataitem curve.
Source code in paramaterial\plotting.py
legend_handles(ds=None)
Return the legend handles for the dataset plot.
Source code in paramaterial\plotting.py
style_to(ds)
Format the styles to match the dataset.
Source code in paramaterial\plotting.py
dataset_plot(ds, styler=None, ax=None, fill_between=None, plot_legend=True, handletextpad=0.05, labelspacing=0.1, **kwargs)
Make a single combined plot from the data of every dataitem in the dataset using pandas.DataFrame.plot.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
ds |
DataSet
|
The dataset to plot. |
required |
styler |
Optional[Styler]
|
The styler to use for the plot. |
None
|
ax |
Optional[plt.Axes]
|
The axis to plot on. |
None
|
fill_between |
Optional[Tuple[str, str]]
|
A tuple of the two columns in the data to fill between. |
None
|
plot_legend |
bool
|
Whether to plot the legend. |
True
|
**kwargs |
Additional keyword arguments to pass to the pandas.DataFrame.plot function. |
{}
|
Source code in paramaterial\plotting.py
dataset_subplots(ds, shape, rows_by, cols_by, row_vals, col_vals, styler=None, axs=None, figsize=(9, 6), sharex='col', sharey='row', wspace=0.05, hspace=0.05, row_titles=None, col_titles=None, plot_titles=None, subplot_legend=True, subplot_cbar=False, subplots_adjust=0.0, **kwargs)
Plot a dataset as a grid of subplots, split by the 'rows_by' and 'cols_by' columns in the info_table.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
ds |
DataSet
|
The dataset to plot. |
required |
shape |
Tuple[int, int]
|
The shape of the grid of subplots. |
required |
rows_by |
str
|
The column in the info_table to split the rows by. |
required |
cols_by |
str
|
The column in the info_table to split the columns by. |
required |
row_vals |
List[List[Any]]
|
The values of the rows to plot. |
required |
col_vals |
List[List[Any]]
|
The values of the columns to plot. |
required |
styler |
Optional[Styler]
|
The styler to use for the plot. |
None
|
axs |
Optional[np.ndarray]
|
The axes to plot on. |
None
|
figsize |
Tuple[float, float]
|
The size of the figure. |
(9, 6)
|
sharex |
str
|
Whether to share the x axis between subplots. |
'col'
|
sharey |
str
|
Whether to share the y axis between subplots. |
'row'
|
wspace |
float
|
The width space between subplots. |
0.05
|
hspace |
float
|
The height space between subplots. |
0.05
|
row_titles |
Optional[List[str]]
|
The titles of the rows. |
None
|
col_titles |
Optional[List[str]]
|
The titles of the columns. |
None
|
plot_titles |
Optional[List[str]]
|
The titles of the subplots. |
None
|
subplot_legend |
bool
|
Whether to plot the legend in each subplot. |
True
|
subplot_cbar |
bool
|
Whether to plot the colorbar in each subplot. |
False
|
**kwargs |
Additional keyword arguments to pass to the pandas.DataFrame.plot function. |
{}
|
Source code in paramaterial\plotting.py
234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 | |
info_plot(ds, x, y, styler=None, ax=None, plot_legend=True, err_between=None, **kwargs)
Make a single combined plot from the info of every dataitem in the dataset using pandas.DataFrame.plot.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
ds |
DataSet
|
The dataset to plot. |
required |
x |
str
|
The column to plot on the x-axis. |
required |
y |
str
|
The column to plot on the y-axis. |
required |
styler |
Optional[Styler]
|
The styler to use for the plot. |
None
|
ax |
Optional[plt.Axes]
|
The axis to plot on. |
None
|
plot_legend |
bool
|
Whether to plot the legend. |
True
|
**kwargs |
Additional keyword arguments to pass to the pandas.DataFrame.plot function. |
{}
|
Source code in paramaterial\plotting.py
subplot_wrapper(ds, plot_func, shape, rows_by, cols_by, row_vals, col_vals, axs=None, figsize=(12, 8), sharex='col', sharey='row', wspace=0.1, hspace=0.1, row_titles=None, col_titles=None, plot_titles=None, **kwargs)
Plot a dataset using the given plot function as a grid of subplots, split by the 'rows_by' and 'cols_by' columns in the info_table.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
ds |
DataSet
|
The dataset to plot. |
required |
plot_func |
Callable[[DataItem, plt.axes], DataItem]
|
The function to use to plot each subplot. |
required |
shape |
Tuple[int, int]
|
The shape of the grid of subplots. |
required |
rows_by |
str
|
The column in the info_table to split the rows by. |
required |
cols_by |
str
|
The column in the info_table to split the columns by. |
required |
row_vals |
List[List[Any]]
|
The values of the rows to plot. |
required |
col_vals |
List[List[Any]]
|
The values of the columns to plot. |
required |
axs |
Optional[np.ndarray]
|
The axes to plot on. |
None
|
figsize |
Tuple[float, float]
|
The size of the figure. |
(12, 8)
|
sharex |
str
|
Whether to share the x axis between subplots. |
'col'
|
sharey |
str
|
Whether to share the y axis between subplots. |
'row'
|
wspace |
float
|
The width space between subplots. |
0.1
|
hspace |
float
|
The height space between subplots. |
0.1
|
row_titles |
Optional[List[str]]
|
The titles of the rows. |
None
|
col_titles |
Optional[List[str]]
|
The titles of the columns. |
None
|
plot_titles |
Optional[List[str]]
|
The titles of the subplots. |
None
|
**kwargs |
Additional keyword arguments to pass to the plot function. |
{}
|
Source code in paramaterial\plotting.py
396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 | |