我使用 PGFPlots 创建图表并将其导出到我的主题演讲幻灯片中。我总是必须修剪导出的 pdf 文件的边。附件是此类图表的一个示例。我想知道是否有办法让情节自动适应 pdf 文件中的整个页面?
以下是生成图表的代码
\documentclass[a4paper]{article}
\usepackage{amsmath}
\usepackage{xcolor}
\usepackage{pgfplots}
\usepackage{pgfplotstable}%fitting functions
\usepackage{tikz}
\usetikzlibrary{tikzmark,patterns,pgfplots.fillbetween}
\pagestyle{empty}
\pgfkeys{/pgf/number format/.cd,fixed}
\pgfplotsset{compat=1.15}
\pgfplotsset{label style={font=\LARGE},
tick label style={font=\LARGE}}
\pgfplotsset{error bars/.cd,
x dir=both, x explicit,
y dir=both, y explicit,
}
\begin{document}
\begin{figure}
\centering
\begin{tikzpicture}
\begin{axis}[
enable tick line clipping=false, % makes all ticks same width
axis line style=semithick,
width=14cm,
height=7cm,
x tick style={black,semithick},
x label style=
{at={(ticklabel cs:0.5)},anchor=near ticklabel},
xlabel={$L$ [mm]},
xmin=0,xmax=100,
xtick={0,20,...,100},
xtick pos=bottom,
xtick align=outside,
y tick style={black,semithick},
y label style=
{at={(ticklabel cs:0.5)},anchor=near ticklabel},
ylabel={$F$ [N]},
ymin=-0.05,ymax=0.2,
ytick={-0.05,0,...,0.25},
ytick pos=left,
ytick align=outside,
]
\addplot [only marks,mark=*,mark options={scale=0.5,red,fill=white}] file {LDPE_PETG_2.txt};
\addplot [only marks,mark=*,mark options={scale=0.5,blue,fill=white}] file {LDPE-DOTO_PETG_2.txt};
\end{axis}
\end{tikzpicture}
\end{figure}
\end{document}