ASKSAGE: Sage Q&A Forum - Individual question feedhttp://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Thu, 27 Jul 2017 10:20:29 -0500Specify heights in Poset.plothttp://ask.sagemath.org/question/37756/specify-heights-in-posetplot/ 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 Thu, 01 Jun 2017 04:01:19 -0500http://ask.sagemath.org/question/37756/specify-heights-in-posetplot/Answer by vdelecroix for <p>Hi, I'm relatively new to Python and SAGE so please make it simple :)</p>
<p>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.</p>
<p>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 ?</p>
<p>Thank you </p>
http://ask.sagemath.org/question/37756/specify-heights-in-posetplot/?answer=38244#post-id-38244You 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.Thu, 13 Jul 2017 17:05:22 -0500http://ask.sagemath.org/question/37756/specify-heights-in-posetplot/?answer=38244#post-id-38244Comment by MthG for <p>You can use the <code>heights</code> option</p>
<pre><code>sage: P = posets.DivisorLattice(12)
sage: P.plot(heights = {1: [1,3,4], 2: [2,6,12]})
</code></pre>
<p>The keys of the dictionary (here <code>1</code> and <code>2</code>) are the heights and the values (here <code>[1,3,4]</code> and <code>[2,6,12]</code>) are the poset elements to be plotted at this height.</p>
http://ask.sagemath.org/question/37756/specify-heights-in-posetplot/?comment=38416#post-id-38416Thank you for your answer ! It works perfectly :)Thu, 27 Jul 2017 10:20:29 -0500http://ask.sagemath.org/question/37756/specify-heights-in-posetplot/?comment=38416#post-id-38416