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

Parameters:

Name Type Description Default
*args list[Job]

Sequences of Job instances to plot.

()
title str | None

...

None
color_by PlotColorBy

...

QID
facet_by PlotFacetBy

...

QID
facet_scale PlotFacetScale

...

FIXED
theme PlotTheme

...

BW
no_legend bool

...

False
bar_width int

...

1
color_pal list[str] | None

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

None

Returns:

Type 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)