LaTeX forum ⇒ Generalsubfigure

LaTeX specific issues not fitting into one of the other forums of this category.
Sam
Posts: 62
Joined: Fri Nov 30, 2007 1:43 pm

subfigure

Postby Sam » Fri Nov 30, 2007 1:46 pm

hello, Sad

I need to subfigure the following

%\begin{figure}[h!]
% \centering
% \includegraphics [width=0.7\textwidth]{delay_20amp_synch_fr4_submap.eps}
% \caption{Typical subspace map for the synchronous actuators motion(Heave)}
% \label{fig:delay_20amp_synch_fr4_submap.eps}
%\end{figure}
%\begin{figure}[h!]
% \centering
% \includegraphics [width=0.7\textwidth]{delay_fr4_cycle.eps}
% \caption{Time domain response of the two actuators being sinusoidally controlled.}
% \label{fig:delay_fr4_cycle.eps}
%\end{figure}

I tried the folowing but did not work

\begin{figure}[h]
\hfill
\begin{minipage}[t]{.45\textwidth}
\begin{center}
\epsfig{file=delay_20amp_synch_fr4_submap.eps, scale=0.25}
\caption{figure 1}
\label{fig-tc}
\end{center}
\end{minipage}
\hfill
\begin{minipage}[t]{.45\textwidth}
\begin{center}
\epsfig{file=delay_fr4_cycle.eps, scale=0.25}
\caption{figure 2}
\label{fig-tc}
\end{center}
\end{minipage}
\hfill
\end{figure}

Any help will be much apprecitaed Cool

Link:
BBcode:
HTML:
Hide post links
Show post links

User avatar
localghost
Site Moderator
Posts: 9206
Joined: Fri Feb 02, 2007 12:06 pm
Location: Braunschweig, Germany

Postby localghost » Fri Nov 30, 2007 2:30 pm

You should use the subfig package, which lets you typeset those subfigures in a very comfortable way. Refer to its documentation for more information.
  1. \documentclass[12pt,DIV15]{scrartcl}
  2. \usepackage[T1]{fontenc}
  3. \usepackage[latin1]{inputenc}
  4. \usepackage[english]{babel}
  5. \usepackage[font=small,labelfont=bf]{caption}
  6. \usepackage[font=footnotesize]{subfig}
  7. \usepackage{graphicx}
  8.  
  9. \begin{document}
  10. \section{Short introduction to the \texttt{subfig} package}\label{sec:subfig}
  11. Figure~\ref{fig:figure} shows how to typeset a figure with two subfigures using the \texttt{subfig} package.
  12.  
  13. \begin{figure}[!ht]
  14. \centering
  15. \subfloat[Subfigure One\label{subfig-1:figure}]{
  16. \includegraphics[scale=0.25]{delay_20amp_synch_fr4_submap}
  17. }
  18. \subfloat[Subfigure Two\label{subfig-2:figure}]{
  19. \includegraphics[scale=0.25]{delay_fr4_cycle}
  20. }
  21. \caption{A figure with two subfigures}\label{fig:figure}
  22. \end{figure}
  23.  
  24. As you can see, you can easily typeset the Figure~\ref{fig:figure} with the two subfigures \subref*{subfig-1:figure} and \subref*{subfig-2:figure}.
  25. \end{document}

Don't use the epsfig package! It is obsolete and superseded by the graphicx package. You can omit the endings in the file names. The compiler will find the right files on its own. Avoid the "_" in the file names and paths (even if it works). It is reserverd for subscripts in mathematical mode. The caption package lets you customize the captions of figures and tables.


Best regards an welcome on Board
Thorsten
Last edited by localghost on Fri Nov 30, 2007 2:59 pm, edited 2 times in total.
LaTeX Community Moderator
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes


¹ System: openSUSE 13.1 (Linux 3.11.10), TeX Live 2013 (vanilla), TeXworks 0.5 (r1351)
² Posting stopped indefinitely due to offenses

Link:
BBcode:
HTML:
Hide post links
Show post links

Sam
Posts: 62
Joined: Fri Nov 30, 2007 1:43 pm

Postby Sam » Fri Nov 30, 2007 2:37 pm

Thnaks a lot!

I tried your code but still does not work Confused

Link:
BBcode:
HTML:
Hide post links
Show post links

User avatar
localghost
Site Moderator
Posts: 9206
Joined: Fri Feb 02, 2007 12:06 pm
Location: Braunschweig, Germany

