Ask Your Question
1

Specify heights in Poset.plot

asked 2017-06-01 04:01:19 -0500

MthG gravatar image

Hi, I'm relatively new to Python and SAGE so please make it simple :)

Basically, I work with posets that are not ranked and I want to plot their Hasse Diagram. For the moment, I use Poset.plot() to display it but I can change to hasse.diagram().plot() if necessary.

My problem is the following : The posets that I work with come with an extra function that associate to every set an integer. Is there a way to use this function to specify the heights of the sets in my plot and not the default one ?

Thank you

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
1

answered 2017-07-13 17:05:22 -0500

You can use the heights option

sage: P = posets.DivisorLattice(12)
sage: P.plot(heights = {1: [1,3,4], 2: [2,6,12]})

The keys of the dictionary (here 1 and 2) are the heights and the values (here [1,3,4] and [2,6,12]) are the poset elements to be plotted at this height.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2017-06-01 04:01:19 -0500

Seen: 42 times

Last updated: Jul 13