Skip to content

Fixed handling of `bar(.., bottom=None, log=True)` #1889

Merged
merged 2 commits into from May 21, 2013

4 participants

@tacaswell
Matplotlib Developers member

re-added lines to make sure that bottom and left are not None in the case of log=True. If this is not done, there will be type exceptions.

Issue #1882

@tacaswell tacaswell referenced this pull request in pydata/pandas Apr 9, 2013
Closed

log=True bar plots are raising with mpl 1.2.1 #3254

@tacaswell
Matplotlib Developers member

build errors are inkscape installation errors.

@dmcdougall
Matplotlib Developers member

I fixed the install errors in 01a4bed.

Sorry to go behind protocol on that commit; I used the GitHub editor and I thought it would make a pull request out of it rather than commit directly to the repository.

@tacaswell tacaswell re-added lines to make sure that `bottom` and `left` are not None in
the case of `log=True`.  If this is not done, there will be type
exceptions.

Issue #1882
d6e3734
@tacaswell
Matplotlib Developers member

@dmcdougall ok, rebased.

@neggert
neggert commented Apr 9, 2013

I think I introduced this bug. Can we get a test so it doesn't happen again?

@tacaswell
Matplotlib Developers member

@neggert Can you write that test (I am super swamped, have a committee meeting in a week)? I don't think we need an image test for this, just make sure all reasonable arguments don't blow up.

Can you also take a look at the other issues @y-p has brought up in the original issue thread?

@dmcdougall do you want me to rebase this again to get all of the svg tests to run?

@neggert
neggert commented Apr 9, 2013

I can do the test, but it might take me a few days to get to it. I propose to merge this now. I'll make a separate PR with the test when I get to it.

@neggert neggert commented on an outdated diff Apr 9, 2013
lib/matplotlib/axes.py
@@ -4797,6 +4797,7 @@ def make_iterable(x):
if _bottom is None:
if self.get_yscale() == 'log':
adjust_ylim = True
+ bottom = [1e-100]
@neggert
neggert added a note Apr 9, 2013

You should be able to move this outside of the if statement and just set it to [0]. That was the reason for making the change (nonposy=True) that got this all started. That way it will behave well even if someone wants to work with very small numbers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@neggert neggert commented on an outdated diff Apr 9, 2013
lib/matplotlib/axes.py
@@ -4812,6 +4813,7 @@ def make_iterable(x):
if _left is None:
if self.get_xscale() == 'log':
adjust_xlim = True
+ left = [1e-100]
@neggert
neggert added a note Apr 9, 2013

Same here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@tacaswell
Matplotlib Developers member

@neggert Done. I suspected that would be the case, but went with what seemed to be the minimal change (which was replacing those lines)

@tacaswell
Matplotlib Developers member

@neggert Do you agree with how this is fixed now?

@neggert
@tacaswell
Matplotlib Developers member

@mdboom Can this be merged?

@mdboom mdboom merged commit 16be971 into matplotlib:v1.2.x May 21, 2013

1 check passed

Details default The Travis build passed
@tacaswell tacaswell deleted the tacaswell:log_bar_regression branch May 21, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.