Ask Your Question
1

Specify heights in Poset.plot

asked 2017-06-01 11:01:19 +0100

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-14 00:05:22 +0100

vdelecroix gravatar image

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

Comments

Thank you for your answer ! It works perfectly :)

MthG gravatar imageMthG ( 2017-07-27 17:20:29 +0100 )edit

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 11:01:19 +0100

Seen: 747 times

Last updated: Jul 14 '17