Opened 8 years ago
Closed 6 years ago
#18545 closed enhancement (fixed)
Some examples to plot() for posets.
Reported by:  jmantysalo  Owned by:  

Priority:  major  Milestone:  sage8.0 
Component:  combinatorics  Keywords:  
Cc:  paulmasson, chapoton, tscrim  Merged in:  
Authors:  Jori Mäntysalo  Reviewers:  Kevin Dilks, Frédéric Chapoton, Travis Scrimshaw 
Report Upstream:  N/A  Work issues:  
Branch:  546226b (Commits, GitHub, GitLab)  Commit:  546226b061112b380dc47c6a10947b91321f27ed 
Dependencies:  Stopgaps: 
Description (last modified by )
Even after #11284 there are "hidden" useful features on drawing poset. Also one can not use element_shape
instead of vertex_shape
etc.
Change History (27)
comment:1 Changed 7 years ago by
Branch:  → u/jmantysalo/some_examples_to_plot___for_posets_ 

comment:2 Changed 7 years ago by
Commit:  → e377fda7aaac090afb2a9e36e6ea86dc271304c0 

comment:3 Changed 7 years ago by
Authors:  → Jori Mäntysalo 

Cc:  chapoton added 
Component:  documentation → combinatorics 
Milestone:  sagewishlist → sage6.10 
Status:  new → needs_review 
Frédéric: This is my suggestion to plot()
of posets. Examples are kind of artificial, but I am sure that there is no good reallife example using every one of possible options.
I also added some keywords, so that now you can say for example element_shape
instead of vertex_shape
. There is still some unorthogonal things, but they should be done on graph side. I would except to have vertex_shapes={'s': [1, 2]}
when we have vertex_color={'red': [1, 2]}
and so on.
I hope that users can now better see what is available. I think that at least coloring of some elements can be a good thing. Think for example showing elements of Frattini sublattice in red.
comment:4 Changed 7 years ago by
Commit:  e377fda7aaac090afb2a9e36e6ea86dc271304c0 → b279046284f6e0fea6510039f157d051cf1bcacc 

Branch pushed to git repo; I updated commit sha1. New commits:
b279046  Added cover_style.

comment:5 Changed 7 years ago by
Status:  needs_review → needs_work 

comment:6 Changed 6 years ago by
Commit:  b279046284f6e0fea6510039f157d051cf1bcacc → 57e36aa7413e7d3ccbacbcad3accf217d2dcc4a5 

Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:
57e36aa  Modify plot() of posets.

comment:7 Changed 6 years ago by
Cc:  paulmasson added; chapoton removed 

Description:  modified (diff) 
Milestone:  sage6.10 → sage7.6 
Status:  needs_work → needs_review 
This is a rewrite with simpler code, I hope. Also examples are new.
The example is kind of artificial, but I guess there is no realworld example that would show most of the options. Anyways, one could see that double irreducibles are not in the Frattini sublattice and that the Frattini sublattice need not be a connected inside the lattice. So this is almost reasonable example.
comment:8 Changed 6 years ago by
Commit:  57e36aa7413e7d3ccbacbcad3accf217d2dcc4a5 → 0b35f58f512a22e0ff6aee28e9645ea679da9a44 

Branch pushed to git repo; I updated commit sha1. New commits:
0b35f58  Forgot figsizeoption.

