Re: affiancamento immagini subfig

#88052
Up
0
Down
::

MngSpaghetti” post=87482salve a tutti,
non riesco ad affiancare i miei 4 grafici a due a due con un unico caption…
dapprima ho provato il pacchetto “subfigure” con i vari comandi \subfigure[]{} ma senza risultato;
poi leggendo sul forum ho visto che il pacchetto è obsoleto e allora adesso utilizzo il pacchetto subfig con i vari \subfloat[]{} ma senza ottenere un risultato;
ho provato a utilizzare i comandi \node () [] di tickz ma anche li si creava più confusione che altro…
ho pensato fossero problemi di scala immagini ma evidentemente sbaglio qualcosa…
vi ringrazio anticipatamente a tutti per l’attenzione… p.s. non fate caso al preambolo…

`
\documentclass[11pt,a4paper,oneside,openright,titlepage]{book}
\usepackage[italian]{babel}
\usepackage[utf8]{inputenc}
\usepackage{chemfig}
\usepackage{amsmath}
\usepackage{array,booktabs}
\newcolumntype{P}[1]{>{\raggedright\arraybackslash}p{#1}}
\newlength{\mngsp}
\usepackage{stmaryrd}
\usepackage{textcomp}
\usepackage{colortbl}
\usepackage{booktabs}
\usepackage[version=3]{mhchem}
\usepackage{tikz}
\newcommand{\blocknewline}{\\[3pt]\hspace{0pt}}
\usetikzlibrary{positioning,shapes,shadows,arrows,patterns,shadings}
\usepackage{pgfplots}
\pgfplotsset{/pgf/number format/use comma,compat=newest}
\usepackage{pdflscape}
\usepackage{subfig}
\usepackage[round,sort]{natbib}
\usepackage{hyperref}
\makeatletter
\renewcommand\hyper@natlinkbreak[2]{#1}
\makeatother
\usepackage[font=footnotesize, labelfont=bf]{caption}
\usepackage{siunitx}
\usepackage[Lenny]{fncychap}
\ChNameVar{\fontsize{16}{18}\usefont{T1}{phv}{m}{n}\selectfont}
\ChNumVar{\fontsize{80}{84}\usefont{T1}{ptm}{m}{n}\selectfont}
\usepackage{fancyhdr}
\newcommand{\fncyblank}{\fancyhf{}}
\newenvironment{abstract}%
{\cleardoublepage \fncyblank \null \vfill \begin{center}
\bfseries \abstractname \end{center}}%
{\vfill \null}
\usepackage{newfloat,caption}
\DeclareFloatingEnvironment[
name=Formula,
fileext=loc,
listname=Elenco delle formule,
placement=htbp,
within=chapter,
]{chemenvinn}
\newenvironment{chemenv}
{\begin{center}
\renewcommand\chemname[3][]{##2\captionof{chemenvinn}{##3}}}
{\end{center}}
\let\listofformulas\listofchemenvinns
\usepackage{minitoc}
\renewcommand\mtctitle{Sezioni}
\renewcommand\mlftitle{Figure}
\renewcommand\mlttitle{Tabelle}
\usepackage{makeidx}
\makeindex
\setcounter{tocdepth}{3}
\setcounter{secnumdepth}{3}

\begin{document}
\frontmatter{\tableofcontents\listoffigures\listoftables\listofformulas}
\mainmatter

\begin{figure}
\centering
\subfloat{
\begin{tikzpicture}
\begin{axis}
[xbar,xmin=0,xmax=25,
width=8cm,
xmajorgrids=true,
ytick pos=left,
enlarge y limits = 0.2,
title={Rislutati Comparati Catalasi},
xlabel={$\% \ce{O_2/ 3min / g}$},
symbolic y coords={AU50,AU25,VI50,VI25},
ytick=data,
nodes near coords,
nodes near coords align= %
{horizontal}
]
\addplot[fill=cyan,draw=black, bar width=0.2cm] coordinates
{
(1.74,AU50)
(1.27,AU25)
(0.43,VI50)
(16.10,VI25)
};

\addplot[fill=green,draw=black, bar width=0.2cm] coordinates
{
(1.15,AU50)
(0.58,AU25)
(1.89,VI50)
(9.77,VI25)
};

\addplot[fill=orange,draw=black, bar width=0.2cm] coordinates
{
(0.68,AU50)
(0.64,AU25)
(15.08,VI50)
(11.70,VI25)
};

\addplot[fill=yellow,draw=black, bar width=0.2cm] coordinates
{
(2.47,AU50)
(1.97,AU25)
(19.37,VI50)
(5.61,VI25)
};

\legend{$I$,$II$,$III$,$IV$}
\end{axis}
\end{tikzpicture}}

\quad

\subfloat{
\begin{tikzpicture}
\begin{axis}
[xbar,xmin=0,xmax=3.5,
width=8cm,
xmajorgrids=true,
ytick pos=left,
enlarge y limits = 0.2,
title={Rislutati Comparati Deidrogensi},
xlabel={$\mu g \ TTF / g \cdot h$},
symbolic y coords={AU50,AU25,VI50,VI25},
ytick=data,
nodes near coords,
nodes near coords align= %
{horizontal}
]
\addplot[fill=cyan,draw=black, bar width=0.2cm] coordinates
{
(0.57,AU50)
(0.36,AU25)
(1.24,VI50)
(1.76,VI25)
};

\addplot[fill=green,draw=black, bar width=0.2cm] coordinates
{
(0.98,AU50)
(0.51,AU25)
(1.40,VI50)
(1.20,VI25)
};

\addplot[fill=orange,draw=black, bar width=0.2cm] coordinates
{
(0.44,AU50)
(0.32,AU25)
(2.35,VI50)
(0.74,VI25)
};

\addplot[fill=yellow,draw=black, bar width=0.2cm] coordinates
{
(0.53,AU50)
(0.55,AU25)
(1.47,VI50)
(0.73,VI25)
};

\legend{$I$,$II$,$III$,$IV$}
\end{axis}
\end{tikzpicture}} \\

\subfloat{
\begin{tikzpicture}
\begin{axis}
[xbar,xmin=0,xmax=1100,
width=8cm,
xmajorgrids=true,
ytick pos=left,
enlarge y limits = 0.2,
title={Rislutati Comparati Lipasi},
xlabel={$\mu g \ PNP/g \ suolo \cdot 10'$},
symbolic y coords={AU50,AU25,VI50,VI25},
ytick=data,
nodes near coords,
nodes near coords align= %
{horizontal}
]
\addplot[fill=cyan,draw=black, bar width=0.2cm] coordinates
{
(860.26,AU50)
(420.06,AU25)
(203.62,VI50)
(32.33,VI25)
};

\addplot[fill=green,draw=black, bar width=0.2cm] coordinates
{
(787.05,AU50)
(403.80,AU25)
(182.45,VI50)
(69.75,VI25)
};

\addplot[fill=orange,draw=black, bar width=0.2cm] coordinates
{
(908.10,AU50)
(473.72,AU25)
(305.53,VI50)
(202.12,VI25)
};

\addplot[fill=yellow,draw=black, bar width=0.2cm] coordinates
{
(606.21,AU50)
(406.63,AU25)
(296.58,VI50)
(222.72,VI25)
};

\legend{$I$,$II$,$III$,$IV$}
\end{axis}
\end{tikzpicture}}

\quad

\subfloat{
\begin{tikzpicture}
\begin{axis}
[xbar,xmin=0,xmax=2300,
width=8cm,
xmajorgrids=true,
ytick pos=left,
enlarge y limits = 0.2,
title={Rislutati Comparati Ureasi},
xlabel={$\mu g \ \ce{N – NH_{4}^{+} \ g \cdot 3h}$},
symbolic y coords={AU50,AU25,VI50,VI25},
ytick=data,
nodes near coords,
nodes near coords align= %
{horizontal}
]
\addplot[fill=cyan,draw=black, bar width=0.2cm] coordinates
{
(35.26,AU50)
(18.80,AU25)
(153.69,VI50)
(881.93,VI25)
};

\addplot[fill=green,draw=black, bar width=0.2cm] coordinates
{
(21.66,AU50)
(6.37,AU25)
(542.37,VI50)
(1422.13,VI25)
};

\addplot[fill=orange,draw=black, bar width=0.2cm] coordinates
{
(38.66,AU50)
(52.97,AU25)
(603.39,VI50)
(1203.94,VI25)
};

\addplot[fill=yellow,draw=black, bar width=0.2cm] coordinates
{
(88.95,AU50)
(116.79,AU25)
(513.95,VI50)
(480.42,VI25)
};

\legend{$I$,$II$,$III$,$IV$}
\end{axis}
\end{tikzpicture}}
\caption{non lo so}
\end{figure}

\end{document}
`

Perché non dare un’occhiata anche alla libreria [tt]groupplots[/tt]? La libreria permette proprio di affiancare grafici o disporli a matrice: a quel punto siccome l’ambiente figure è uno solo avrai anche una sola didascalia.

Ciao
Claudio

Go to top