Skip to content

Plots of continuous distributions#2463

Merged
twiecki merged 4 commits intopymc-devs:masterfrom
aasensio:master
Aug 1, 2017
Merged

Plots of continuous distributions#2463
twiecki merged 4 commits intopymc-devs:masterfrom
aasensio:master

Conversation

@aasensio
Copy link
Contributor

@aasensio aasensio commented Aug 1, 2017

This is a simple PR to add plots of continuous distributions in the documentation. This is something that I miss sometimes and I end up going to the Wikipedia for that. I think it's good to have it in the documentation.

@junpenglao
Copy link
Member

This is a nice idea - but a rst page in the doc might be better than in the docstring?

@twiecki
Copy link
Member

twiecki commented Aug 1, 2017

That's very cool. I think it makes sense to have this in the docs.

a, b = 0.0, 2.0
y = np.zeros(1000)
y[(x<b) & (x>a)] = 1.0/(b-a)
plt.plot(x, y, label='lower=1, upper=2')
Copy link
Member

Choose a reason for hiding this comment

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

if we moved to fig, ax = plt.subplots(); ax.plot()... we could save a few lines with ax.set(ylim=..., xlabel=...)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done. Makes sense.

@twiecki
Copy link
Member

twiecki commented Aug 1, 2017

do you have it run locally and if so can you post a screen-shot of what the rendered result looks like?

@aasensio
Copy link
Contributor Author

aasensio commented Aug 1, 2017

Here you have a couple of screenshots. I guess the results depends on the version of matplotlib used for the docs, that I guess they are done automatically with Travis, right?

screen shot 2017-08-01 at 21 07 10

screen shot 2017-08-01 at 21 07 24

@twiecki
Copy link
Member

twiecki commented Aug 1, 2017

I love it!

@twiecki twiecki merged commit 43c7778 into pymc-devs:master Aug 1, 2017
@AustinRochford
Copy link
Member

This is awesome!

@fonnesbeck
Copy link
Member

This is better than most textbooks. Thanks for the contribution.

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.

5 participants