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
make text not give bounding box info if axis_coords is True #10889
Comments
Author: Jason Grout |
comment:1
Attachment: trac-10889-text-axis-coords.patch.gz |
comment:2
Using sage-4.6.1, the patch fixes the problem I was having (mentioned in sage-devel. I added in a new patch with the following doctest that illustrates that my problem is fixed :
All tests passed on Before giving a positive review, I have one question. What is the intended behavior for when
|
Reviewer: Sébastien Labbé |
comment:3
I would suggest that we add an option to use "Figure" coordinates rather than axes coordinates for placing something outside of the axes bounding box. In the code, we could easily use transFigure instead of transAxes (I think that's correct). I think it's a bug that using axes coordinates lets you place something outside of the axes (or rather, I think it let you place something outside of the current axes, and then it maybe adjusted the axes to fit what you had??) Maybe a more comprehensive option would be: text('Evolution', (0.5, .2), coords='axes') or text('Evolution', (0.5, .2), coords='figure') which would specify the transAxes or transFigure transformation to matplotlib. |
comment:4
Or probably more proper: text('A', (0.5, 2), coordinates='axes') (instead of coords) |
Applies over the precedent patch |
comment:5
Attachment: trac_10889_review-sl.patch.gz
... this new patch contains a commit message |
comment:6
OK, I am a little bit mixed up now.
I don't understand the last part of the parenthesis. I think it is a good idea to let the user place the object where he wants whatever coordinate system he uses. However, I don't know if we should or not adapt the bounding box when an object is outside for when
|
if axis_coords is true, it doesn't make sense for a text object to give bounding box information, since the location should be within the figure no matter what the actual coordinates are.
This also involved teaching plot.py what to do when an object returned None for their coordinates. I also fixed some of the NaN-checking code right there to use the proper functions to check for NaN and infinity.
CC: @seblabbe
Component: graphics
Author: Jason Grout
Reviewer: Sébastien Labbé
Issue created by migration from https://trac.sagemath.org/ticket/10889
The text was updated successfully, but these errors were encountered: