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
plot doesn't work when x-range too small #5649
Comments
comment:1
See http://groups.google.com/group/sage-devel/browse_thread/thread/ddd9584a4bf457db for a y-axis variant on this, namely
|
comment:2
This patch fixes most of the problems above, and has a doctest for it. This does not fix the final example, because that is a bug in _tasteless_ticks and the numbers it is inputting to srange (presumably someone step is 0, though I couldn't reproduce it with actual numbers). Assuming this patch is okay, recommend opening a separate ticket for improving _tasteless_ticks handling of small numbers. |
comment:3
Attachment: trac_5649-small-number-plot.patch.gz I would like to review this patch, but I don't understand how to reproduce the bug. What is "P" from the examples in the ticket description? |
comment:4
It was from a sage-devel discussion the reporter didn't include (http://groups.google.com/group/sage-devel/browse_thread/thread/0e9c7b897851e5de). Anway,
in that case. But you can replicate it by making sure you have a small enough range (e.g. somewhat less than <10**-6) on any plot. There's a small chance this will have to be rebased, but I hope that no one has been messing with axes much recently. |
comment:5
Replying to @kcrisman: It applies fine to Sage 4.1. The first three examples work great with your changes, but the last one still raises a ZeroDivisionError. I'm using that function you gave me. Is there still a problem? |
comment:6
No, as I say above, that is a problem with _tasteless_ticks and its handling of small numbers. That should really be in a separate ticket, but I don't want to open it until I'm ready to tackle it. You can feel free to do so, however :) |
comment:7
REFEREE REPORT I'd like to give this a positive review. Applies fine to Sage 4.1, and plot tick marks work better now in a great many cases. I feel like the readability of _tasteful_ticks() could be improved. Better variable names would help ("d0", "d1", and "p" were hard to decipher). It also looks like there is some duplicated code that could be factored out into a separate method like maybe "extract_two_digits_and_place_value". We can leave the refactor for another ticket perhaps :). |
Reviewer: Bill Cauchois |
Author: Karl-Dieter Crisman |
Merged: sage-4.1.1.alpha0 |
comment:9
See #6548. In general there is a lot of work that could be done in axes.py when it comes to documentation and functionality. There are several other open tickets that have partial code to either significantly rewrite it or to use matplotlib axes - but so far both these solutions have proved more difficult than just slowly improving what already exists. |
Component: graphics
Author: Karl-Dieter Crisman
Reviewer: Bill Cauchois
Merged: sage-4.1.1.alpha0
Issue created by migration from https://trac.sagemath.org/ticket/5649
The text was updated successfully, but these errors were encountered: