Skip to content

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 Job instances to plot.

TYPE: list[Job] DEFAULT: ()

title

...

TYPE: str | None DEFAULT: None

color_by

...

TYPE: PlotColorBy DEFAULT: QID

facet_by

...

TYPE: PlotFacetBy DEFAULT: QID

facet_scale

...

TYPE: PlotFacetScale DEFAULT: FIXED

theme

...

TYPE: PlotTheme DEFAULT: BW

no_legend

...

TYPE: bool DEFAULT: False

bar_width

...

TYPE: int DEFAULT: 1

color_pal

a sequence of colors used to color each group of color_by.

TYPE: list[str] | None DEFAULT: None

RETURNS DESCRIPTION
ggplot

...

Examples:

>>> from ppqueue import Queue
>>> from ppqueue.plot import plot_jobs
>>> from time import sleep
...
>>> with Queue() as queue:
...     q1_jobs = queue.map(sleep, [1, 2, 3, 4, 5])
...
>>> with Queue() 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']
... )
...
>>> print(plot)