Skip to content

Commit 20954e6

Browse files
committed
Only set colors if x_axis_key is string
1 parent 74ceab9 commit 20954e6

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Diff for: src/napari_matplotlib/histogram.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -209,10 +209,12 @@ def draw(self) -> None:
209209
# get the colormap from the layer depending on its type
210210
if isinstance(self.layers[0], napari.layers.Points):
211211
colormap = self.layers[0].face_colormap
212-
self.layers[0].face_color = self.x_axis_key
212+
if self.x_axis_key:
213+
self.layers[0].face_color = self.x_axis_key
213214
elif isinstance(self.layers[0], napari.layers.Vectors):
214215
colormap = self.layers[0].edge_colormap
215-
self.layers[0].edge_color = self.x_axis_key
216+
if self.x_axis_key:
217+
self.layers[0].edge_color = self.x_axis_key
216218
else:
217219
colormap = None
218220

0 commit comments

Comments
 (0)