Postby localghost » Fri Nov 30, 2007 2:57 pm

Sorry for that. My fault. I missed an "s" in the first line and had a wrong label in the second subfigure. I corrected the code. So, please try again. If it still doesn't work, please give a detailed description of the error by posting the message given by the compiler from the log file.
Last edited by localghost on Fri Nov 30, 2007 3:07 pm, edited 1 time in total.
LaTeX Community Moderator
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes


¹ System: openSUSE 13.1 (Linux 3.11.10), TeX Live 2013 (vanilla), TeXworks 0.5 (r1351)
² Posting stopped indefinitely due to offenses

Link:
BBcode:
HTML:
Hide post links
Show post links

Sam
Posts: 62
Joined: Fri Nov 30, 2007 1:43 pm

Postby Sam » Fri Nov 30, 2007 3:03 pm

GReat Thanks you are very helpful Smile

it did work but HOW can I control the space between the two figures?

also HOW can I Make them exactly lined up?

thx
Last edited by Sam on Fri Nov 30, 2007 3:06 pm, edited 1 time in total.

Link:
BBcode:
HTML:
Hide post links
Show post links

User avatar
localghost
Site Moderator
Posts: 9206
Joined: Fri Feb 02, 2007 12:06 pm
Location: Braunschweig, Germany

Postby localghost » Fri Nov 30, 2007 3:06 pm

Just put the right command directly between them.
  1. \begin{figure}[!ht]
  2. \centering
  3. \subfloat[Subfigure One\label{subfig-1:figure}]{
  4. \includegraphics[scale=0.25]{delay_20amp_synch_fr4_submap}
  5. }
  6. \hspace{5mm}
  7. \subfloat[Subfigure Two\label{subfig-2:figure}]{
  8. \includegraphics[scale=0.25]{delay_fr4_cycle}
  9. }
  10. \caption{A figure with two subfigures}\label{fig:figure}
  11. \end{figure}

Sam wrote:also HOW can I Make them exactly lined up?

What do mean with that? They should be vertically aligned to the bottom.
Last edited by localghost on Fri Nov 30, 2007 3:12 pm, edited 1 time in total.
LaTeX Community Moderator
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes


¹ System: openSUSE 13.1 (Linux 3.11.10), TeX Live 2013 (vanilla), TeXworks 0.5 (r1351)
² Posting stopped indefinitely due to offenses

Link:
BBcode:
HTML:
Hide post links
Show post links

Sam
Posts: 62
Joined: Fri Nov 30, 2007 1:43 pm

Postby Sam » Fri Nov 30, 2007 3:10 pm

Thanks but

\hspace{0mm} is for the horizontal distance between the fig right?

It did not make a change...I want the figures to be very close to each other and lined up!

Thx Smile

Link:
BBcode:
HTML:
Hide post links
Show post links

User avatar
localghost
Site Moderator
Posts: 9206
Joined: Fri Feb 02, 2007 12:06 pm
Location: Braunschweig, Germany

Postby localghost » Fri Nov 30, 2007 3:17 pm

Just set a negative horizontal space.
  1. \hspace{-1mm}

What do you mean with "lined up"? Vertical alignment to the top of both? They should be aligned to their bottoms.
LaTeX Community Moderator
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes


¹ System: openSUSE 13.1 (Linux 3.11.10), TeX Live 2013 (vanilla), TeXworks 0.5 (r1351)
² Posting stopped indefinitely due to offenses

Link:
BBcode:
HTML:
Hide post links
Show post links

Sam
Posts: 62
Joined: Fri Nov 30, 2007 1:43 pm

Postby Sam » Fri Nov 30, 2007 3:22 pm

localghost wrote:Just set a negative horizontal space.
  1. \hspace{-1mm}

What do you mean with "lined up"? Vertical alignment to the top of both? They should be aligned to their bottoms.



Thnaks!

I meant lined up both horizontally Smile

Link:
BBcode:
HTML:
Hide post links
Show post links

Sam
Posts: 62
Joined: Fri Nov 30, 2007 1:43 pm

Postby Sam » Fri Nov 30, 2007 4:04 pm

Sad they don't line up horizontally!!

How can I sort this out plz Embarassed

Link:
BBcode:
HTML:
Hide post links
Show post links


Return to “General”

Who is online

Users browsing this forum: No registered users and 3 guests