Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Set sticky_edges correctly for negative height bar(). #7995

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 2 commits into from
Feb 22, 2017

Conversation

anntzer
Copy link
Contributor

@anntzer anntzer commented Jan 30, 2017

The patch correctly sets the sticky edge to 0 instead of -1 for
bar(0, height=-1).

Noticed the issue the plots in #7994 (comment).

@anntzer anntzer force-pushed the negative-height-bar branch from 00165eb to f7554ba Compare January 30, 2017 22:33
@tacaswell tacaswell added this to the 2.1 (next point release) milestone Jan 31, 2017
@tacaswell
Copy link
Member

As we have some very clever users, I am concerned that this will catch someone.

👍 modulo adding an API change note.

@anntzer
Copy link
Contributor Author

anntzer commented Jan 31, 2017

What exactly do you want in the API notes? "The rectangles patches returned by bar() now have heights and widths matching the input, even if they are negative."?

@tacaswell
Copy link
Member

@anntzer Yes

@anntzer anntzer force-pushed the negative-height-bar branch from f7554ba to 29a7d16 Compare January 31, 2017 05:54
@anntzer
Copy link
Contributor Author

anntzer commented Jan 31, 2017

done

@tacaswell tacaswell modified the milestones: 2.0.1 (next bug fix release), 2.1 (next point release) Feb 16, 2017
@tacaswell tacaswell added the Release critical For bugs that make the library unusable (segfaults, incorrect plots, etc) and major regressions. label Feb 16, 2017
@tacaswell
Copy link
Member

Changed my mind, this should be fixed for 2.0.1 . I can be talked back to targetting this for 2.1 with out too much effort.

The patch correctly sets the sticky edge to 0 instead of -1 for
 `bar(0, height=-1)`.
@anntzer anntzer force-pushed the negative-height-bar branch from 29a7d16 to da7564d Compare February 16, 2017 06:22
@NelleV NelleV self-assigned this Feb 16, 2017
@NelleV
Copy link
Member

NelleV commented Feb 16, 2017

If we can convince you to target 2.1, maybe it shouldn't be tagged release critical? 👿
(note how I am going for the middle ground here…)

NelleV
NelleV previously approved these changes Feb 17, 2017
Copy link
Member

@NelleV NelleV left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@NelleV NelleV changed the title Set sticky_edges correctly for negative height bar(). [MRG+1] Set sticky_edges correctly for negative height bar(). Feb 17, 2017
@tacaswell
Copy link
Member

This test came in via 96d2376 / #4196

Someone should check that negative widths correctly right align.

@NelleV
Copy link
Member

NelleV commented Feb 17, 2017

oh wow… I am tired enough that I thought @anntzer had added that test and not remove it…

I'll stop reviewing for tonight…

@NelleV NelleV dismissed their stale review February 17, 2017 04:06

lack of caffein in my system is making me approve pull request that remove tests and add none…

@NelleV NelleV changed the title [MRG+1] Set sticky_edges correctly for negative height bar(). Set sticky_edges correctly for negative height bar(). Feb 17, 2017
@anntzer
Copy link
Contributor Author

anntzer commented Feb 17, 2017

Darn I nearly got it past @NelleV :-)

