Tikz

You are currently browsing the archive for the Tikz category.

我开始学习如何利用LaTeX的Tikz绘制图形.下面是我学习过程中绘制的一些例子.

\begin{tikzpicture}[domain=-2:3,scale=0.6]
  \draw[thick,->] (-2,0) -- (4.5,0) node[right] {$x$};
  \draw[thick,->] (0,-2) -- (0,5.8) node[above] {$y$};
  \draw[thick,color=red] plot (\x,{-1.4*\x +3}) node[right] {$l_{2}$};
  \draw[thick,color=blue] plot (\x,{-0.5*\x+ 2}) node[right] {$l_{3}$};
  \draw[thick,color=brown] plot (\x,{1.2*\x +1}) node[right]{$l_{1}$};
\end{tikzpicture}
\begin{tikzpicture}[scale=0.6]
\draw[-latex](-4,0) -- (5,0) node[below]{$x$};
\draw[-latex](0,-4) -- (0,6) node[right]{$y$};
\draw[help lines,dashed,color=black] ( -4,-4 ) grid ( 5, 6);
\fill (1,4) circle (3pt) node[right]{$C$};
\fill (1,2) circle (3pt) node[right]{$B$};
\fill (1,-2) circle (3pt) node[right]{$D$};
\fill (0,0) circle (0pt) node[anchor=north east]{$O$};
\draw[thick,color=blue] (-1.5,-3) -- (3,6);
\draw[thick,color=red] (-0.8,-3.2) -- (1.5,6);
\draw[thick,color=brown](-3,6) -- (1.5,-3);
\end{tikzpicture}
\begin{tikzpicture}[domain=-6:8,scale=0.4]
\draw[-latex](-8,0) -- (9,0) node[below]{$x$};
\draw[-latex](0,-5) -- (0,10) node[left]{$y$};
\draw[help lines,dashed,color=black] ( -8,-5 ) grid (9,10);
\fill (-4,6) circle (6pt);
\fill (-1,5) circle (6pt);
\fill (4,3) circle (6pt);
\fill (4,5) circle (6pt);
\fill (2,5) circle (6pt);
\fill (1,1) circle (6pt);
\fill (0,0) circle (6pt) node[anchor=north east]{$O$};
\fill (-2,1) circle (6pt);
\fill (1,6) circle (6pt);
\draw[thick]   plot (\x,{6})    node[right] {$l_{5}$};
\draw[thick] (-6,9)--(2,-3) node[right]{$l_{3}$};
\draw[thick](-5,-1)node[left]{$l_{1}$}--(7,7);
\draw[thick](0.2,-2.2)--(3,9) node[right]{$l_{2}$};
\draw[thick](-6,7)--(8,1.4)node[right]{$l_{4}$};
\end{tikzpicture}

Tags: