#16484: Transformations for 2D plots
-------------------------------+------------------------
Reporter: nthiery | Owner:
Type: enhancement | Status: new
Priority: major | Milestone: sage-6.3
Component: graphics | Resolution:
Keywords: | Merged in:
Authors: | Reviewers:
Report Upstream: N/A | Work issues:
Branch: | Commit:
Dependencies: | Stopgaps:
-------------------------------+------------------------
Comment (by nthiery):
Replying to [comment:1 kcrisman]:
> Do you have some links for examples of syntax or functionality from
other programs? That could be helpful to anyone trying to do this - right
now it's somewhat vague. I like the idea.
I had in mind the same syntax as for plot3d (up to the obvious
adaptations), so that one could write dimension-agnostic code whenever
possible. Here are some things you can do with them:
{{{
sage: p = plot3d(lambda x, y: x^2 + y^2, (-2,2), (-2,2))
sage: p.translate(<vector>)
sage: p.rotateX(<angle>)
sage: p.scale(3)
sage: p.transform(rotate=..., scale=..., translate=...)
sage: p.transform(<matrix>)
sage: p.transform(<transformation>) # haven't checked that but would be
natural
}}}
By the way: the documentation of Plot3d.transform does not make it clear
that one can pass in a matrix; and it needs to be passed as m=<matrix>...
which is not great.
But I haven't checked on matplotlib, and being consistent with it would be
nice too.
http://matplotlib.org/users/transforms_tutorial.html
Cheers,
Nicolas
--
Ticket URL: <http://trac.sagemath.org/ticket/16484#comment:2>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.