10000 add documentation for quality in savefig by pharshalp · Pull Request #11529 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content

add documentation for quality in savefig #11529

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

Merged
merged 4 commits into from
Jun 28, 2018
Merged

add documentation for quality in savefig #11529

merged 4 commits into from
Jun 28, 2018

Conversation

pharshalp
Copy link
Contributor
@pharshalp pharshalp commented Jun 28, 2018

#458
(if accepted) My first contribution to Matplotlib!!!
based on the discussion here #458
and also using some of the lines from
https://matplotlib.org/api/backend_agg_api.html?highlight=print_jpeg#matplotlib.backends.backend_agg.FigureCanvasAgg.print_jpeg

PR Summary

PR Checklist

  • Has Pytest style unit tests
  • Code is PEP 8 compliant
  • New features are documented, with examples if plot related
  • Documentation is sphinx and numpydoc compliant
  • Added an entry to doc/users/next_whats_new/ if major new feature (follow instructions in README.rst there)
  • Documented in doc/api/api_changes.rst if API changed in a backward-incompatible way

@tacaswell tacaswell added this to the v3.0 milestone Jun 28, 2018
@tacaswell
Copy link
Member

Thanks @pharshalp !

It looks like you have some trailing whitespace

[gw0] linux -- Python 3.6.3 /home/travis/virtualenv/python3.6.3/bin/python
/home/travis/build/matplotlib/matplotlib/lib/matplotlib/figure.py:1814:1: W293 blank line contains whitespace
^
/home/travis/build/matplotlib/matplotlib/lib/matplotlib/figure.py:1821:1: W293 blank line contains whitespace
^

that needs to be addressed.

@@ -1812,6 +1812,13 @@ def savefig(self, fname, *, frameon=None, transparent=None, **kwargs):
The resolution in dots per inch. If *None*, defaults to
:rc:`savefig.dpi`. If 'figure', uses the figure's dpi value.

quality : [ *None* | 95 >= scalar >= 1 ]
Copy link
Contributor

Choose a reason for hiding this comment

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

1 <= scalar <= 95 seems to be the more natural way to do so?
I would also just leave the upper bound be 100 here and have the note about values above 95 below.

Copy link
Contributor Author
@pharshalp pharshalp Jun 28, 2018

Choose a reason for hiding this comment

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

thanks @anntzer. Yep, 1 <= scalar <= 95 does feel more natural. Also changed the upper bound to 100.

@tacaswell tacaswell merged commit 25b736a into matplotlib:master Jun 28, 2018
@tacaswell
Copy link
Member

Thanks @pharshalp and congratulations on your first Matplotlib contribution 🎉

I squash-merged this to remove the stray merge commit. It looks like you created a feature branch (good!) but then merged it into your forks master branch and opened this PR from your master branch. In general it is better to open the PR directly from your feature branch.

@pharshalp
Copy link
Contributor Author

@tacaswell Thanks! will keep that in mind for the future contributions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants
0