两个上下重叠的环绕图,包含多个段落

两个上下重叠的环绕图,包含多个段落

我有以下 MWE:

\documentclass[]{scrbook}

\usepackage{wrapfig}
\usepackage{graphicx}

\begin{document}

\begin{wrapfigure}[15]{r}{0.35\textwidth}
%\vspace{\baselineskip}
\centering
\includegraphics[width=\linewidth]{example-image.png}
\caption{An example of the visualization of the cumulative sum.}
\end{wrapfigure}
\paragraph{Cumulative Sum} visually inspects the similarity between the distributions per column, the cumulative sum of each column for both $\mathcal{R}$ and $\mathcal{F}$ on top of each other are plotted.
This gives a thorough understanding of a column with just one plot, and works for both categorical and continuous columns. Note that this plot does not give any insights into the relations between columns, giving it limited representational power for the whole table. 

\begin{wrapfigure}[]{r}{0.35\textwidth}
%\vspace{-5\baselineskip}
\centering
\includegraphics[width=\linewidth]{example-image.png}
\caption{An example of the visualization of the distribution.}
\end{wrapfigure}
\paragraph{Distribution} 
simply shows the distribution of the values of each column plotted with the value on the x-axis and the probability on the y-axis. The bar chart in the background of the figure shows how often values from a certain range (bin) appeared in this specific column of each, $\mathcal{R}$ and $\mathcal{F}$.

\paragraph{Correlations} is the fourth visualization. It shows a association table for the real and synthetic data. It gives a clear understanding of what columns have associations with each other, and shows where the synthetic data diverges, indicating struggles that the model had with learning this relationship. Associated columns are coloured in red, disassociated columns in blue. For univariate datasets like the MonthlyMilkProduction dataset this plot was not being created, as it would just be completely red as this dataset only contains one column.
\vspace{3\baselineskip}
\begin{figure}[ht!]
\includegraphics[width=\linewidth]{example-image.png}
\caption{An example of the visualization of the correlations via an association table.}
\label{fig:exampleasso}
\end{figure}

\end{document}

我希望两个环绕图位于彼此上方,第三个图位于文本下方。这效果不太好,而且我还收到警告。有人知道如何避免此警告并使其看起来更美观吗?

答案1

像这样?

在此处输入图片描述

您需要将两幅图像放在同一个位置,wrapfig并相应地设置其跨越的垂直线数。此外,我还将删除文本和后面的图形之间添加的垂直空间,并定义标题样式(参见下面的 MWE):

\documentclass[]{scrbook}

\usepackage{wrapfig}
\usepackage{graphicx}
\usepackage[skip=1ex, , belowskip=1ex,
            font=small, labelfont=bf,
            format=plain,
            ]{caption}  % new

\begin{document}

    \begin{wrapfigure}[16]{r}{0.35\textwidth}
    \includegraphics[width=\linewidth]{example-image-duck}
    \caption{An example of the visualization of the cumulative sum.}

    \includegraphics[width=\linewidth]{example-image-duck}
    \caption{An example of the visualization of the distribution.}
    \end{wrapfigure}
\paragraph{Cumulative Sum} visually inspects the similarity between the distributions per column, the cumulative sum of each column for both $\mathcal{R}$ and $\mathcal{F}$ on top of each other are plotted.
This gives a thorough understanding of a column with just one plot, and works for both categorical and continuous columns. Note that this plot does not give any insights into the relations between columns, giving it limited representational power for the whole table.

\paragraph{Distribution}
simply shows the distribution of the values of each column plotted with the value on the x-axis and the probability on the y-axis. The bar chart in the background of the figure shows how often values from a certain range (bin) appeared in this specific column of each, $\mathcal{R}$ and $\mathcal{F}$.

\paragraph{Correlations} is the fourth visualization. It shows a association table for the real and synthetic data. It gives a clear understanding of what columns have associations with each other, and shows where the synthetic data diverges, indicating struggles that the model had with learning this relationship. Associated columns are coloured in red, disassociated columns in blue. For univariate datasets like the MonthlyMilkProduction dataset this plot was not being created, as it would just be completely red as this dataset only contains one column.
    \begin{figure}[ht!]
\centering
\includegraphics[width=0.9\linewidth]{example-image-16x9}
\caption{An example of the visualization of the correlations via an association table.}
\label{fig:exampleasso}
    \end{figure}

\end{document}

编辑:字幕后添加垂直距离

在此处输入图片描述

附录: 我的答案中使用的标题设置只能在中有效wrapfigure。例如,通过使用etoolbox包,您需要按如下方式修改序言:

\documentclass[]{scrbook}

\usepackage{wrapfig}
\usepackage{graphicx}
\usepackage{caption}            
\usepackage{etoolbox}
\AtBeginEnvironment{wrapfigure}%
{
\linespread{.84}\selectfont
\captionsetup{skip=1ex, belowskip=2ex,
          font=small, labelfont=bf, % this may you move to caption package options
          format=plain}
}

% document body

结果和以前一样。

答案2

这显示如何将任意图像放入页面底部的可用空间。

\documentclass[]{scrbook}

\usepackage{wrapfig}
\usepackage{graphicx}
%\usepackage{showframe}

\begin{document}

\begin{wrapfigure}[23]{r}{0.35\textwidth}
\centering
\includegraphics[width=\linewidth]{example-image.png}
\caption{An example of the visualization of the cumulative sum.}
\vskip\floatsep
\includegraphics[width=\linewidth]{example-image.png}
\caption{An example of the visualization of the distribution.}
\end{wrapfigure}

\paragraph{Cumulative Sum} visually inspects the similarity between the distributions per column, the cumulative sum of each column for both $\mathcal{R}$ and $\mathcal{F}$ on top of each other are plotted.
This gives a thorough understanding of a column with just one plot, and works for both categorical and continuous columns. Note that this plot does not give any insights into the relations between columns, giving it limited representational power for the whole table. 

\paragraph{Distribution} 
simply shows the distribution of the values of each column plotted with the value on the x-axis and the probability on the y-axis. The bar chart in the background of the figure shows how often values from a certain range (bin) appeared in this specific column of each, $\mathcal{R}$ and $\mathcal{F}$.

\paragraph{Correlations} is the fourth visualization. It shows a association table for the real and synthetic data. It gives a clear understanding of what columns have associations with each other, and shows where the synthetic data diverges, indicating struggles that the model had with learning this relationship. Associated columns are coloured in red, disassociated columns in blue. For univariate datasets like the MonthlyMilkProduction dataset this plot was not being created, as it would just be completely red as this dataset only contains one column.

\begin{figure}[ht!]
\setbox0=\vbox{\caption{An example of the visualization of the correlations via an association table.}
\label{fig:exampleasso}}%
\centering
\includegraphics[height={\dimexpr \pagegoal-\pagetotal-\ht0-\dp0-2\intextsep}]{example-image.png}
\unvbox0
\end{figure}

%\hrule
\end{document}

相关内容