Add ps.no_spines() for imshow/pcolormesh/2D-histogram plots
Image- and bin-indexed plots have no meaningful x baseline, so the themed bottom spine kept by use() doesn't apply to them. Adds an explicit opt-in to disable all spines on such Axes, documents it in plotstyle/CLAUDE.md, and updates the showcase notebook's colormap and multi-panel examples to use it. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -210,6 +210,26 @@ def test_colorbar_has_no_outline():
|
||||
plt.close(fig)
|
||||
|
||||
|
||||
def test_no_spines_hides_all_spines_on_single_axes():
|
||||
fig, ax = ps.new_figure("square")
|
||||
try:
|
||||
ax.imshow([[0, 1], [2, 3]])
|
||||
ps.no_spines(ax)
|
||||
assert all(not spine.get_visible() for spine in ax.spines.values())
|
||||
finally:
|
||||
plt.close(fig)
|
||||
|
||||
|
||||
def test_no_spines_hides_all_spines_on_axes_array():
|
||||
fig, axes = ps.new_figure("square", nrows=1, ncols=2)
|
||||
try:
|
||||
ps.no_spines(axes)
|
||||
for ax in axes:
|
||||
assert all(not spine.get_visible() for spine in ax.spines.values())
|
||||
finally:
|
||||
plt.close(fig)
|
||||
|
||||
|
||||
def test_savefig_writes_requested_formats(tmp_path):
|
||||
fig, ax = ps.new_figure("square")
|
||||
ax.plot([0, 1], [0, 1])
|
||||
|
||||
Reference in New Issue
Block a user