# Helper functions for plotting the geometric representation of matroids¶

AUTHORS:

• Jayant Apte (2014-06-06): initial version

Note

This file provides functions that are called by show() and plot() methods of abstract matroids class. The basic idea is to first decide the placement of points in $mathbb{R}^2$ and then draw lines in geometric representation through these points. Point placement procedures such as addtripts, addnontripts together produce (x,y) tuples corresponding to ground set of the matroid in a dictionary. These methods provide simple but rigid point placement algorithm. Alternatively, one can build the point placement dictionary manually or via an optimization that gives aesthetically pleasing point placement (in some sense. This is not yet implemented). One can then use createline function to produce sequence of 100 points on a smooth curve containing the points in the specified line which inturn uses scipy.interpolate.splprep and scipy.interpolate.splev. Then one can use sage’s graphics primitives line, point, text and points to produce graphics object containing points (ground set elements) and lines (for a rank 3 matroid, these are flats of rank 2 of size greater than equal to 3) of the geometric representation of the matroid. Loops and parallel elements are added as per conventions in [Oxl2011] using function addlp. The priority order for point placement methods used inside plot() and show() is as follows:

1. User Specified points dictionary and lineorders

2. cached point placement dictionary and line orders (a list of ordered lists) in M._cached_info (a dictionary)

3. Internal point placement and orders deciding heuristics If a custom point placement and/or line orders is desired, then user can simply specify the custom points dictionary as:

M.cached info = {'plot_positions':<dictionary_of _points>,
'plot_lineorders':<list of lists>}