0

enter image description here

I am rephrasing my question... I want to obtain attached Image.. I have coded as below.. But I do not obtain required output.. Can you help me modify my code?

\begin{document}
\begin{figure}[ht]
\begin{subfigure}{\textwidth}
\centering
\includegraphics[width=6cm]{c1.eps}
\includegraphics[width=6cm]{c2.eps}
\caption{}%{V} \label{fig:a}
\end{subfigure}
\begin{subfigure}{\textwidth}
\centering
\includegraphics[width=6cm]{c3.eps}
\includegraphics[width=6cm]{c4.eps}
\caption{}%{P} \label{fig:b}
\end{subfigure}
\caption{Variation} \label{fig:wind_speed}
\end{figure}
\end{document}
15
  • 1
    Welcome to TeX.SX! Please help us to help you and add a minimal working example (MWE) that illustrates your problem. It will be much easier for us to reproduce your situation and find out what the issue is when we see compilable code, starting with \documentclass{...} and ending with \end{document}. You might also want to add to your question how you're including the pdfs etc.
    – Aradnix
    Aug 29 '14 at 4:58
  • I think you can use the package subcaption suitable for solve your problem.
    – Aradnix
    Aug 29 '14 at 5:02
  • please see modif question.. i add my code.. also the code reproduce the picture i posted
    – IZNA
    Aug 29 '14 at 5:09
  • Good, but that isn't still a full MWE. Complete it please.
    – Aradnix
    Aug 29 '14 at 5:11
  • 1
    @IZNA -- I run the latest code you provided and did not observe any Figure 1 and Figure 2 as shown in the image on the top. My wild guess is that you have two extra \caption{} inserted after \end{subfigure} and that command issues another prefix Figure. Note the system may think we are chatting. If still have question, let use chat room.
    – Jesse
    Aug 29 '14 at 9:54
2

Would this be what you seek? Use of subfigure environment from subcaption package

Update: second attempt

enter image description here

Code

\documentclass{article}
\usepackage{graphicx}
\usepackage{subcaption}

\begin{document}

\begin{figure}[ht]
 \begin{subfigure}{\textwidth}
   \centering
\includegraphics[width=6cm]{example-image-A} 
\includegraphics[width=6cm]{example-image-B} 
\caption{}%Vacoas}
\label{fig:a}
\end{subfigure}
\begin{subfigure}{\textwidth}
\centering
 \includegraphics[width=6cm]{example-image-C} 
\includegraphics[width=6cm]{example-image-A} 
\caption{}%{Plaisance}
\label{fig:b} 
\end{subfigure}
\caption{Variation} 
\label{fig:wind_speed}
\end{figure}

\end{document}

enter image description here

Code

\documentclass{article}
\usepackage{graphicx}
\usepackage{subcaption}

\begin{document}

\begin{figure}[H]
\centering
   \begin{subfigure}{0.45\textwidth}
   \centering
   \includegraphics[width=\linewidth]{example-image-A}
   \caption{}
   \label{fig:f1} 
\end{subfigure}\quad
\begin{subfigure}{0.45\textwidth}
   \centering
   \includegraphics[width=\linewidth]{example-image-B}
   \caption{}
   \label{fig:f2}
\end{subfigure}
\centering
\caption{(a) Some text (b) Some text}

\end{figure}
\end{document}
9
  • no.. i seek the (a) to be in the place of Figure 1.. below both pics i do nt want any labels.. i want it to be centralised.
    – IZNA
    Aug 29 '14 at 5:22
  • So add a full MWE not only what you consider the enough lines of the image: I've just been asked to write a minimal example, what is that?
    – Aradnix
    Aug 29 '14 at 5:39
  • hi.. the second attempt is exactly what i wanted!!! but the Figure 1 and figure 2 still does appear belwo..:( see image in question
    – IZNA
    Aug 29 '14 at 6:40
  • @IZNA -- In my example, just mark them out as displayed below %\caption{Variation} %\label{fig:wind_speed}
    – Jesse
    Aug 29 '14 at 6:49
  • i want variation to appear, ONLY FIGURE 1 AND FIGURE 2 WHICH I DO Not want.. see ur code with my data..
    – IZNA
    Aug 29 '14 at 6:55
2

(answer thoroughly revised after OP's posting was edited/modified)

I'm afraid the screenshot you've posted of what you say you want isn't entirely self-explanatory. E.g., what are the two isolated strings "Figure 1" and "Figure 2" doing, and are they needed? For now, I've decided to not to try to generate them, especially as there's no hint of them in the code you've posted.

I would suggest taking the following steps:

  • Provide one \caption command per subfigure environment, and one more for the overall figure environment.

  • Use a \centering instruction both at the start of the main figure environment and at the start of each of the two subfigure environments.

  • If you want just the subcaptions' letters -- (a) and (b) -- but no other text, just type \caption{\null}.

  • To get the captions' text -- including the letters letters (a) and (b) -- typeset in bold, set the option font=bf when loading the caption and subcaption packages. I set this option based on the screenshot you posted. Obviously, if you don't want bold, don't specify this option.

  • I've set \qquad ("double quad") as the horizontal separation between the two images on each row; adjust this to suit your needs. Likewise, I've inserted \bigskip to separate the two subfigures vertically; adjust as needed.

enter image description here

\documentclass{article}
\usepackage[demo]{graphicx}  % omit 'demo' option for real document
\usepackage[font=bf]{caption,subcaption}

\begin{document}

\begin{figure}[ht]
\centering

\begin{subfigure}{\textwidth}
\centering
\includegraphics[width=4cm]{c1.eps}
\qquad  % choose separation between c1 and c2
\includegraphics[width=4cm]{c2.eps}
\caption{V} \label{fig:a}
\end{subfigure}

\bigskip

\begin{subfigure}{\textwidth}
\centering
\includegraphics[width=4cm]{c3.eps}
\qquad  % choose separation between c3 and c4
\includegraphics[width=4cm]{c4.eps}
\caption{P} \label{fig:b}
\end{subfigure}

\caption{(a) and (b) represent circles} \label{fig:wind_speed}
\end{figure}
\end{document}
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.