1

For example, I wish to draw simple figures such enter image description here

or

enter image description here

and include them as vector graphics in Latex documents

Is TikZ the most appropriate tool to use? Meaning, how difficult/time consuming would it be as compared to some other method. And what other methods are competitive or even preferable to Tikz?

2
  • Although the accepted answer is a TikZ one, I think this wins. MetaPost is quite good for a "cartoonish" effect or for anything else that requires manipulation of paths. Apr 28 at 0:55
  • 1
    If you want to draw this kind of thing manually directly in TikZ, it could really be a pain. If you absolutely want vector graphics in your documents, then I recommand to do them with an appropriate VG software and export them in TikZ.
    – SebGlav
    Apr 28 at 7:31
1

Drawing this type of figures in TikZ is rather complicated.

For example, consider the fantastic TikZlings package by Sam Carter. This package contains TikZ drawings for various animals, like this owl:

enter image description here

The basic code for this drawing is (more or less, edited to remove customization options):

% Arms %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\owl@part@draw[\owl@body] (0.575,0.8) ellipse[x radius=0.38, y radius=0.1, rotate=-80];
\owl@part@draw[\owl@body] (-0.575,0.8) ellipse[x radius=0.38, y radius=0.1, rotate=80]; 
%
% Body %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\owl@part@draw[\owl@body] (0.595, 0.92) .. controls (0.595, 0.26) and (0.355, 0.18) .. (0, 0.18) .. controls (-0.355, 0.18) and (-0.595, 0.26) .. (-0.595, 0.92) .. controls (-0.605, 1.58) and (-0.335, 2.11) .. (0, 2.11) .. controls (0.335, 2.11) and (0.605, 1.58) .. (0.595, 0.92) -- cycle;
%
% Ears %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\owl@part@draw[\owl@body] (-0.6361, 1.777) .. controls   (-0.6361, 1.777) and   (-0.7586, 1.9603) ..   (-0.6759, 2.2145) .. controls   (-0.3248, 1.912) and   (0.3248, 1.912) ..   (0.6759, 2.2145) .. controls   (0.7586, 1.9603) and   (0.6361, 1.777) ..   (0.6361, 1.777);
%
% Belly %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\owl@part@draw[\owl@body!50!white] (0.425,0.5) .. controls (0.425,0.31) and (0.245,0.27) .. (0,0.27) .. controls (-0.245,0.27) and (-0.425,0.31) .. (-0.425,0.5) .. controls (-0.425,0.81) and (-0.225,0.98) .. (0,0.98) .. controls (0.225,0.98) and (0.425,0.81) .. (0.425,0.5) -- cycle;
%
% head %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\owl@part@draw[\owl@body] (0,1.55) ellipse[x radius=0.7, y radius=0.55];
%
% Eyes %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\fill[\owl@eye] (-0.28, 1.6) circle[radius=0.22];
\fill[\owl@eye] (0.28, 1.6) circle[radius=0.22];

\owl@part@draw[\owl@pupil]   (-0.28, 1.6) circle[radius=0.15];
\owl@part@draw[\owl@pupil]   (0.28, 1.6) circle[radius=0.15];
\owl@part@draw[white] (0.25, 1.64) circle[radius=0.03];
\owl@part@draw[white] (-0.31, 1.64) circle[radius=0.03];
%
% Bill %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\owl@part@draw[\owl@bill] (0, 1.4) -- (-0.1, 1.3) -- (0, 1.15) -- (0.1, 1.3) -- cycle;
%
% Feet %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\owl@part@draw[\owl@feet] (0.175,0.2) ellipse[x radius=0.03, y radius=0.1];
\owl@part@draw[\owl@feet] (0.225,0.21) ellipse[x radius=0.03, y radius=0.1, rotate=20];
\owl@part@draw[\owl@feet] (0.275,0.23) ellipse[x radius=0.03, y radius=0.1, rotate=40];
\owl@part@draw[\owl@feet] (-0.175,0.2) ellipse[x radius=0.03, y radius=0.1];
\owl@part@draw[\owl@feet] (-0.225,0.21) ellipse[x radius=0.03, y radius=0.1, rotate=-20];
\owl@part@draw[\owl@feet] (-0.275,0.23) ellipse[x radius=0.03, y radius=0.1, rotate=-40];

As you can see this is not easy to make, note especially all the coordinates that need to be set to appropriate values.

Drawing in a vector graphics editor with a graphical user interface is likely to be easier/competitive/preferable for this type of drawing (unless you are Sam Carter or a marmot). Wikipedia has a list on https://en.wikipedia.org/wiki/Comparison_of_vector_graphics_editors that contains many suitable programs.

1
  • samcarter uses a graphical interface too, many of the tikzlings have been drafted in inkscape. Apr 28 at 12:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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