Pregunta

I need to draw some undirected graphs with different coloured vertices. Previously I have been doing this the tedious way, by drawing every vertex as a circle and every edge as a straight line. Is there a way that I can do this easily by using the Bezier curve function? I have tried to do this, but can't work out how to add vertices to my lines!

¿Fue útil?

Solución

I'm guessing you want to create un-directed graphs with curved edges (since you mention Bezier curves).

I find that the easiest way to draw freestyle graphs is to lay down your vertices as circles (copy & paste for consistent size) and then use the "draw freehand lines" option (pencil icon) to connect the dots. Then you send the circles to the front layer, so the lines look like they start and end at the edges of your circles. If you really want to use Bezier curves instead of free hand, then the method applies just the same. Here's a sample I created using the first method.

graph picture

Hope this helps.

Otros consejos

So this answer uses an external tool as part of the process, but the end result is still a (good looking) graph inside of inkscape. So for anyone who wants relatively hassle free graphs inside inkscape (or other software) who stumbles across this question, hopefully this will be useful.

There is a (free) tool called the yEd Graph Editor which allows for simple creation of graphs, and after creating a graph you can copy them to the system clipboard (right-click menu) and paste them into inkscape. It requires installing an additional piece of software, but the process can be much faster than creating them manually in inkscape as yEd makes it easy to deal with things like layout, node style, edge style and similar.

This process works with other image software as well, both those that work in bitmap and vector graphics and yEd works with a wide range of graph types.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top