\begin{figure}[!h]
\subfloat{\includegraphics[width=0.5\textwidth]{plot/figlior.png}}
\renewcommand\intextsep{5}
\subfloat{\renewcommand\arraystretch{0.5}
\begin{tabular}{l|l|l|c}
&Low&OR&Upper\\
\toprule
0&0.47&0.51&0.55\\
1&0.59&0.7&0.82\\
2&0.52&0.61&0.72\\
3&0.64&0.87&1.17\\
4&1.01&2.11&4.45\\
$5^{+}$&0.17&1.32&7.95\\
\bottomrule
\end{tabular}
}
\caption{OR e Intervallo di Confidenza al 95\%}
\label{orchildren}
\end{figure}
Asked
Active
Viewed 201 times
2
Phelype Oleinik
- 70,814
S Moini
- 53
-
Welcome to TeX.Stackexchange! – samcarter_is_at_topanswers.xyz Jun 19 '18 at 15:26
-
Since you have some responses below that seem to answer your question, please consider marking one of them as ‘Accepted’ by clicking on the tickmark below their vote count (see How do you accept an answer?). This shows which answer helped you most, and it assigns reputation points to the author of the answer (and to you!). It's part of this site's idea to identify good questions and answers through upvotes and acceptance of answers. – samcarter_is_at_topanswers.xyz Jul 03 '18 at 15:37
3 Answers
3
You may do the following
\documentclass{article}
\usepackage{tikz}
\usepackage{graphicx}
\usepackage{subfigure}
\usepackage{float}
\begin{document}
\begin{figure}[t]
\centering
\resizebox {0.45 \columnwidth}{!}{
\subfigure[Line]{\centering
\includegraphics{bh.jpg}
}
}
\hfil
\resizebox {0.45 \columnwidth}{!}{
\subfigure{\centering
\begin{tikzpicture}
\draw (0 , 0) node {\begin{tabular}{l|l|l|c}
~ & Low & OR & Upper \\
\hline
0 & 0.47 & 0.51 & 0.55 \\
1 & 0.59 & 0.7 & 0.82 \\
2 & 0.52 & 0.61 & 0.72 \\
3 & 0.64 & 0.87 & 1.17 \\
4 & 1.01 & 2.11 & 4.45 \\
$5^{+}$ & 0.17 & 1.32 & 7.95 \\
\hline
\end{tabular}};
\end{tikzpicture}
}
}
\caption{OR e Intervallo di Confidenza al 95\%}
\label{orchildren}
\end{figure}
\end{document}
The output looks like
zyy
- 2,146
-
1+1, but please don't use
\resizeboxfor elements that contain text, see https://tex.stackexchange.com/questions/425453/why-not-scale-elements-that-contain-text – samcarter_is_at_topanswers.xyz Jun 19 '18 at 15:29 -
1@zyy when you are editing maybe you can take the opportunity to make your MWEs compilable? In this case add the documentclass and
\end{document}. When the code is complete there is no risk that you accedentally forget to include something that influences the result, such as a package, a macro definition, etc. For this particular answer that does not seem to be the case, but in general it is good practise. – Marijn May 19 '19 at 13:48
2
If you don't need individual captions for the image/table you could simply put them in minipages next to each other:
\documentclass{article}
\usepackage{graphicx}
\usepackage{booktabs}
\begin{document}
\begin{figure}[htbp]
\begin{minipage}{.45\textwidth}
\includegraphics[width=\textwidth]{example-image}
\end{minipage}
\hfill
\begin{minipage}{.4\textwidth}
\renewcommand\arraystretch{0.5}
\begin{tabular}{lllc}
\toprule
&Low&OR&Upper\\
\midrule
0&0.47&0.51&0.55\\
1&0.59&0.7&0.82\\
2&0.52&0.61&0.72\\
3&0.64&0.87&1.17\\
4&1.01&2.11&4.45\\
$5^{+}$&0.17&1.32&7.95\\
\bottomrule
\end{tabular}
\end{minipage}
\caption{OR e Intervallo di Confidenza al 95\%}
\label{orchildren}
\end{figure}
\end{document}
(please note that it is not recommended to use vertical lines with the booktabs package)
samcarter_is_at_topanswers.xyz
- 158,329
1
\documentclass{article}
\usepackage{booktabs}
\usepackage[demo]{graphicx}
\usepackage{subfig}
\begin{document}
\begin{figure}[!htb]
\subfloat{\includegraphics[width=0.5\textwidth]{plot/figlior.png}}
\renewcommand\intextsep{5}
\subfloat{\renewcommand\arraystretch{0.5}
\raisebox{\dimexpr\height-1ex}{%
\begin{tabular}{l|l|l|c}
&Low&OR&Upper\\\toprule
0&0.47&0.51&0.55\\
1&0.59&0.7&0.82\\
2&0.52&0.61&0.72\\
3&0.64&0.87&1.17\\
4&1.01&2.11&4.45\\
$5^{+}$&0.17&1.32&7.95\\\bottomrule
\end{tabular}%
}%
}
\caption{OR e Intervallo di Confidenza al 95\%}
\label{orchildren}
\end{figure}
\end{document}
user187802
- 16,850



