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

Nodes with not labels are not drawn #177

Open
diegozea opened this issue Feb 24, 2022 · 1 comment
Open

Nodes with not labels are not drawn #177

diegozea opened this issue Feb 24, 2022 · 1 comment

Comments

@diegozea
Copy link
Collaborator

As the node sizes are scaled to fit their labels, nodes without labels aren't drawn. Maybe we can use a minimum node size to handle those cases. Example of the problem:

image

Code (Plots 1.25.11 and GraphRecipes 0.5.9):

using Graphs, Plots, GraphRecipes
graph = smallgraph(:karate)
begin
	node_labels = fill("", nv(graph))
	node_labels[1] = "Mr. Hi"
	node_labels[34] = "John A"
end
graphplot(graph, names=node_labels)
@originalsouth
Copy link

As a workaround can add a space when you fill the array:

using Graphs, Plots, GraphRecipes
graph = smallgraph(:karate)
begin
	node_labels = fill(" ", nv(graph)) # <------- note the space difference 
	node_labels[1] = "Mr. Hi"
	node_labels[34] = "John A"
end
graphplot(graph, names=node_labels)

Tested with plotly and with gr.

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

No branches or pull requests

2 participants