我在 geogebra 中创建了这个 tikzpicture。我只想要运行后图片中显示的矢量而不是坐标轴。我不知道如何设置给出的代码以便删除轴并只获取下面显示的 $\overrightarrow{OP}$。
\documentclass[10pt]{article}
\usepackage{pgf,tikz,pgfplots}
\pgfplotsset{compat=1.15}
\usepackage{mathrsfs}
\usetikzlibrary{arrows}
\pagestyle{empty}
\begin{document}
\begin{tikzpicture}[line cap=round,line join=round,>=triangle 45,x=1.0cm,y=1.0cm]
\begin{axis}[
x=1.0cm,y=1.0cm,
axis lines=middle,
xmin=4.8,
xmax=8.9,
ymin=3.0,
ymax=5.0,
xtick={5.0,6.0,...,8.0},
ytick={3.0,4.0,...,5.0},]
\clip(4.8,3.) rectangle (8.9,5.);
\draw [->,line width=2.pt] (4.99090909090911,3.607272727272724) -- (8.445454545454574,4.807272727272722);
\draw (4.9181818181818375,3.7709090909090874) node[anchor=north west] {$\text{O}$};
\draw (8.245454545454573,4.934545454545449) node[anchor=north west] {$\text P$};
\draw (6.354545454545478,4.898181818181813) node[anchor=north west] {$\overrightarrow{OP}$};
\end{axis}
\end{tikzpicture}
\end{document}
答案1
正如@DG 所提到的,删除axis
环境
\documentclass[10pt]{article}
\usepackage{tikz}
\usepackage{mathrsfs}
\usetikzlibrary{arrows}
\begin{document}
\begin{tikzpicture}[line cap=round,line join=round,>=triangle 45,x=1.0cm,y=1.0cm]
\draw [->,line width=2.pt]
(5,3.6)node[below]{$O$}
--node[above left]{$\overrightarrow{OP}$}
(8.4,4.8)node[below]{$P$};
\end{tikzpicture}
\end{document}