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
Fix 3d plots to not ignore user prespecified aspect_ratio. #14223
Comments
Attachment: trac_14223-plot-aspect_ratio-nt.patch.gz |
comment:1
This is quite tricky. I think the modification to the |
comment:2
Replying to @ppurka:
Thanks! |
This comment has been minimized.
This comment has been minimized.
comment:3
Attached is the patch to fix this bug. Patchbot apply trac_14223-fix_3d_aspect_ratio.patch |
Author: Punarbasu Purkayastha |
comment:5
Hi, I wanted to test this patch but unfortunately I already failed applying the patch to the latest stable version (5.11). I get
Being rather inexperienced it might well be that it is my mistake (especially as the patchbot seems to be ok with the patch). Do I have to apply it to the latest pre-release? Or do you have any other ideas what's wrong? |
comment:6
There you go. It is trying to apply to sage-5.0.1 instead of sage-5.11. |
comment:7
No I don't think so. The folder name is missleading. I upgraded sage several times and the upgrades seem not to change the folder names. On which version is the patch based on? I'll install the most recent pre-release and try whether I can apply it there... |
comment:8
IIRC, the patch is based on either sage-5.11-beta3 or sage-5.11-rc0. It should apply even to recent 5.12 prereleases since no one touches these graphics code. |
comment:9
strange... The problem persists even with the most recent version:
I somehow still suspect that the problem is on my side. Do you have any Ideas? Or could you check whether you can apply it to 5.12beta4? Thanks, Tobi |
comment:10
I can apply it to sage-5.12beta4. The aspect ratio comes out correct - see this plot. Also, the patch applies correctly.
|
comment:11
ok, this is strange...: After I downloaded the patch once more it applies perfectly to 5.11 and 5.12beta4. Probably there was just an error in the downloaded file. Thanks for your support and sorry that I didn't check this before, but I didn't expect something like this. I'll now have a closer look at this patch! |
comment:12
Hi Basu, here my remarks on the patch. It applies perfectly and in almost all cases which I tested it fixes the bug. I only found the following case, where setting the aspect ratio seems still to be ignored:
is different from
furthermore I observed that by this patch
changes the value of
and thus also the behaviour in all following show() commands. One can surely discuss if this is usefull or not, but I think in the 2d plots the setting of aspect ration in a show command only affects this plot and not the following. I think the 3d behavior should be consistent. |
comment:14
Thanks for finding out some bad examples. I will look into fixing these problems sometime next week. |
comment:15
I have tried to address both the concerns. The output should look the same now in all cases. Patchbot apply trac_14223-fix_3d_aspect_ratio.patch |
comment:16
Hi! Thanks for fixing these issues. All the problems which I reported above are indeed fixed. I'm sorry to come up with another one: The problem occurs if one has plots, with very different axes scales e.g.
Without the patch the aspect ratio was automatically chosen such that all axes are equally long, if the user didn't set the aspect ratio. Now the aspect is automatically 1 which produces very degenerate plots, where one cannot see much. The user has thus to adjust the ration manually which seems a drawback to me. As far as I understand in my limited view the problem is the following: -the default value of self.aspect_ratio() is (1,1,1) I'm not sure how to fix this, but here some ideas which might hopefully be helpful. Is it maybe possible, that the default value of self.aspect_ratio() is 'automatic'? Then there would be no degenerate plots if the user doesn't change anything. |
comment:17
This is actually a side effect of fixing the problem you mentioned in comment:12. The frame aspect ratio was being set to I can revert the patch back to the previous case while making sure that aspect ratio is not stored when it is passed on to |
comment:18
Well if it is not easily possible to distinguish whether the aspect ration has been set by the user to (1,1,1) with |
comment:19
Attachment: trac_14223-fix_3d_aspect_ratio.patch.gz Ok. I updated the patch and also fixed this bug:
The inconsistency in comment:12 remains, but it can not be reliably fixed. Patchbot apply trac_14223-fix_3d_aspect_ratio.patch |
comment:20
Sorry it took some days until I was able to have a closer look. Everything except the inconsistency you mention works fine now. Also some other test produced the expected outcome. Additionally I was playing Patchbot on my system and tested against 5.12beta3: -patch applies without errors -source builds without errors -patch doesn't provoke any errors for a full doctest -reference builds without problems and the changes lead to reasonable output So there seems no reason not to give a positive review... |
Reviewer: Tobias Weich |
This comment has been minimized.
This comment has been minimized.
Merged: sage-5.13.beta1 |
In the following, the user specified aspect ratio is currently ignored:
The attached patch is but a proof-of-concept of solution. I don't know well enough the plot code to see if this is the right thing to do.
Apply attachment: trac_14223-fix_3d_aspect_ratio.patch to devel/sage.
Component: graphics
Author: Punarbasu Purkayastha
Reviewer: Tobias Weich
Merged: sage-5.13.beta1
Issue created by migration from https://trac.sagemath.org/ticket/14223
The text was updated successfully, but these errors were encountered: