Skip to content

Commit

Permalink
chore: fix typing issues
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesclark-Zapata committed Oct 19, 2023
1 parent 7888b0b commit 31a6dc3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/orqviz/plot_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import matplotlib.pyplot as plt
import matplotlib.ticker as tck
import numpy as np
from matplotlib.cm import ScalarMappable


def normalize_color_and_colorbar(
Expand Down Expand Up @@ -40,9 +41,11 @@ def normalize_color_and_colorbar(
"Provided ax does not contain an image in ax.images or ax.collections"
) from e

image.colorbar.remove()
image.set_clim(vmin=min_val, vmax=max_val)
image.set_cmap(cmap)
assert isinstance(image, ScalarMappable)
if image.colorbar is not None:
image.colorbar.remove()
image.set_clim(vmin=min_val, vmax=max_val) # type: ignore
image.set_cmap(cmap) # type: ignore
fig.colorbar(image, ax=ax)


Expand Down
2 changes: 2 additions & 0 deletions src/orqviz/scans/plots.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,8 @@ def plot_2D_scan_result_as_3D(
"""
ax = _check_and_create_3D_ax(ax=ax)

assert ax is not None

x, y = scan2D_result._get_coordinates_on_directions(
in_units_of_direction=in_units_of_direction
)
Expand Down

0 comments on commit 31a6dc3

Please sign in to comment.