Skip to content

Commit 3fbc0c7

Browse files
jayzhou2309claude
andcommitted
test: px.imshow aspect='auto' removes the image-trace scaleanchor default
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent 9447f1c commit 3fbc0c7

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

‎tests/test_optional/test_px/test_imshow.py‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -414,6 +414,15 @@ def test_imshow_hovertemplate(binary_string):
414414
)
415415

416416

417+
@pytest.mark.parametrize("binary_string", [False, True])
418+
def test_image_trace_aspect(binary_string):
419+
img = np.zeros((2, 10, 10, 3), dtype=np.uint8)
420+
fig = px.imshow(img, facet_col=0, aspect="auto", binary_string=binary_string)
421+
assert [ax.scaleanchor for ax in fig.select_yaxes()] == [False, False]
422+
fig = px.imshow(img, facet_col=0, binary_string=binary_string)
423+
assert [ax.scaleanchor for ax in fig.select_yaxes()] == [None, None]
424+
425+
417426
@pytest.mark.parametrize("facet_col", [0, 1, 2, -1])
418427
@pytest.mark.parametrize("binary_string", [False, True])
419428
def test_facet_col(facet_col, binary_string):

0 commit comments

Comments
 (0)