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: sage-8.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:

Status badges

Description (last modified by jmantysalo)

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 jmantysalo

Branch: u/jmantysalo/some_examples_to_plot___for_posets_

comment:2 Changed 7 years ago by git

Commit: e377fda7aaac090afb2a9e36e6ea86dc271304c0

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

e377fdaExamples and little modification to plot() of posets.

comment:3 Changed 7 years ago by jmantysalo

Authors: Jori Mäntysalo
Cc: chapoton added
Component: documentationcombinatorics
Milestone: sage-wishlistsage-6.10
Status: newneeds_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 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.

comment:4 Changed 7 years ago by git

Commit: e377fda7aaac090afb2a9e36e6ea86dc271304c0b279046284f6e0fea6510039f157d051cf1bcacc

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

b279046Added cover_style.

comment:5 Changed 7 years ago by jmantysalo

Status: needs_reviewneeds_work

Back to needs_work because of #13827 and #18936.

comment:6 Changed 6 years ago by git

Commit: b279046284f6e0fea6510039f157d051cf1bcacc57e36aa7413e7d3ccbacbcad3accf217d2dcc4a5

Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:

57e36aaModify plot() of posets.

comment:7 Changed 6 years ago by jmantysalo

Cc: paulmasson added; chapoton removed
Description: modified (diff)
Milestone: sage-6.10sage-7.6
Status: needs_workneeds_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 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.

comment:8 Changed 6 years ago by git

Commit: 57e36aa7413e7d3ccbacbcad3accf217d2dcc4a50b35f58f512a22e0ff6aee28e9645ea679da9a44

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

0b35f58Forgot figsize-option.

comment:9 Changed 6 years ago by kdilks

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 in reply to:  9 Changed 6 years ago by jmantysalo

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 congruence-related tickets like #22306?)

comment:11 Changed 6 years ago by jmantysalo

Cc: chapoton added

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.

comment:12 Changed 6 years ago by jmantysalo

Cc: tscrim added

Ping.

comment:13 Changed 6 years ago by chapoton

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 git

Commit: 0b35f58f512a22e0ff6aee28e9645ea679da9a4424b36a138f0b46eb93cbd8d153a8732cb2477563

Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:

d222342Modify plot() of posets.
24b36a1Forgot figsize-option.

comment:15 Changed 6 years ago by git

Commit: 24b36a138f0b46eb93cbd8d153a8732cb24775635c596198b5ee1abd875934d85f70652bc0933ef4

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

5c59619Reviewer notes.

comment:16 Changed 6 years ago by jmantysalo

Milestone: sage-7.6sage-8.0

Like this?

comment:17 Changed 6 years ago by chapoton

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 git

Commit: 5c596198b5ee1abd875934d85f70652bc0933ef4b71a6f52c4996c9c00933af7a4f09d01240fe7b4

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

b71a6f5Undo removing a note-block.

comment:19 in reply to:  17 Changed 6 years ago by jmantysalo

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 chapoton

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 git

Commit: b71a6f52c4996c9c00933af7a4f09d01240fe7b4546226b061112b380dc47c6a10947b91321f27ed

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

546226bA typo.

comment:22 Changed 6 years ago by jmantysalo

Typo corrected.

comment:23 Changed 6 years ago by jmantysalo

More comments on this?

comment:24 Changed 6 years ago by jmantysalo

Just pinging...

comment:25 Changed 6 years ago by tscrim

Reviewers: Kevin Dilks, Frédéric Chapoton, Travis Scrimshaw
Status: needs_reviewpositive_review

Let it be so.

comment:26 Changed 6 years ago by jmantysalo

Thanks Travis!

...next one should be the poset constructor, I think...

comment:27 Changed 6 years ago by vbraun

Branch: u/jmantysalo/some_examples_to_plot___for_posets_546226b061112b380dc47c6a10947b91321f27ed
Resolution: fixed
Status: positive_reviewclosed
Note: See TracTickets for help on using tickets.