#16449: Add plot() and show() methods to abstract Matroid class
-------------------------------------+-------------------------------------
Reporter: Jayant | Owner:
Type: enhancement | Status: needs_work
Priority: minor | Milestone: sage-6.3
Component: matroid theory | Resolution:
Keywords: visualization, | Merged in:
geometric representation | Reviewers:
Authors: | Work issues:
Report Upstream: N/A | Commit:
Branch: | 3d92382b4f7e2a6131503f77bfee41c5a6107c69
u/Jayant/ticket/16449 | Stopgaps:
Dependencies: |
-------------------------------------+-------------------------------------
Comment (by Jayant):
Replying to [comment:12 Rudi]: Added tracking of x-y limits which in a
sense, does auto-framing that you mentioned. It keeps track of min and max
x and y points whenever new point or line (set of points) is added. Leaves
uniform space (Currently 0.5) on all sides. The _fix_positions() method is
also in place now.
> Hi Jayant,
>
> The user positioning works as advertised. Very nice!
>
> I just have some minor issues left. Look at the result of executing this
code:
>
> {{{
> M=matroids.named_matroids.BetsyRoss()
> pos={}
> s="abcde"
> t="fghij"
> x=1.61
> y=1/1.61
> for i in range(5):
> pos[s[i]]=(RR(x*sin(2*pi*i/5)), RR(x*cos(2*pi*i/5)))
> pos[t[i]]=(RR(y*sin(2*pi*(i+1/2)/5)), RR(y*cos(2*pi*(i+1/2)/5)))
> pos['k']=(0,0)
> M.show(pos_method=1, pos_dict=pos)
> }}}
>
> This gives a star-like object. The input is clearly centered at (0,0)
and has rotational symmetry.
>
> - The output of show() is flattenened (on my screen) and there is some
empty space above the image.
> - If you show the output generated by plot(), then there is no
flattening, but the some of the dots representing the groundset elements
are cut by the boundary of the image.
>
> So I wonder, could you perhaps get rid of the flattening in show()? The
behaviour of the boundary is another thing. The minimal solution is to
simply state the position of the windowframe in the docstring, and leave
it to the user to accomodate. A more advanced solution is auto-framing the
given picture, but then you should somehow make sure that all the dots and
curves fall completely within the frame.
>
> Finally, one more request. I see that the point positioning of M in the
above example is cached, so that if I just do M.show() again I get the
same nice picture. Could you create a command M._fix_positions(pos_dict)
which will likewise fix the point positions, but without showing or
plotting the matroid? I guess I could call M.plot() with a user point
positioning once and ignore the output to that effect, but I'm fairly sure
you can get the same result without calling all the plot routines. I want
to fit the named_matroids of rank <=3 with a nice default point
positioning, so I could use a command like that.
--
Ticket URL: <http://trac.sagemath.org/ticket/16449#comment:17>
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.