Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions docs/changes/newsfragments/8388.improved
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
The ``colorbars`` argument of :func:`.plot_dataset` and :func:`.plot_by_id` now
accepts a sequence that may contain ``None``. Both functions return a list of
colorbars in which the entries for 1D plots are ``None``, so passing the result
back in, which is how you plot into the same axes again, did not match the
declared argument type. A sequence of colorbars is still accepted.
7 changes: 5 additions & 2 deletions src/qcodes/dataset/plotting.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,10 @@ def heatmaphandler(**kwargs: Any) -> Any:
def plot_dataset(
dataset: DataSetProtocol,
axes: Axes | Sequence[Axes] | None = None,
colorbars: Colorbar | Sequence[Colorbar] | Sequence[None] | None = None,
# ``Sequence[Colorbar | None]`` so that the list of colorbars returned by
# this function can be passed straight back in, which is how you plot into
# the same axes again. A ``Sequence[Colorbar]`` is also one of these.
colorbars: Colorbar | Sequence[Colorbar | None] | None = None,
rescale_axes: bool = True,
auto_color_scale: bool | None = None,
cutoff_percentile: tuple[float, float] | float | None = None,
Expand Down Expand Up @@ -417,7 +420,7 @@ def plot_and_save_image(
def plot_by_id(
run_id: int,
axes: Axes | Sequence[Axes] | None = None,
colorbars: Colorbar | Sequence[Colorbar] | None = None,
colorbars: Colorbar | Sequence[Colorbar | None] | None = None,
rescale_axes: bool = True,
auto_color_scale: bool | None = None,
cutoff_percentile: tuple[float, float] | float | None = None,
Expand Down
Loading