TeX - LaTeX Asked on November 9, 2021
I want to center two images side by side, that are vertically aligned by the center with the captions at the bottom. I managed to do everything, except to center them.
Here is the picture:
Here is my code:
usepackage{caption,floatrow}
DeclareCaptionSubType[alph]{figure}
captionsetup[figure]{labelsep=colon}
captionsetup[subfigure]{labelformat=brace,labelsep=space,labelfont=bf}
floatsetup[subfigure]{capposition=bottom,heightadjust=object,valign=c}
begin{document}
begin{figure}[ht]
ffigbox[hsize]
{begin{subfloatrow}
ffigbox
{includegraphics[height=.6hsize]{radar.png}}
{caption{Feature radar}label{fig:radar}}
ffigbox
{includegraphics[height=1.2hsize]{map.png}}
{caption{Map}label{fig:map}}
end{subfloatrow}}
{caption{Set plot}}
end{figure}
end{document}
And before that:
documentclass{article}
usepackage{verbatim}
usepackage{lipsum}
usepackage[utf8]{inputenc}
usepackage{amsfonts}
usepackage{graphicx,url}
graphicspath{ {./Figures/} }
usepackage{subcaption}
usepackage{flushend}
usepackage{xspace} % for new command space
usepackage{hyperref} % alternatively use url
usepackage{tikz}
usepackage{siunitx}
usepackage{booktabs}
usepackage{multirow}
usepackage{systeme}
usepackage[ruled,vlined]{algorithm2e}
usepackage[export]{adjustbox}% http://ctan.org/pkg/adjustbox | align figures
usepackage{caption,floatrow}
Another approach, achieved by
align=c
from graphbox
package), anddocumentclass{article}
usepackage{graphbox} % it depends on "graphicx" package
usepackage{subcaption}
begin{document}
begin{figure}
centering
subcaptionbox{A catlabel{cat}}
{%
includegraphics[width=3cm,align=c]{example-image}%
vphantom{includegraphics[width=6cm,align=c]{example-image}}%
}qquad
subcaptionbox{An elephantlabel{elephant}}
{includegraphics[width=6cm]{example-image}}
caption{Two animals}label{animals}
end{figure}
end{document}
Answered by muzimuzhi Z on November 9, 2021
Here's how I managed to make it work:
begin{figure}[ht]
centering
ffigbox[hsize]
{begin{subfloatrow}
ffigbox[.5hsize]
{includegraphics[width=FBwidth]{radar.png}}
{caption{Feature radar}label{fig:radar}}
ffigbox[1.4hsize]
{includegraphics[width=FBwidth]{map.png}}
{caption{Map}label{fig:map}}
end{subfloatrow}}
{caption{Set plot}}
end{figure}
Answered by leosole on November 9, 2021
Get help from others!
Recent Answers
Recent Questions
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP