HasseDiagrams
Drawings of partially ordered sets.
Basic Usage
julia> p = subset_lattice(3)
{8, 19} Int64 poset
julia> h = HasseDiagram(p)
Hasse diagram of a {8, 19} Int64 poset
julia> draw(h)Creating a Layout
When a Hasse diagram is created, it is given a default layout. Hasse diagrams can be given an alternative layout with the function set_xy. There are two forms:
set_xy(h, method)uses the functionmethodto compute the layout. The function acts on the posets held insideh. The list of available layout methods is in the next section.set_xy(h, xy)uses the dictionaryxyto site the vertices. Vertexvis placed atxy[v]. Ifvis not a key ofxy, then its location is unchanged.
Layout Methods
basic_layoutplaces vertices vertically based on their rank and, within each rank, the horizontal placement is evenly spaced.layout_2dis a decent layout function but only applicable to posets whose dimension is at most two.
Properties
Font size
- Use
set_font_size(h, sz)to set labels to beszpoints. Use0to hide labels. - Use
get_font_size(h)to determine the current font size forh.