Skip to content

Plot pdf of discrete univariate distributions in documentation - #2094

Merged
devmotion merged 2 commits into
JuliaStats:masterfrom
arnaud-ma:doc-plot-discrete-dist
Sep 22, 2026
Merged

devmotion merged 2 commits into
JuliaStats:masterfrom
arnaud-ma:doc-plot-discrete-dist

Conversation

@arnaud-ma

Copy link
Copy Markdown
Contributor

The plots were already in place for continuous distributions but not for discrete ones.

I simply replaced plot with stem, the xlabel and the ylabel.

I also tried to select examples that highlight the characteristics of each (asymmetry, etc.).

@codecov

codecov Bot commented Sep 19, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.76%. Comparing base (050e0f9) to head (d6092ae).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #2094   +/-   ##
=======================================
  Coverage   86.76%   86.76%           
=======================================
  Files         149      149           
  Lines        8888     8888           
=======================================
  Hits         7712     7712           
  Misses       1176     1176           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@devmotion

Copy link
Copy Markdown
Member

Can you show how it looks? Previews are not deployed for PRs from forks.

@arnaud-ma

Copy link
Copy Markdown
Contributor Author

Yes, here: https://arnaud-ma.github.io/Distributions.jl/dev/univariate/#Discrete-Distributions

Comment thread docs/src/univariate.md Outdated
Comment thread docs/src/univariate.md
dist::ContinuousUnivariateDistribution;
npoints=299,
title="",
linewidth=2.0, # thick lines

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Make this a common option in _plotdensity above?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

linewidth argument is not doing anything on GR.stem. I don't really know why, the documentation of GR is quite obscure (https://gr-framework.org/julia-jlgr.html).

So I guess linewidth only makes sense when it is a line plot, so only for continuous distributions.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Hmm, but clearly the lines of the stem plot are thinner.

Co-authored-by: David Müller-Widmann <devmotion@users.noreply.github.com>
@devmotion
devmotion enabled auto-merge (squash) September 22, 2026 14:43
@devmotion
devmotion merged commit aa53c31 into JuliaStats:master Sep 22, 2026
13 checks passed
@arnaud-ma
arnaud-ma deleted the doc-plot-discrete-dist branch September 22, 2026 18:31
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