5

I want to draw math diagrams, which I think falls in the category of vector graphics.

I used the Tex package TikZ for a long time, but the language is not clean enough for me and feels like a hack rather than a proper tool. For example there are so many backslashes e.g.

\foreach \x in {0,...,4} {
      \foreach \y in {\x,...,4} {
        \x --["\ifthenelse{\x=3 \OR \y=3 \OR \x=\y}{}{\x\y}",sloped] \y;
  }}

Then I tried gnuplot, which seems to focus on plotting data rather than drawing diagrams. For example, to draw a simple circle, I need to plot NaN after set object X circle ...:

set xrange [-5:5]
set yrange [-5:5]
set object 1 circle at 0,0 size char 1 fillcolor rgb "black" fillstyle solid
plot NaN

I also tried inkscape, but with its graphical interface, I hate looking for the correct button to click and prefer a markup-language type of tool.

I am going to try asymptote now. Meanwhile, can anyone recommend a good vector graphics markup language that is convenient for creating math diagrams?

1 Answer 1

2

Cairo

Cairo is a library for creating 2D vector graphics. If you are already familiar with a well-known programming language, then Cairo most likely has a library for it. This means that you don't have to spend time learning a foreign syntax. It has bindings with Python, Perl, C++, Java, and many others (see complete list). So you could use it with your preferred programming language. Features:

  • Outputs in different formats, including svg for vector images
  • Intuitive syntax
  • Libraries for many common languages
  • Is also integrated with some graphical toolkits (like GTK+ for Gimp)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.