-
-
Notifications
You must be signed in to change notification settings - Fork 481
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
Introduce graphics insets #27866
Comments
Author: Eric Gourgoulhon |
Branch: public/graphics/graphics_insets |
Commit: |
Dependencies: #27865 |
Last 10 new commits:
|
This comment has been minimized.
This comment has been minimized.
comment:5
Moving tickets from the Sage 8.8 milestone that have been actively worked on in the last six months to the next release milestone (optimistically). |
comment:7
The two pyflakes errors reported by the patchbot are spurious ones: these imports are really necessary. |
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:9
I was wondering what happens if the graphics inset requires a particular aspect ratio, and apparently the aspect ratio is preserved, which is good. However, in the cases I tested I obtained an inset that is much larger than expected. Could you explain the output for
Edit: To be more precise, the inset has the correct size relative to the final image, but not in relation to the main graphics. |
comment:10
Attachment: g2.png Replying to @mwageringel:
Actually, this is a feature, not a bug. From the documentation returned by
As you can see, the argument |
comment:11
Should it be half the width and height of the figure As far as I understand, the position is computed in terms of the figure size, not the plotting area, so I should not expect the inset to cover the top right quadrant of the plot precisely, but in |
Attachment: g2_new.png |
comment:13
Replying to @mwageringel:
I've changed the rescaling of the base plot when generating the
The position/size given in the argument |
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:15
For some reason, yesterday's commit (comment:12) contained a spurious change of permissions on the file |
comment:16
Attachment: g4.png There still seems to be an inconsistency between vertical and horizontal positioning. For example, in
Moreover, some of the type checks testing for lists and tuples seem a bit restrictive. Especially this one is not necessary, as the implementation will work for any iterable and iterator, so the type check should just be removed:
I am not sure why the following change is needed. Would it be better to test for the converse, i.e. - # tight_layout adjusts the *subplot* parameters so ticks aren't
- # cut off, etc.
- figure.tight_layout()
+ if isinstance(graphics, (sage.plot.graphics.Graphics,
+ sage.plot.multigraphics.GraphicsArray)):
+ # for Graphics and GraphicsArray, tight_layout adjusts the
+ # *subplot* parameters so ticks aren't cut off, etc.
+ figure.tight_layout() Other than that, everything looks good to me. |
Reviewer: Markus Wageringel |
Branch pushed to git repo; I updated commit sha1. New commits:
|
Branch pushed to git repo; I updated commit sha1. New commits:
|
Attachment: g4_aspect_ratio1.png |
comment:19
Sorry for the delay in replying... Replying to @mwageringel:
Actually this is not a bug but results from a clash between the default aspect ratio of the whole figure, which is 4/3, and the aspect ratio 1 of the subplots. If you ask for an aspect ratio of 1 for the whole figure, then everything is OK:
leads to
Indeed! Thanks for pointing this. The type check has been removed in the above commit.
Yes, I think so.
Yes I think it is preferable to keep the tests as they are, since only |
comment:21
Ok, thanks for the explanations. I am setting this to positive then. |
comment:23
Replying to @mwageringel:
Thanks for the review! |
Changed branch from public/graphics/graphics_insets to |
comment:25
This is causing two test failures on Arch when compiling against system libraries (haven't tried on sage-the-distro)
|
Changed commit from |
comment:26
New ticket please! |
comment:27
See #29547. |
This ticket introduces graphics insets, i.e. it allows to have various
Graphics
objects at arbitrary locations and sizes on a single figure. Previously, only graphics arrays, i.e.Graphics
objects arranged in a regular array, were possible.This is made possible thanks to the generic class
MultiGraphics
introduced in #27865.The user interface is constituted of three new functions:
Graphics.inset()
, which adds an inset to a given graphics; see this preview exampleMultiGraphics.inset()
, which adds an inset to a multi-graphics (e.g. aGraphicsArray
); see this preview examplemulti_graphics()
, which creates a figure from a list ofGraphics
objects at user-specified locations; see this preview exampleDepends on #27865
CC: @kcrisman @fchapoton @dkrenn @jdemeyer @embray
Component: graphics
Keywords: graphics inset
Author: Eric Gourgoulhon
Branch:
ed586d3
Reviewer: Markus Wageringel
Issue created by migration from https://trac.sagemath.org/ticket/27866
The text was updated successfully, but these errors were encountered: