尝试在 Beamer 中绘制 XY 数据时出错

尝试在 Beamer 中绘制 XY 数据时出错

我正在尝试在 beamer (Overleaf) 中绘制 .csv 文件中的 XY 数据。我收到很多错误代码,但第一个代码如下所示:

LaTeX 错误:\begin{axis} 在输入第 9 行以 \end{beamer@framepauses} 结束。

我创建了另一个较小的文档,以便能够发布我的完整代码,如下所示:

\usepackage{pgfplots}
\usepackage{tikz}
\usepackage{wrapfig}
\usepackage{filecontents}

\setbeamertemplate{headline}{\includegraphics[width=\paperwidth]{KSU Header.png}}
\setbeamertemplate{footline}{\includegraphics[width=\paperwidth]{KSU Footer.png}}

\definecolor{purpleheart}{rgb}{0.41, 0.21, 0.61}
\usecolortheme[named=purpleheart]{structure}
    
\title{Nonlinear Numerical Analysis of Non-Planar Rectangular Hollow Structural Section Connections}
\author{Latex User}
\date{}

\titlegraphic{\includegraphics[width=2in]{KState Engineering Logo.jpg}}

\begin{document}
\maketitle
\begin{frame}[t,fragile]

\begin{wrapfigure}
\begin{tikzpicture}
\begin{axis}[
    x label style={at=(.50,-0.1)},
    x label/.style={at={(ticklabel cs:0.5)},anchor=near ticklabel},
    y label style={at={(current axis.above origin)},anchor=west},
    legend style={at={(.5,-0.65)},anchor= south, legend columns=1},
    ymin=0,ymax=70,
    xlabel = Local Displacement (in),
    every axis x label/.style=
        {at={(ticklabel cs:0.5)},anchor=near ticklabel},
    ylabel = Force (kip),
    every axis y label/.style=
        {at={(ticklabel cs:0.5)},rotate=90,anchor=near ticklabel},    
    xmin=0, xmax=40,
    xtick={0,0.02,...,0.2},,
x tick label style={rotate=45},
width=0.95\linewidth
]
\begin{scope}[
      every pin edge/.style={<-,>=latex, mark size=3pt},
      every pin/.append style={font=\large}]

\begin{filecontents}{Graph_Data.dat}
n   r     a        k 
1          100          100          100
2       95.721       98.645       98.738
4        82.31       93.497       93.295
8       56.667       63.901       63.838
16       46.536       52.572        53.31
32       45.399       53.421       53.318
\end{filecontents}

3-Percent Local Deformation Limit
\addlegendentry{3-Percent Local Deformation Limit}
\addplot[color = brown,dashed,thick] table [y=r, x=a]{Graph_Data.dat},
        \node[decoration=snake,coordinate,pin={[pin distance=1 in,pin edge={brown}]135:{45.4 kip, 3\% local $\delta$} } ]
            at (axis cs:0.12,45.4) {},
        \node[coordinate,pin={[pin distance=.5 in,pin edge={brown,thick}]45:{32.52 kip, 3\% $\delta$} } ]
            at (axis cs:0.12,48.35) {};           
            
\node[inner sep=0pt] (whitehead) at (axis cs:0.16,10)
    {\includegraphics[width=.25\textwidth]{Thesis Presentation/Chapter 3 Images/Bird Beak/JPEGs/Abaqus Flexure Displacement.pdf}};

\end{scope}
\end{axis}
\end{tikzpicture}
\caption{T-Specimen Compression Results}
\label{CornerMaterial}
\end{wrapfigure}

\end{frame}

\end{document}

错误显示的位置如下:

在此处输入图片描述

相关内容