经过一夜的搜索,可能tikz应该是用代码画图功能最强的工具了…

draw

\documentclass{standalone}
\usepackage{tikz}
\usetikzlibrary{patterns}

\begin{document}

\begin{tikzpicture}
%  draw
\draw (0,0) parabola (10,10);
\draw (0,0) .. controls (0,10) and (10,0) .. (10,10);
\draw (5,5) circle (3cm);
% \draw (5,5) circle (3); same as above
\draw (5,5) circle (3pt);
\draw (5,5) ellipse (3cm and 1cm);
\draw (0,10) arc (90:-90:5);
% 注意这里arc后面是[]
\draw (0,10) arc [start angle=90,end angle=-90,x radius=3,y radius=5];
\draw[red,thick,dashed] (5,5) circle (2);
\draw[step=1cm,green,very thin] (0,0) grid (10,10);

% fill
\fill[blue!40!white] (8,2) rectangle (10,0);
\filldraw[fill=blue!40!white,draw=yellow] (8,4) rectangle (10,2);

% shade
\shade[left color=green,right color= red] (6,0) rectangle (8,2);

% axesu
\draw[thick,->] (0,0) - - (10,0) node[anchor=north west]{x axis};
\draw[thick,->] (0,0) - - (0,10) node[anchor=south east]{y axis};

% foreach
\foreach \x in {0,...,10}
  \draw (\x cm,1pt) - - (\x cm,-1pt) node[anchor=north] {$\x$};

\foreach \x in {0,...,10}
  \draw (1pt,\x) - - (-1pt,\x) node[anchor=east] {$\x$};

\end{tikzpicture}

\end{document}

flowchart

\documentclass{standalone}
\usepackage{tikz}
\usetikzlibrary{patterns}
\usetikzlibrary{shapes.geometric,arrows}

\begin{document}

\begin{tikzpicture}[node distance=2cm]
\tikzstyle{startstop} = [rectangle,rounded corners,minimum width=3cm,minimum height=1cm,text centered,draw=black,fill=red!30];
\tikzstyle{io} = [trapezium,trapezium left angle=70,trapezium right angle=110,minimum width=3cm,minimum height=1cm,text centered,draw=black,fill=blue!30]
\tikzstyle{process} = [rectangle, minimum width=3cm, minimum height=1cm, text centered, draw=black, fill=orange!30]
\tikzstyle{decision} = [diamond, minimum width=3cm, minimum height=1cm, text centered, draw=black, fill=green!30]
\tikzstyle{arrow} = [thick,->,>=stealth]

\node (start) [startstop] {Start};
\node (in1) [io,below of = start] {Input};
\node (pro1) [process,below of = in1] {Process 1};
\node (pro2) [process,below of = pro1] {Process 2};
\node (dec1) [decision,below of = pro2,yshift=-0.5cm] {Decision 1};
\node (pro2a) [process, below of=dec1, yshift=-0.5cm] {Process 2a};
\node (pro2b) [process, right of=dec1, xshift=2cm] {Process 2b};
\node (out1) [io, below of=pro2a] {Output};
\node (stop) [startstop, below of=out1] {Stop};


\draw [arrow] (start) -- (in1);
\draw [arrow] (in1) -- (pro1);
\draw [arrow] (pro1) -- (pro2);
\draw [arrow] (pro2) -- (dec1);
\draw [arrow] (dec1) -- (pro2a);
\draw [arrow] (dec1) -- (pro2b);
\draw [arrow] (dec1) -- node[anchor=east] {yes} (pro2a);
\draw [arrow] (dec1) -- node[anchor=south] {no} (pro2b);
\draw [arrow] (pro2b) |- (pro1);
\draw [arrow] (pro2a) -- (out1);
\draw [arrow] (out1) -- (stop);
\end{tikzpicture}

\end{document}

Venn diagram

\documentclass{standalone}
\usepackage{tikz}
\usetikzlibrary{patterns}
\usetikzlibrary{shapes.geometric,arrows}
\begin{document}
\begin{tikzpicture}
  \begin{scope}[blend group = soft light]
    \fill[red!30!white]   ( 90:1.2) circle (2);
    \fill[green!30!white] (210:1.2) circle (2);
    \fill[blue!30!white]  (330:1.2) circle (2);
  \end{scope}
  \node at ( 90:2)    {Typography};
  \node at ( 210:2)   {Design};
  \node at ( 330:2)   {Coding};
  \node [font=\Large] {\LaTeX};
\end{tikzpicture}
\end{document}

我很好奇