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

Bug fix for plotting minor ticks #3557

Closed
nhmc opened this issue Sep 23, 2014 · 6 comments
Closed

Bug fix for plotting minor ticks #3557

nhmc opened this issue Sep 23, 2014 · 6 comments

Comments

@nhmc
Copy link
Contributor

nhmc commented Sep 23, 2014

When using AutoMinorlocator the rightmost minor tick isn't drawn sometimes (in Matplotlib 1.4). Changing this line in class AutoMinorLocator(Locator) (in ticker.py) from:

tmax = np.floor((vmax - t0) / minorstep) * minorstep

to

 tmax = np.ceil((vmax - t0) / minorstep) * minorstep

fixes this. I don't completely understand the code though, so this may not be the best fix.

@efiring
Copy link
Member

efiring commented Sep 23, 2014

Would you provide a minimal script that illustrates the bug, please?

@tacaswell tacaswell added this to the unassigned milestone Sep 23, 2014
@tacaswell tacaswell added the status: needs clarification Issues that need more information to resolve. label Sep 23, 2014
@nhmc
Copy link
Contributor Author

nhmc commented Sep 23, 2014

import matplotlib.pyplot as plt
plt.plot([1,2,3])
plt.minorticks_on()
plt.xlim(0, 1.39)
plt.show()

In this case the highest minor tick on the x axis is missing.

@tacaswell tacaswell added status: confirmed bug status: needs patch and removed status: needs clarification Issues that need more information to resolve. labels Sep 24, 2014
@tacaswell tacaswell modified the milestones: v1.4.x, unassigned Sep 24, 2014
@nhmc
Copy link
Contributor Author

nhmc commented Sep 24, 2014

I'm happy to open a PR adding the fix in the original post - let me know if I should do that.

@tacaswell
Copy link
Member

Please do so, but I would re-write it as

tmax = ((vmax - t0) // minorstep) + 1) * minorstep

Please branch of off the 1.4.x and make the PR against the same (as this is a bug-fix not a new feature).

@WeatherGod
Copy link
Member

Should also add a test, and make sure the same problem doesn't happen on
the other side of the axis.

On Wed, Sep 24, 2014 at 8:48 AM, Thomas A Caswell notifications@github.com
wrote:

Please do so, but I would re-write it as

tmax = ((vmax - t0) // minorstep) + 1) * minorstep

Please branch of off the 1.4.x and make the PR against the same (as this
is a bug-fix not a new feature).


Reply to this email directly or view it on GitHub
#3557 (comment)
.

@tacaswell
Copy link
Member

closed by #3612

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

No branches or pull requests

5 participants