skill.SkillArrayPlotter
skill.SkillArrayPlotter(self, skillarray)
SkillArrayPlotter object for visualization of a single metric (SkillArray)
- plot.line() : line plot
- plot.bar() : bar chart
- plot.barh() : horizontal bar chart
- plot.grid() : colored grid
Methods
bar |
Plot statistic as bar chart using pd.DataFrame.plot.bar() |
barh |
Plot statistic as horizontal bar chart using pd.DataFrame.plot.barh() |
grid |
Plot statistic as a colored grid, optionally with values in the cells. |
line |
Plot statistic as a lines using pd.DataFrame.plot.line() |
bar
skill.SkillArrayPlotter.bar(level=0, **kwargs)
Plot statistic as bar chart using pd.DataFrame.plot.bar()
Parameters
level |
int or str |
level to unstack, by default 0 |
0 |
**kwargs |
Any |
key word arguments to be pased to pd.DataFrame.plot.bar() e.g. color, title, figsize, … |
{} |
Examples
>>> sk = cc.skill()["rmse"]
>>> sk.plot.bar()
>>> sk.plot.bar(level="observation")
>>> sk.plot.bar(title="Root Mean Squared Error")
>>> sk.plot.bar(color=["red","blue"])
barh
skill.SkillArrayPlotter.barh(level=0, **kwargs)
Plot statistic as horizontal bar chart using pd.DataFrame.plot.barh()
Parameters
level |
int or str |
level to unstack, by default 0 |
0 |
**kwargs |
Any |
key word arguments to be passed to pd.DataFrame.plot.barh() e.g. color, title, figsize, … |
{} |
Examples
>>> sk = cc.skill()["rmse"]
>>> sk.plot.barh()
>>> sk.plot.barh(level="observation")
>>> sk.plot.barh(title="Root Mean Squared Error")
grid
skill.SkillArrayPlotter.grid(
show_numbers=True,
precision=3,
fmt=None,
ax=None,
figsize=None,
title=None,
cmap=None,
)
Plot statistic as a colored grid, optionally with values in the cells.
Primarily for MultiIndex skill objects, e.g. multiple models and multiple observations
Parameters
show_numbers |
bool |
should values of the static be shown in the cells?, by default True if False, a colorbar will be displayed instead |
True |
precision |
int |
number of decimals if show_numbers, by default 3 |
3 |
fmt |
str |
format string, e.g. “.0%” to show value as percentage |
None |
ax |
Axes |
matplotlib axes, by default None |
None |
figsize |
Tuple(float, float) |
figure size, by default None |
None |
title |
str |
plot title, by default name of statistic |
None |
cmap |
str |
colormap, by default “OrRd” (“coolwarm” if bias) |
None |
Examples
>>> sk = cc.skill()["rmse"]
>>> sk.plot.grid()
>>> sk.plot.grid(show_numbers=False, cmap="magma")
>>> sk.plot.grid(precision=1)
>>> sk.plot.grid(fmt=".0%", title="Root Mean Squared Error")
line
skill.SkillArrayPlotter.line(level=0, **kwargs)
Plot statistic as a lines using pd.DataFrame.plot.line()
Primarily for MultiIndex skill objects, e.g. multiple models and multiple observations
Parameters
level |
int or str |
level to unstack, by default 0 |
0 |
**kwargs |
Any |
key word arguments to be pased to pd.DataFrame.plot.line() e.g. marker, title, figsize, … |
{} |
Examples
>>> sk = cc.skill()["rmse"]
>>> sk.plot.line()
>>> sk.plot.line(marker="o", linestyle=':')
>>> sk.plot.line(color=['0.2', '0.4', '0.6'])