ppqueue.plot¶
Classes¶
PlotColorBy ¶
Enum used to define color groups using this job property.
PlotFacetBy ¶
Enum used to facet the plot by this job property.
PlotTheme ¶
Enum used to expose supported plot themes.
Functions¶
plot_jobs ¶
plot_jobs(
*args: list[Job],
title: str | None = None,
color_by: PlotColorBy = PlotColorBy.QID,
facet_by: PlotFacetBy = PlotFacetBy.QID,
facet_scale: PlotFacetScale = PlotFacetScale.FIXED,
theme: PlotTheme = PlotTheme.BW,
no_legend: bool = False,
bar_width: int = 1,
color_pal: list[str] | None = None
) -> gg.ggplot
PARAMETER | DESCRIPTION |
---|---|
*args
|
Sequences of
TYPE:
|
title
|
...
TYPE:
|
color_by
|
...
TYPE:
|
facet_by
|
...
TYPE:
|
facet_scale
|
...
TYPE:
|
theme
|
...
TYPE:
|
no_legend
|
...
TYPE:
|
bar_width
|
...
TYPE:
|
color_pal
|
a sequence of colors used to color each group of
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
ggplot
|
... |
Examples:
from ppqueue import PPQueue
from ppqueue.plot import plot_jobs, PlotColorBy, PlotFacetBy, PlotTheme
from time import sleep
with PPQueue() as queue:
q1_jobs = queue.map(sleep, [1, 2, 3, 4, 5])
with PPQueue() as queue:
q2_jobs = queue.map(sleep, [1, 2, 3, 4, 5])
plot = plot_jobs(
q1_jobs,
q2_jobs,
title="Demo",
color_by=PlotColorBy.QID,
facet_by=PlotFacetBy.QID,
theme=PlotTheme.DARK,
bar_width=2,
color_pal=["red", "blue"],
)
# plot.show()