我尝试将 3 个元素对齐到两列,第二列有两个元素垂直堆叠。下面是一张说明我的意思的图片:
这是我当前的代码:
\documentclass[12pt]{article}
\usepackage{textcomp}
\usepackage{multirow}
\usepackage{gensymb}
\usepackage{pgfplots}
\usepackage{graphicx}
\begin{document}
$l = 185m$; \\
$S = 5 \cdot 10^{-9}m^2$;\\
$\lambda = 4,24 \cdot 10^{-3} K^{-1}$;
\begin{tabular} { | c | c |}
\hline
$t_i$ & $R_i$ \\ \hline
23,4 & $0,620 \cdot 10^3$ \\ \hline
25,4 & $0,623 \cdot 10^3$ \\ \hline
27,4 & $0,626 \cdot 10^3$ \\ \hline
29,4 & $0,631 \cdot 10^3$ \\ \hline
31,4 & $0,635 \cdot 10^3$ \\ \hline
33,4 & $0,640 \cdot 10^3$ \\ \hline
35,4 & $0,644 \cdot 10^3$ \\ \hline
37,4 & $0,649 \cdot 10^3$ \\ \hline
29,4 & $0,653 \cdot 10^3$ \\ \hline
41,4 & $0,658 \cdot 10^3$ \\ \hline
43,4 & $0,663 \cdot 10^3$ \\ \hline
45,4 & $0,667 \cdot 10^3$ \\ \hline
47,4 & $0,672 \cdot 10^3$ \\ \hline
49,4 & $0,677 \cdot 10^3$ \\ \hline
51,4 & $0,682 \cdot 10^3$ \\ \hline
53,4 & $0,687 \cdot 10^3$ \\ \hline
55,4 & $0,692 \cdot 10^3$ \\ \hline
57,4 & $0,696 \cdot 10^3$ \\ \hline
59,4 & $0,701 \cdot 10^3$ \\ \hline
\end{tabular}
\begin{tikzpicture}
\begin{axis}[
title={$R = f(t)$},
xlabel={Temperatūra (\textdegree C)},
ylabel={Varža ($\Omega)$},
ymax=700,
xmin=23.4,
ymajorgrids=true,
grid style=dashed,
]
\addplot[
color=blue,
mark=square,
]
coordinates {
(23.4, 620)(25.4, 623)(27.4, 626)(29.4, 631)(31.4, 635)(33.4, 640)(35.4, 644)(37.4, 649)(39.4, 653)(41.4, 658)(43.4, 663)(45.4, 667)(47.4, 672)(49.4, 677)(51.4, 682)(53.4, 687)(55.4, 692)(57.4, 696)(59.4, 701)
};
\end{axis}
\end{tikzpicture}
答案1
像这样?
通过使用 MWE 序言中加载的包,我对您的 MWE 进行了如下重新设计:
\documentclass{article}
%\usepackage{geometry}
\usepackage{siunitx}
\sisetup{output-decimal-marker={,}}
\usepackage{booktabs, tabularx}
\usepackage{pgfplots}
%---------------------------------------------------------------%
\usepackage{showframe}% only for show page layout
\renewcommand\ShowFrameLinethickness{0.15pt}
\renewcommand*\ShowFrameColor{\color{red}}
%---------------------------------------------------------------%
\begin{document}
\begin{figure}
\begin{tabularx}{\textwidth}{@{}>{\hsize=0.25\hsize}X
>{\hsize=0.75\hsize}X
@{} }
\begin{tabular} {S[table-format=2.1]
S[table-format=1.3,
table-figures-exponent=1]}
\toprule
{$t_i$} & {$R_i$} \\
\midrule
23,4 & 0,620e3 \\
25,4 & 0,623e3 \\
27,4 & 0,626e3 \\
29,4 & 0,631e3 \\
31,4 & 0,635e3 \\ \addlinespace
33,4 & 0,640e3 \\
35,4 & 0,644e3 \\
37,4 & 0,649e3 \\
29,4 & 0,653e3 \\
41,4 & 0,658e3 \\ \addlinespace
43,4 & 0,663e3 \\
45,4 & 0,667e3 \\
47,4 & 0,672e3 \\
49,4 & 0,677e3 \\
51,4 & 0,682e3 \\ \addlinespace
53,4 & 0,687e3 \\
55,4 & 0,692e3 \\
57,4 & 0,696e3 \\
59,4 & 0,701e3 \\
\bottomrule
\end{tabular}
&
\begin{tabular}{c}
\addlinespace % emulate vertical space of toprule in the table on the left
$l = \SI{185}{m}$; \\
$S = \SI{5e-9}{\square\metre}$;\\
$\lambda = \SI{4,24e-3}{\per\kelvin}$;\\
\addlinespace[2em]
\begin{tikzpicture}
\begin{axis}[
title={$R = f(t)$},
xlabel={Temperatūra (\si{\degreeCelsius})},
ylabel={Varža (\si{\ohm})},
ymax=700,
xmin=23.4,
ymajorgrids=true,
grid style=dashed,
]
\addplot[color=blue,mark=square]
coordinates {
(23.4, 620)(25.4, 623)(27.4, 626)(29.4, 631)(31.4, 635)(33.4, 640)(35.4, 644)(37.4, 649)(39.4, 653)(41.4, 658)(43.4, 663)(45.4, 667)(47.4, 672)(49.4, 677)(51.4, 682)(53.4, 687)(55.4, 692)(57.4, 696)(59.4, 701)
};
\end{axis}
\end{tikzpicture}
\end{tabular}
\end{tabularx}
\caption{My figure with table \dots}
\label{fig:important figure}
\end{figure}
\end{document}