Skip to content

Fix array inputs and truth lines for one-dimensional plots - #346

Open
mikamikasuki wants to merge 1 commit into
dfm:mainfrom
mikamikasuki:fix-one-dimensional-plots
Open

mikamikasuki wants to merge 1 commit into
dfm:mainfrom
mikamikasuki:fix-one-dimensional-plots

Conversation

@mikamikasuki

Copy link
Copy Markdown

One-dimensional plots currently fail in two supported paths: flat NumPy samples are indexed with three dimensions in the ArviZ adapter, and truths or overplot_lines tries to index a scalar Axes as an array.

Reshape flat samples to (1, n_samples, 1) and normalize the axes array locally in overplot_lines. Add 16 regressions covering flat and column samples, reversed plots, omitted lines, line styling, truths, and caller-provided figures.

Validation: all 16 regressions and pre-commit hooks pass. Independent comparisons preserve the line artists for 12 multidimensional cases and match flat, column, and three-dimensional input representations in 8 one-dimensional cases. The full suite has the same 29 image-comparison failures on the base and patched commits in this macOS environment (Matplotlib 3.11.2); the remaining results improve from 35 passed / 1 skipped to 51 passed / 1 skipped.

Fixes #300.
Fixes #285.

Prepared with AI assistance.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

overplot_lines fails when the dataset is one-dimensional Error when specifying truths for 1-D data

1 participant