Message Boards Message Boards

0
|
2982 Views
|
2 Replies
|
0 Total Likes
View groups...
Share
Share this post:

Draw a graph with zero-size vertices

Posted 9 years ago

How can I draw only the edges of a graph but not the vertices?

I am looking for something like

RandomGraph[{10, 20}, VertexShapeFunction -> None]

but the edges should start and end precisely in the vertex coordinate. There should be no space left for a vertex. If there a way through Graph, and not manually constructing it using Graphics?

POSTED BY: Szabolcs Horvát
2 Replies

By default the edges are "foreshortened". You get full edges with an appropriate EdgeShapeFunction, for example

RandomGraph[{10, 20}, EdgeShapeFunction -> (Line[#1] &), 
 VertexShapeFunction -> None]
POSTED BY: Gianluca Gorni

Thank you, I didn't realize that it was the edge shape function doing it.

POSTED BY: Szabolcs Horvát
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract