Skip to content
Merged
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
4 changes: 3 additions & 1 deletion lib/matplotlib/tests/test_colorbar.py
Original file line number Diff line number Diff line change
Expand Up @@ -631,7 +631,9 @@ def test_colorbar_format(fmt):
assert cbar.ax.yaxis.get_ticklabels()[4].get_text() == '2.00e+02'

# but if we change the norm:
im.set_norm(LogNorm(vmin=0.1, vmax=10))
# when we require numpy >= 2, vmin can be 0.1, but at numpy 1.x this is
# sensitive to floating point errors
im.set_norm(LogNorm(vmin=0.09999, vmax=10))
fig.canvas.draw()
assert (cbar.ax.yaxis.get_ticklabels()[0].get_text() ==
'$\\mathdefault{10^{-2}}$')
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume this is the assertion that fails, and the first tick is 10^{-1} instead of 10^{-2}. The first visible tick is 10^{-1}, so the test is a bit goofy. This basically boils down to our undetermined zeroth tick issue.

I guess this fix is fine here, as we are not testing the ticking, but rather the formatting.,

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes exactly. Sorry, I should have pasted or directly linked the error.

Expand Down
Loading