comment:9 followup: 10 Changed 6 years ago by
I've been meaning to add something to the documentation for poset display options, so I'm glad to see this ticket already exists.
Is it really worth creating aliases in the code for slightly modified terminology? Especially since in all the literature I've seen where one wants to assign labels to the covering relations in a poset, they are called 'edge labelings'. It would also have implications for ticket 19396 (if I ever get around to it), which is about adding edge labels as an optional part of the poset data structure.
I was thinking about just having text that says "The poset plot
method passes to the plot
method for digraphs (link to Digraph display options), where poset elements are vertices, and covering relations are edges.", and then having a few key examples.
The two key examples that I think definitely need to be in here are for displaying order ideals of a poset (done with P.plot(vertex_colors={'blue':order_ideal}), and showing how to use vertex_labels
to display linear extensions on the Hasse diagram.
comment:10 Changed 6 years ago by
Replying to kdilks:
Is it really worth creating aliases in the code for slightly modified terminology?
I was thinking about #20691 and mirrored this change. This ticket still makes it possible to use vertex_color
etc, new names are just aliases. (Or overriding aliases to be strict.)
Especially since in all the literature I've seen where one wants to assign labels to the covering relations in a poset, they are called 'edge labelings'.
Good point. OTOH we already have cover_relations()
etc. Hmm...
The two key examples that I think definitely need to be in here are for displaying order ideals of a poset (done with P.plot(vertex_colors={'blue':order_ideal}), and showing how to use
vertex_labels
to display linear extensions on the Hasse diagram.
What about edge_colors
(or cover_colors
), what kind of example to do for those? Also an example with more than one additional color would be nice.
(Side question: Are you interested in congruencerelated tickets like #22306?)
comment:11 Changed 6 years ago by
Cc:  chapoton added 

I got no comments from the devellist. Let's try to CC Frédéric.
The more I think this, more I come to conclusion that this aliasing is good and natural thing. We already have, say, order on graphs and cardinality for posets. Or 'water vapor' translates to Finnish 'löyly' in sauna and 'höyry' otherwise. That is how language works.
comment:13 Changed 6 years ago by
I lost my previous (longer) comment, here is a summary
 be more precise on how to use the dictionaries (say dictionary mapping element to color, for example)
 rather not remove the simple example of element labeling
 there is a False that shoud be typeset with double
``
comment:14 Changed 6 years ago by
Commit:  0b35f58f512a22e0ff6aee28e9645ea679da9a44 → 24b36a138f0b46eb93cbd8d153a8732cb2477563 

comment:15 Changed 6 years ago by
Commit:  24b36a138f0b46eb93cbd8d153a8732cb2477563 → 5c596198b5ee1abd875934d85f70652bc0933ef4 

Branch pushed to git repo; I updated commit sha1. New commits:
5c59619  Reviewer notes.

comment:17 followup: 19 Changed 6 years ago by
In my opinion, you should keep somewhere the note explaining that the options of graphs are also available.
You should also keep the explanations about "layout", which is an input and must therefore be documented.
comment:18 Changed 6 years ago by
Commit:  5c596198b5ee1abd875934d85f70652bc0933ef4 → b71a6f52c4996c9c00933af7a4f09d01240fe7b4 

Branch pushed to git repo; I updated commit sha1. New commits:
b71a6f5  Undo removing a noteblock.

comment:19 Changed 6 years ago by
Replying to chapoton:
In my opinion, you should keep somewhere the note explaining that the options of graphs are also available.
OK, added that.
You should also keep the explanations about "layout", which is an input and must therefore be documented.
So is heights
, but 1) Posets.PentagonPoset().show(heights={0:[0], 1:[2], 2:[1], 3:[3], 4:[4]})
does not really work as you would guess, and Posets.PentagonPoset().show(layout='circular')
... well, it works but whoever wants that? IMO it is meaningfull only when the user thinks poset as a Hasse diagram, and then he/she can use .hasse_diagram()
first.
comment:20 Changed 6 years ago by
could you please take the opportunity to correct the typo
Plot of the empy poset::
that you introduced in a previous ticket ?
comment:21 Changed 6 years ago by
Commit:  b71a6f52c4996c9c00933af7a4f09d01240fe7b4 → 546226b061112b380dc47c6a10947b91321f27ed 

Branch pushed to git repo; I updated commit sha1. New commits:
546226b  A typo.

comment:25 Changed 6 years ago by
Reviewers:  → Kevin Dilks, Frédéric Chapoton, Travis Scrimshaw 

Status:  needs_review → positive_review 
Let it be so.
comment:26 Changed 6 years ago by
Thanks Travis!
...next one should be the poset constructor, I think...
comment:27 Changed 6 years ago by
Branch:  u/jmantysalo/some_examples_to_plot___for_posets_ → 546226b061112b380dc47c6a10947b91321f27ed 

Resolution:  → fixed 
Status:  positive_review → closed 
Branch pushed to git repo; I updated commit sha1. New commits:
Examples and little modification to plot() of posets.