Skip to content

Remove unnecessary y-axis from MCMC density and histogram plots#420

Closed
LokeshShukla910 wants to merge 1 commit intostan-dev:masterfrom
LokeshShukla910:patch-1
Closed

Remove unnecessary y-axis from MCMC density and histogram plots#420
LokeshShukla910 wants to merge 1 commit intostan-dev:masterfrom
LokeshShukla910:patch-1

Conversation

@LokeshShukla910
Copy link

  • Removed the y-axis text, title, and ticks from mcmc_dens(), mcmc_dens_overlay(), and mcmc_hist() plots, as the y-axis does not provide useful information for these visualizations.
  • Updated the internal .mcmc_hist() and .mcmc_dens() functions to consistently suppress the y-axis for single and multi-parameter plots.
  • This change improves plot aesthetics and consistency with mcmc_dots(), making the plots cleaner and easier to interpret.

- Removed the y-axis text, title, and ticks from mcmc_dens(), mcmc_dens_overlay(), and mcmc_hist() plots, as the y-axis does not provide useful information for these visualizations.
- Updated the internal .mcmc_hist() and .mcmc_dens() functions to consistently suppress the y-axis for single and multi-parameter plots.
- This change improves plot aesthetics and consistency with mcmc_dots(), making the plots cleaner and easier to interpret.
@jgabry
Copy link
Member

jgabry commented Feb 7, 2026

Hi, thank you for your interest in submitting a PR. Have you verified that the changes to the code work as intended?

Removed the y-axis text, title, and ticks from mcmc_dens(), mcmc_dens_overlay(), and mcmc_hist() plots, as the y-axis does not provide useful information for these visualizations.

These were already removed (see my review comments). What issue #418 is about is removing the axis line itself.

Updated the internal .mcmc_hist() and .mcmc_dens() functions to consistently suppress the y-axis for single and multi-parameter plots.

These changes don't suppress the y-axis. They turn off text and tick marks, but those were already disabled.

bayesplot_theme_get() +
yaxis_text(FALSE) +
yaxis_ticks(FALSE) +
yaxis_title(on = n_param == 1 && violin) +
Copy link
Member

Choose a reason for hiding this comment

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

We need to keep this for the special case of 1 parameter and a violin plot. If you look at a 1 parameter violin plot you'll see why (the y-axis provides the parameter name)

Comment on lines +250 to +252
yaxis_text(FALSE) +
yaxis_title(FALSE) +
yaxis_ticks(FALSE)
Copy link
Member

Choose a reason for hiding this comment

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

These are already included in the internal .mcmc_dens() function so we don't need to add them again here. These don't turn off the y-axis, they just turn off the text and tick marks, but those were already off.

Comment on lines +179 to +182
) +
yaxis_text(FALSE) +
yaxis_title(FALSE) +
yaxis_ticks(FALSE)
Copy link
Member

Choose a reason for hiding this comment

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

These are already included in the internal .mcmc_dens() function so we don't need to add them again here. These don't turn off the y-axis, they just turn off the text and tick marks, but those were already off.

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.

2 participants