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

Merged
merged 2 commits into from May 21, 2013

Conversation

Projects
None yet
4 participants
Owner

tacaswell commented Apr 9, 2013

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 pandas-dev/pandas Apr 9, 2013

Closed

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

Owner

tacaswell commented Apr 9, 2013

build errors are inkscape installation errors.

Member

dmcdougall commented Apr 9, 2013

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.

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
Owner

tacaswell commented Apr 9, 2013

@dmcdougall ok, rebased.

Contributor

neggert commented Apr 9, 2013

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

Owner

tacaswell commented Apr 9, 2013

@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?

Contributor

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.

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 Apr 9, 2013

Contributor

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.

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 Apr 9, 2013

Contributor

Same here

Owner

tacaswell commented Apr 9, 2013

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

Owner

tacaswell commented Apr 15, 2013

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

Contributor

neggert commented Apr 15, 2013

Yup! Thanks. 

Sent from Mailbox for iPhone

On Mon, Apr 15, 2013 at 10:21 AM, Thomas A Caswell
notifications@github.com wrote:

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

Reply to this email directly or view it on GitHub:
#1889 (comment)

Owner

tacaswell commented May 21, 2013

@mdboom Can this be merged?

mdboom added a commit that referenced this pull request May 21, 2013

Merge pull request #1889 from tacaswell/log_bar_regression
Fixed handling of `bar(.., bottom=None, log=True)`

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

1 check passed

default The Travis build passed
Details

@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