I decided to remove the test because the implementation of bar no longer special-cases negative values (consider plot -- it does not special-case negative values so there isn't much of a point of testing them specifically). If we really want a test here (which I would disagree on) it should be an image test IMO, I don't think the current test is that valuable at all.

@NelleV
Copy link
Member

NelleV commented Feb 17, 2017

So you are saying that the old test still passes, but you don't consider it useful?

@anntzer
Copy link
Contributor Author

anntzer commented Feb 17, 2017

No. The old test made sure that negative widths led to a Rectangle with a positive width and a shifted x value. With this PR, we just build a Rectangle with the original x and original (negative) width, so the test doesn't really make sense anymore.

@tacaswell
Copy link
Member

The test should be changed to check that the rectangles are still where they are expected to be (effectively 'right' aligned) unless we have some other test that verifies the behavior of rectangles with negative height / width.

@anntzer
Copy link
Contributor Author

anntzer commented Feb 20, 2017

Added one.

@NelleV NelleV merged commit 349d6f0 into matplotlib:master Feb 22, 2017
@NelleV
Copy link
Member

NelleV commented Feb 22, 2017

Thanks @anntzer

@anntzer anntzer deleted the negative-height-bar branch February 22, 2017 19:18
QuLogic added a commit that referenced this pull request Feb 22, 2017
ibnIrshad pushed a commit to ibnIrshad/matplotlib that referenced this pull request Mar 18, 2017
* Update documentation of stem

changed here: matplotlib@d68662a

* Update vlines example with axes wide lines.

* Clean up BoundaryNorm docstring

* Document what happens when ncolors > bins

* BoundaryNorm docstring clarification

* BoundaryNorm docstring formatting

* Added set_xlim and set_ylim check for non-finite limit values

* FIX: masked images with interpolation

When determining which pixels to mask in the resampled image, if _any_
contribution to final value comes from a masked pixel, mask the
result.

Due to Agg special-casing the meaning of the alpha channel,
the interpolation for the mask channel needs to be done separately.
This is probably a template for doing the over/under separately.

print out exact hash on travis

* Cleaned up invalid axis limit warning text

* FIX tick label alignment can now be specified

This patch adds two new rcParams allowing to set label alignment. The sole
reason for the existance of these new parameters is to allow user to reset the
style to before 2.0 for testing purposes. More specifically, ytick horizontal
alignement was changed in a non backward compatible way. xtick vertical
alignement was added for API consistency.

closes matplotlib#7905

* MAINT created a new private _classic_test stylesheet

This allows the public classic stylesheet to be 'more' backward compatible

* FIX small nitpicks

* Template-ize visual_tests.py.

* Pass missing variable to format string.

* Simplify dictionary access in visual_tests.py.

* PEP8 visual_tests.py.

* Sort results in visual test HTML.

This makes the result a bit more reproducable and comparable.

* Don't start a browser for visual tests on CI.

Travis may or may not have a browser installed, but AppVeyor definitely
does, so this saves a tiny bit of processing power per run.

* Move visual_tests into tools.

* Add tools directory to pep8.

* pgf: Fix invalid arguments passed to pdftocairo.

This breaks saving PNG when using the PGF backend.

Fixes matplotlib#8121.

* MAINT Backporting of matplotlib#7995.

Set sticky_edges correctly for negative height bar().

* Small docstring fixes

* merge fill_demo and fill_demo_features

* move imports below title

* Merge docstring coherent

* Plot errorbars if fmt=='none'

* Add test for fmt=='none'

* Fix small spelling mistake

* Check plotted bars are color C0

* Add cleanup to new test

* Simplify multicolored_line example

* Move multicolored_line example

* Small fixes

* Put boundarynorm example back in

* Add autoclass entry for Artist API doc.

Adding an autoclass entry in the Artist API ensures that that class
appears in the intersphinx `build/html/object.inv`, as can be checked by
```
"matplotlib.artist.Artist" in (
    sphinx.ext.intersphinx.read_inventory(
        open("build/html/objects.inv", "rb"), None, lambda *args: None)[
            "py:class"])
```
(now returns True).

This allows other projects to link to that class in their docs using
```
`Artist` <matplotlib.artist.Artist>
```

This possibility used to be present, but disappeared when the Artist API
doc got refactored.  (Other classes that appear in the API docs are fine
as they already use autoclass.)

* Merge pull request matplotlib#8171 from afvincent/typo_eventplot_docstring

DOC: Fix small typos in 'eventplot' docstring

* Fix layout of spectrum_demo.py

* Beautified spectrum_demo.py a little more.

* Added plot titles to spectrum_demo.py

* Correct theta values when drawing a non-circular ellipse

Make arcs work with units

Add api change not for elliptical notes

Add background ellipse and extra line to test

Remove pdf and svg tests for arc angles

* Fix small typo in api change

* add gitter link in README

* add a line to README that explains use of gitter

* Fixes matplotlib#8141
Validators for dashed linestyles now allow None as an allowed value along with floats through optional `allow_none` kwarg in validate_nseq_float. Other validators that use validate_nseq_float arent affected

* Replace second instance of gitter badge with a link

* TST: Enable cache directories on AppVeyor.

* Use secure links to FreeType tarballs.

* Try harder to cache FreeType tarball on Python 2.

* TST: Always delete extra cache files on Travis.

Note, we don't need to do this on AppVeyor because the cache directories
are different.

* add parameter and test

* implemented label rotation

* pep8 fix

* DOC moved autowarp_demo to sphinx-gallery compatible docstring

* DOC spines example are now sphinx-gallery compliant

* DOC all tick labels examples are now sphinx-gallery compatible

* DOC moved text_demo_fontdict to sphinx-gallery compatible docstring

* TST: skip fc-list related tests if not installed

* DOC FIX removed a blank line from an example

* DOC moving showcase examples to sphinx-gallery

* Plural of axis is axes

* add early check for dot binary (from graphviz) when building the doc

* Clarify segment array shape

* Make ginput dostring into a numpydocstring

Small fixes

Add default value for npoints

Suggested changes to ginput docstring

Better description of ginput return

Put summary line by itself at the top

Add in missing full stops

* Implement Path.intersects_bbox in C++ to speed up legend positioning.

* DOC removed/added blankspace

* DOC fixe small typos and blank lines

* DOC capitalized firefox

* renamed flag to 'rotatelabels'; fix vertical alignment

* Update spines_demo.py

* MEP12 alignment_test

* Move alignment_test example

* MEP12 and simplify ganged_plots example

* Move ganged plots example

* pep8 fix

* added headers

* added/fixed headers

* DOC removed redundant call to plt.show()

* DOC added docstring to vline-hline example.

* fix gitter badge

* Set subplot spacing to zero

* Clean up description wording

* fix rst markup

* Fix pep8 violation

* Fix example description phrasing

* Remove image with non-free color calibration profile

The example that used to use this image was remove already in commit 9692c31.

This closes matplotlib#8034.

* MAINT Backporting of matplotlib#8241: remove possible non-free image

* Ignore invisible axes in computing tight_layout.

* combining and updating 2d hist examples

* consolidating histogram examples and moving to SG folder

* Memoize parse_fontconfig_pattern; speeds up test suite by ~1min.

On my laptop this patch drops the duration of the test suite from 604s
to 554s (with the inkscape patch on as well).

* addressing small change comments

* Contouring 1x1 array (issue 8197)

* another attempt; add a test

* Set __name__ for list validators in rcsetup.

This avoids having many validators all named `f`, which makes profiling
a bit difficult (it appears that repeated validation of rcparams when
resetting the style at the beginning of each test instance contributes
quite a bit to the total test time).  Instead, the list validator
based on scalar validator function `validate_foo` is now `__name__`d
`validate_foolist`, and the list validator based on scalar validator
class `ValidateFoo` is now `__name__`d `ValidateFooList`.

* TST: fail on missing baseline file

* re-add conditional check.

* DOC moved spines examples sphinx-gallery

* Use sys.executable -msphinx instead of sphinx-build.

* More robust type checking in '_validate_linestyle', on both Py2 and Py3

* tests now depend on python version to check cases with bytes args

* DOC changes in travis's build environment

* DOC removed duplicate appveyor py3.5 environment

* CI: travis runs documentation build and mac osx only on merge with master

* MAINT remove py.test from our travis build

* FIX appveyor doesn't need option USE_PYTEST anymore

* append test images.

* removed obsolete license.py file

* DOC moved changelog to the documentation

* DOC fix broken links

* MAINT moved some maintenance and helper python scripts to tools/

* FIX path in boilerplate.py

* Small header comment fixes

* Removes OldScalarFormatter

* Renaming file to scalarformatter_demo.py

* Renaming to plot_scalarformatter.py

* Adds title and description

* changing name in backend_driver.py

* Inkscape shell mode.

* Fix minimum sphinx version in doc-requirements.txt.

* Correcting typos and moving file to ticks and spines

* STY: fix whitespace in the tests

* Remove executable bit from examples and headers.

The vast majority of examples do not have the executable bit set, so
just make everything consistent.

Also remove `#!/usr/bin/env python` where appropriate.

* DOC shapes and collections is fully SG compatible

* Use neutral pronoun in docs.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Release critical For bugs that make the library unusable (segfaults, incorrect plots, etc) and major regressions.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants