Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

automatically get the current axes instance #1452

Merged
merged 5 commits into from
Dec 8, 2020
Merged

automatically get the current axes instance #1452

merged 5 commits into from
Dec 8, 2020

Conversation

aloctavodia
Copy link
Contributor

@aloctavodia aloctavodia commented Nov 27, 2020

  • Follows official PR format
  • Includes a sample plot to visually illustrate the changes (only for plot-related functions)
  • Includes new or updated tests to cover the new feature
  • Code style correct (follows pylint and black guidelines)
  • Changes are listed in changelog

This recover the old behavior, allowing to do this, without the need to explicitly need to pass the axes

a= np.random.normal(0, 1, 100)
b= np.random.normal(0, 1, 100)
az.plot_kde(a)
az.plot_kde(b)

test

@codecov
Copy link

codecov bot commented Nov 27, 2020

Codecov Report

Merging #1452 (6718341) into master (d529c8b) will decrease coverage by 0.00%.
The diff coverage is 93.33%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1452      +/-   ##
==========================================
- Coverage   91.94%   91.93%   -0.01%     
==========================================
  Files         105      105              
  Lines       11216    11228      +12     
==========================================
+ Hits        10312    10323      +11     
- Misses        904      905       +1     
Impacted Files Coverage Δ
arviz/plots/backends/matplotlib/hdiplot.py 92.59% <80.00%> (-3.06%) ⬇️
arviz/plots/backends/matplotlib/distplot.py 95.45% <100.00%> (+0.29%) ⬆️
arviz/plots/backends/matplotlib/kdeplot.py 98.80% <100.00%> (+0.05%) ⬆️
arviz/data/datasets.py 98.38% <0.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d529c8b...6718341. Read the comment docs.

@ahartikainen
Copy link
Contributor

This will get only 1 axis?

Should this go inside create axis grid with some keyword flag?

Can this access also figure -> axes?

@aloctavodia
Copy link
Contributor Author

This will get only one axis but that's the case when you do something like

az.plot_kde(a)
az.plot_kde(b)

For more complex stuff you will need to pass the axes as usual, as is the case for the rest of our plots.

@aloctavodia aloctavodia merged commit d67c252 into master Dec 8, 2020
@aloctavodia aloctavodia deleted the gca branch December 8, 2020 11:06
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