Closed f29946bc-ee7b-48cd-9abc-3445948c551d closed 7 years ago
Branch pushed to git repo; I updated commit sha1. New commits:
e377fda | Examples and little modification to plot() of posets. |
Commit: e377fda
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 real-life 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.
Author: Jori Mäntysalo
Branch pushed to git repo; I updated commit sha1. New commits:
b279046 | Added cover_style. |
Back to needs_work because of #13827 and #18936.
Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:
57e36aa | Modify plot() of posets. |
Description changed:
---
+++
@@ -1,10 +1 @@
-Even after #11284 there are "hidden" useful features on drawing poset. We should add something like coloring elements by their value or for example their rank on poset. Simple example is enought to show that there is more to look for.
-
-And more important, something like
-
-```
-P=Poset({1:[2]})
-P.show(element_labels={1:2, 2:1}, vertex_colors={"red": P.maximal_elements()})
-```
-
-needs a warning.
+Even after #11284 there are "hidden" useful features on drawing poset. Also one can not use `element_shape` instead of `vertex_shape` etc.
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 real-world 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.
Branch pushed to git repo; I updated commit sha1. New commits:
0b35f58 | Forgot figsize-option. |
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.
Replying to @kevindilks:
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 congruence-related tickets like #22306?)
I got no comments from the devel-list. 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.
Ping.
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 ``
Branch pushed to git repo; I updated commit sha1. New commits:
5c59619 | Reviewer notes. |
Like this?
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.
Branch pushed to git repo; I updated commit sha1. New commits:
b71a6f5 | Undo removing a note-block. |
Replying to @fchapoton:
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.
could you please take the opportunity to correct the typo
Plot of the empy poset::
that you introduced in a previous ticket ?
Branch pushed to git repo; I updated commit sha1. New commits:
546226b | A typo. |
Typo corrected.
More comments on this?
Just pinging...
Reviewer: Kevin Dilks, Frédéric Chapoton, Travis Scrimshaw
Let it be so.
Thanks Travis!
...next one should be the poset constructor, I think...
Changed branch from u/jmantysalo/some_examples_to_plot___forposets to 546226b
Even after #11284 there are "hidden" useful features on drawing poset. Also one can not use
element_shape
instead ofvertex_shape
etc.CC: @paulmasson @fchapoton @tscrim
Component: combinatorics
Author: Jori Mäntysalo
Branch/Commit:
546226b
Reviewer: Kevin Dilks, Frédéric Chapoton, Travis Scrimshaw
Issue created by migration from https://trac.sagemath.org/ticket/18545