我怎样才能将表格和图形(图形)并排放置,并为每个表格和图形添加单独的标题?

我怎样才能将表格和图形(图形)并排放置,并为每个表格和图形添加单独的标题?

我正在尝试将这个表格放在页面左侧,并将图表放在右下方。它们都有自己的标题。我听说过 \minipage 和 \floatrow,但我不知道最好的方法是什么。

\documentclass[a4paper,10pt]{article}
\usepackage{tabularx} % extra features for tabular environment
\usepackage{amsmath}  % improve math presentation
\usepackage{graphicx} % takes care of graphic including machinery
\usepackage[margin=0.75in,a4paper]{geometry} % decreases margins
\usepackage{cite} % takes care of citations
\usepackage[final]{hyperref} % adds hyper links inside the generated pdf file
\usepackage{floatrow}
\hypersetup{
    colorlinks=true,       % false: boxed links; true: colored links
    linkcolor=blue,        % color of internal links
    citecolor=blue,        % color of links to bibliography
    filecolor=magenta,     % color of file links
    urlcolor=blue         
}
%++++++++++++++++++++++++++++++++++++++++


\begin{document}
    \begin{figure}
        \centering
        \label{fig:graphmeasurements} 
        \includegraphics[width=0.7\columnwidth]{graphmeasurements}
        \caption{
                 % spaces are big no-no withing labels
                % things like fig: are optional in the label but it helps
                % to orient yourself when you have multiple figures,
                % equations and tables
                Graph of all measurements taken during the experiment.
        }
\end{figure}

\begin{table}
\begin{center}
\caption{Current readings for first dip.}
\label{tbl:dip1} % spaces are big no-no withing labels
\begin{tabular}{| c | c |} 
\hline
\multicolumn{1}{|c|}{Potential (V)} & \multicolumn{1}{c|}{Current (nA)} \\
\hline
8.25 &   0.5000\\
8.55 &   0.4950\\
8.77 &   0.4900\\
9.02 &   0.4900\\
9.25 &   0.5100\\
9.50 &   0.5200\\
9.75 &   0.5800\\
9.99 &   0.6000\\
\hline
\end{tabular}
\end{center}
\end{table}

\begin{figure}
        \centering
        \label{fig:dip1} 
        \includegraphics[width=0.4\columnwidth]{dip1}
        \caption{
                 % spaces are big no-no withing labels
                % things like fig: are optional in the label but it helps
                % to orient yourself when you have multiple figures,
                % equations and tables
                Graph of all measurements taken during the experiment.
        }
\end{figure}

\begin{table}
\begin{center}
\caption{Current readings for second dip.}
\label{tbl:dip1} % spaces are big no-no withing labels
\begin{tabular}{| c | c |} 
\hline
\multicolumn{1}{|c|}{Potential (V)} & \multicolumn{1}{c|}{Current (nA)} \\
\hline
13.00 &   1.1300\\
13.24 &   1.1000\\
13.48 &   1.0000\\
13.75 &   0.8500\\
14.01 &   0.9000\\
14.25 &   1.0500\\
14.51 &   1.0750\\
14.74 &   1.1500\\
\hline
\end{tabular}
\end{center}
\end{table}

\begin{figure}
        \centering
        \label{fig:dip2} 
        \includegraphics[width=0.4\columnwidth]{dip2}
        \caption{
                 % spaces are big no-no withing labels
                % things like fig: are optional in the label but it helps
                % to orient yourself when you have multiple figures,
                % equations and tables
                Graph of all measurements taken during the experiment.
        }
\end{figure}

\begin{table}
\begin{center}
\caption{Current readings for third dip.}
\label{tbl:dip1} % spaces are big no-no withing labels
\begin{tabular}{| c | c |} 
\hline
\multicolumn{1}{|c|}{Potential (V)} & \multicolumn{1}{c|}{Current (nA)} \\
\hline
18.50 &   2.1000\\
18.75 &   2.0000\\
19.00 &   1.9000\\
19.26 &   1.8000\\
19.50 &   1.8000\\
19.75 &   1.9000\\
19.99 &   2.0000\\
20.27 &   2.1000\\
20.48 &   2.2500\\
20.75 &   2.5000\\
\hline
\end{tabular}
\end{center}
\end{table}

