Skip to content

Incorrect Prior Color for diagonal subplots in diagnotics.pairs_posterior() on dev branch #368

@thegialeo

Description

@thegialeo

Description

The function diagnostics.pairs_posterior() does not correctly distinguish the prior distribution color from the posterior color in the diagonal subplots. The expected behavior is that the prior and posterior should have distinct colors, as seen in the off-diagonal subplots.

Is this intended behavior? If not, I can make a PR for a temporary fix.

Branch & Commit

  • Branch: dev
  • Commit Hash: 97c381da61402cfc1a064355a60ae1309ff2d702

Expected vs. Actual Behavior

  • Expected: Prior and posterior distributions should have distinct colors on all subplots.
  • Actual: Prior color matches posterior color in diagonal subplots, making them indistinguishable.

Minimal Code for Reproduction

import numpy as np
import bayesflow as bf

dummy_prior = np.random.multivariate_normal([0, 0], np.eye(2), size=100)
dummy_posterior = np.random.multivariate_normal([0, 0], 0.1 * np.eye(2), size=100)

fig = bf.diagnostics.plots.pairs_posterior(
    estimates=dummy_posterior,
    priors=dummy_prior,
)

fig.savefig("test_plots.png")

Output: test_plots.png

Image

System Info

  • Python version: 3.11.11
  • BayesFlow version: latest dev branch
  • OS: Ubuntu 24.04

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions