Skip to content

Commit

Permalink
[vis] Fix error bar colors
Browse files Browse the repository at this point in the history
  • Loading branch information
holl- committed Jan 5, 2024
1 parent 6dd13b5 commit ec61ff2
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion phi/vis/_matplotlib/_matplotlib_plots.py
Original file line number Diff line number Diff line change
Expand Up @@ -584,7 +584,11 @@ def _plot_points(axis: Axes, data: Field, dims: tuple, vector: Shape, color: Ten
if (err != 0).any:
x_err = reshaped_numpy(err.vector[dims[0]], [instance(data)]) if dims[0] in err.vector.item_names else 0
y_err = reshaped_numpy(err.vector[dims[1]], [instance(data)]) if dims[1] in err.vector.item_names else 0
axis.errorbar(x, y, y_err, x_err, fmt=' ')
if all(c == mpl_colors[0] for c in mpl_colors) and all(a == alphas[0] for a in alphas):
axis.errorbar(x, y, y_err, x_err, fmt=' ', color=mpl_colors[0], alpha=alphas[0])
else:
for x_, y_, y_err_, x_err_, col_, alpha_ in zip(x, y, y_err, x_err, mpl_colors, alphas):
axis.errorbar(x_, y_, y_err_, x_err_, fmt=' ', color=col_, alpha=alpha_)
else:
if isinstance(data.geometry, Sphere):
rad = reshaped_numpy(data.geometry.bounding_radius(), [data.shape.non_channel])
Expand Down

0 comments on commit ec61ff2

Please sign in to comment.