\begin{figure}
        \centering
        \label{fig:dip3} 
        \includegraphics[width=0.4\columnwidth]{dip3}
        \caption{
                 % spaces are big no-no withing labels
                % things like fig: are optional in the label but it helps
                % to orient yourself when you have multiple figures,
                % equations and tables
                Graph of all measurements taken during the experiment.
        }
\end{figure}

\begin{table}
\begin{center}
\caption{Current readings for fourth dip.}
\label{tbl:dip1} % spaces are big no-no withing labels
\begin{tabular}{| c | c |} 
\hline
\multicolumn{1}{|c|}{Potential (V)} & \multicolumn{1}{c|}{Current (nA)} \\
\hline
23.52 &   3.2000\\
23.84 &   2.9500\\
24.07 &   2.7500\\
24.29 &   2.7000\\
24.51 &   2.6500\\
24.76 &   2.7000\\
24.99 &   2.7000\\
25.26 &   3.0000\\
25.50 &   3.1000\\
25.76 &   3.3500\\
\hline
\end{tabular}
\end{center}
\end{table}

\begin{figure}
        \centering
        \label{fig:dip4} 
        \includegraphics[width=0.4\columnwidth]{dip4}
        \caption{
                 % spaces are big no-no withing labels
                % things like fig: are optional in the label but it helps
                % to orient yourself when you have multiple figures,
                % equations and tables
                Graph of all measurements taken during the experiment.
        }
\end{figure}
\end{document}

答案1

根据您的问题标题,我猜您正在寻找类似这样的内容:

在此处输入图片描述

(红线表示文本区域边框)

我说得对吗?

编辑: 我将您的文档缩减为 MWE(最小工作示例),其中我从其序言中仅考虑与您的问题相关的包以及组合表/图像的一个示例。由此生成了上面的图像。

如您所见,表格和图片位于同一个浮点数中,table图片标题使用captionof{figure}{<caption text>}数字编号。图片垂直居中,由valign=c包中的选项决定adjustbox

\documentclass[a4paper,10pt]{article}
\usepackage[margin=0.75in]{geometry} % decreases margins
\usepackage{tabularx} % extra features for tabular environment
\usepackage{caption}  % new
\usepackage[export]{adjustbox}% it also load "graphicx"
                              % needed for "valign=c" option

%---------------- show page layout. don't use in a real document!
\usepackage{showframe}
\renewcommand\ShowFrameLinethickness{0.15pt}
\renewcommand*\ShowFrameColor{\color{red}}
%---------------------------------------------------------------%

\begin{document}
\documentclass[a4paper,10pt]{article}
\usepackage[margin=0.75in]{geometry} % decreases margins
\usepackage{tabularx} % extra features for tabular environment
\usepackage{caption}  % new
\usepackage[export]{adjustbox}%  it also load "graphicx"

%---------------- show page layout. don't use in a real document!
\usepackage{showframe}
\renewcommand\ShowFrameLinethickness{0.15pt}
\renewcommand*\ShowFrameColor{\color{red}}
%---------------------------------------------------------------%

\begin{document}

\begin{table}[ht]
\centering
    \begin{tabularx}{\linewidth}{*{2}{>{\centering\arraybackslash}X}}
\begin{tabular}{| c | c |}
\hline
Potential (V)   &   Current (nA)    \\
\hline
8.25 &   0.5000\\
8.55 &   0.4950\\
8.77 &   0.4900\\
9.02 &   0.4900\\
9.25 &   0.5100\\
9.50 &   0.5200\\
9.75 &   0.5800\\
9.99 &   0.6000\\
\hline
\end{tabular}
    &   \includegraphics[width=\linewidth,valign=c]{example-image-duck} \\
%
\caption{Current readings for first dip.}
\label{tbl:dip1}
    &   \captionof{figure}{Graph of the first current trough.}
        \label{fig:dip1}
\end{tabularx}
    \end{table}
\end{document}

相关内容