Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

White background for edge labels in plot of graph #23071

Closed
enadeau opened this issue May 24, 2017 · 17 comments
Closed

White background for edge labels in plot of graph #23071

enadeau opened this issue May 24, 2017 · 17 comments

Comments

@enadeau
Copy link

enadeau commented May 24, 2017

When you plot a graph with labels on edges, the label usually appear directly on the edges and it's not very good for readability.

The objective is to add an option to Graph.plot() to specify the background color of the label.

Example (see attach)

    sage: Word('001101').suffix_tree().plot()

CC: @thecaligarmo @jm58660

Component: graph theory

Keywords: graph plot, edge label

Author: Émile Nadeau

Branch/Commit: 94f5db1

Reviewer: Jori Mäntysalo

Issue created by migration from https://trac.sagemath.org/ticket/23071

@enadeau enadeau added this to the sage-8.0 milestone May 24, 2017
@enadeau
Copy link
Author

enadeau commented May 24, 2017

Attachment: before.png

@enadeau

This comment has been minimized.

@enadeau

This comment has been minimized.

@enadeau
Copy link
Author

enadeau commented May 26, 2017

@enadeau
Copy link
Author

enadeau commented May 26, 2017

Attachment: after.png

@enadeau
Copy link
Author

enadeau commented May 26, 2017

New commits:

7297d35Trac #23071: Add the option edge_labels_background. Default is now "white"
55eb667Trac #23071: Document the new option edge_labels_background

@enadeau
Copy link
Author

enadeau commented May 26, 2017

Commit: 55eb667

@jm58660
Copy link
Mannequin

jm58660 mannequin commented May 27, 2017

comment:6

Seems good, but no time for review just now. I'll CC myself because of posets 'plot()` function.

@jm58660
Copy link
Mannequin

jm58660 mannequin commented May 29, 2017

comment:7

Did you test edge_labels_background=None with or without dot2tex? It seems that without that it works incorreclty. I tested with

graphs.PetersenGraph().show(edge_labels=True, edge_labels_background=None)

@enadeau
Copy link
Author

enadeau commented May 29, 2017

comment:8

Replying to @jm58660:

Did you test edge_labels_background=None with or without dot2tex? It seems that without that it works incorreclty. I tested with

graphs.PetersenGraph().show(edge_labels=True, edge_labels_background=None)

You have to use

graphs.PetersenGraph().show(edge_labels=True, edge_labels_background="None")

because the parameter must be the string "None". I know this is not very intuitive, I'm looking for a way to make it clearer it the documentation if you have any idea.

@jm58660
Copy link
Mannequin

jm58660 mannequin commented May 29, 2017

comment:9

Ah, OK. I think that edge_labels_background="opaque" would work better.

@jm58660
Copy link
Mannequin

jm58660 mannequin commented May 29, 2017

comment:10

Replying to @jm58660:

Ah, OK. I think that edge_labels_background="opaque" would work better.

Nope, src/sage/plot/graphics.py uses "transparent" so better to use the same terminology.

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented May 30, 2017

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

94f5db1Trac #23071: Change the option from "None" to "transparent" to achieve a

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented May 30, 2017

Changed commit from 55eb667 to 94f5db1

@jm58660
Copy link
Mannequin

jm58660 mannequin commented May 30, 2017

comment:12

Now it seems good. Thanks for this.

@jm58660
Copy link
Mannequin

jm58660 mannequin commented May 30, 2017

Reviewer: Jori Mäntysalo

@vbraun
Copy link
Member

vbraun commented Jun 16, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants