答案1
有很多种方法可以绘制这个,这里是其中一种。
\documentclass[tikz,border=3mm]{standalone}
\begin{document}
\begin{tikzpicture}[>=stealth,scale=0.5,line cap=round,
bullet/.style={circle,inner sep=1.5pt,fill}]
\draw[->] (-9,0) -- (9,0) node[right]{$x$};
\draw[->] (0,-7) -- (0,7) node[above]{$y$};
\draw foreach \X in {3,6}
{(\X,0.1) -- ++ (0,-0.2) node[below]{$\X$}};
\draw foreach \Y in {2,4}
{(0.1,\Y) -- ++ (-0.2,0) node[left]{$\Y$}};
\foreach \X [count=\Y] in {(6,2),(3,4)}
{\path \X node(n\Y)[bullet,label=right:{$\X$}]{};
\draw[thick,->] (0,0) -- (n\Y);}
\end{tikzpicture}
\end{document}
或者
\documentclass[tikz,border=3mm]{standalone}
\begin{document}
\begin{tikzpicture}[>=stealth,scale=0.5,line cap=round,
bullet/.style={circle,inner sep=1.5pt,fill}]
\draw[->] (-9,0) -- (9,0) node[right]{$x$};
\draw[->] (0,-7) -- (0,7) node[above]{$y$};
\draw foreach \X in {3,6}
{(\X,0.1) -- ++ (0,-0.2) node[below]{$\X$}};
\draw foreach \Y in {2,4}
{(0.1,\Y) -- ++ (-0.2,0) node[left]{$\Y$}};
\path (0,0) coordinate (O)
(6,2) node[bullet,label=right:{$(6,2)$}](A){}
(3,4) node[bullet,label=right:{$(3,4)$}](B){}
(O) edge[thick,->] (A) edge[thick,->] (B);
\end{tikzpicture}
\end{document}
答案2
使用新版本3.02c
(tkz-euclide
我正在为此发现),您会得到以下信息:
一些解释以代码中的注释形式给出。
\documentclass{article}
\usepackage{tkz-euclide}
\usetikzlibrary{arrows.meta}
\begin{document}
\begin{tikzpicture}[vect/.style={->,>={Straight Barb[angle=60:2pt 3]}}]
\tkzInit[xmin=-3,xmax=6,ymin=-1,ymax=6]% dimensions of the bounding box
\tkzDrawXY[noticks,>=latex]% draw the 2 axis
\tkzDefPoint(0,0){O}
\tkzDefPoint(3,4){A}
\tkzDefPoint(6,2){B}
\tkzPointShowCoord[-,xlabel=$3$,ylabel=$4$,thin,gray,xstyle={below=4pt}](A)% show the coordonates
\tkzPointShowCoord[-,xlabel=$6$,ylabel=$2$,thin,gray,xstyle={below=4pt}](B)
\tkzDrawSegments[vect](O,A O,B)
\end{tikzpicture}
\end{document}