从 geogebra 导入的 tikzpicture 图形周围有太多空间

从 geogebra 导入的 tikzpicture 图形周围有太多空间

我想减少文档的尺寸(我谈论的是边缘)。

代码是:

\documentclass[border=2pt]{standalone}
%\usepackage{tikz}
%\usetikzlibrary{calc}
\usepackage{pgf,tikz}
\usetikzlibrary{arrows}
%\usetikzlibrary{arrows.meta}
\begin{document}
\definecolor{qqqqff}{rgb}{0.0,0.0,1.0}
\definecolor{xdxdff}{rgb}{0.49019607843137253,0.49019607843137253,1.0}
\begin{tikzpicture}[line cap=round,line join=round,>=triangle 45,x=1.0cm,y=1.0cm]
\clip(-4.3,-5.419999999999998) rectangle (18.7,6.3);
\draw [->,line width=1.2pt] (0.0,0.0) -- (0.0,5.0);
\draw [->,line width=1.2pt] (0.0,0.0) -- (5.0,0.0);
\draw [line width=2.0pt] (0.0,0.0)-- (4.0,2.0);
\begin{scriptsize}
\draw [fill=black] (0.0,2.0) circle (2.5pt);
\draw[color=black] (-1.0,4.5) node {\huge $y$};
\draw[color=black] (4.5,-0.5) node {\huge $x$};
\end{scriptsize}
\end{tikzpicture}
\end{document}

我对文件边框的想法如图所示。

在此处输入图片描述

答案1

删除此行:

\clip(-4.3,-5.419999999999998) rectangle (18.7,6.3);

答案2

我几乎要问你为什么要剪辑,并建议你在你的绘图中放置一个临时网格(帮助线),然后我看到你导入了绘图......所以剪辑命令被你的其他软件放在那里模仿某种“表格”我猜,它有效地延伸了,而不是剪辑你的绘图...试试这个:

\documentclass[border=2pt]{standalone}
\usepackage{tikz}
\usetikzlibrary{arrows}
\begin{document}
\definecolor{qqqqff}{rgb}{0.0,0.0,1.0}
\definecolor{xdxdff}{rgb}{0.49,0.49,1.0}
  \begin{tikzpicture}[
     line cap=round,
     line join=round,
     >=triangle 45,
     x=1.0cm,y=1.0cm]

    \draw [->,line width=1.2pt] (0.0,0.0) -- (0.0,5.0);
    \draw [->,line width=1.2pt] (0.0,0.0) -- (5.0,0.0);
    \draw [line width=2.0pt] (0.0,0.0)-- (4.0,2.0);
    \begin{scriptsize}
      \draw [fill=black] (0.0,2.0) circle (2.5pt);
      \draw[color=black] (-1.0,4.5) node {\huge $y$};
      \draw[color=black] (4.5,-0.5) node {\huge $x$};
    \end{scriptsize}
  \end{tikzpicture}
\end{document}

相关内容