I have a single image which contains two sub-images. I want the following subtitles (a) and (b) to be shown correctly.
In which, left sides is my current image which contains two rectangular. And right sides is my expected result. I found a solution is that we can use subfig
package. However, it requires separating the original figure into two subfigure. In that question, I am regarding that we do not need split original figure, I want to write (a),(b) directly below figure. Thanks
Current solution is
\begin{figure}[H]
\captionsetup{labelfont={bf}}
\centering
\subfloat[]{\centering\includegraphics[scale=0.5]{Fig1a.png}} \\
\subfloat[]{\centering\includegraphics[scale=0.5]{Fig1b.png}}
\caption{This is main figure}
\label{fig:9}
\end{figure}
Best Answer
My suggestion would be to clip the image contents within LaTeX;
graphicx
allows for that:I've used
example-image-a
andexample-image-b
(frommwe
) above, although you will use the same image. As such, you'll only need to capture the image in box 1 once. Note how the image is split in half (at the.5\wd1
mark) with theviewport
andclip
combination.Additionally, I've used
subcaption
, but you can manage the same withsubfig
.Here is an example of breaking up a single image into six equal parts (perhaps synonymous to your situation):
Each component is extracted as a sixth of the total width
\wd1
, one step at a time.