Hello I want to have Under each plot (subgroup plot) its caption
or label, so I can also reference it in my document.
Here in my example I used (a)
, (b)
, (c)
I can keep them but they are not well aligned, and how to get them referenced in the text.
Thanks
\documentclass[french,12pt,oneside,openright]{memoir}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage[a4paper]{geometry}
\usepackage[french]{babel} %langue francaise
\usepackage{graphicx,xcolor} %insertion d'images
\usepackage{titlesec}
\graphicspath{{Annexes/images/}} %directory of the images
\usepackage{lipsum} %paragraphes prédéfinis
\usepackage[sonny]{fncychap}
\usepackage{usnomencl}%pour la nomenclature
\usepackage{pgfplots}
\usepackage{titlesec, blindtext, color}
\definecolor{gray75}{gray}{0.75}
\newcommand{\hsp}{\hspace{20pt}}
\titleformat{\chapter}[hang]{\Huge\bfseries}{\thechapter\hsp\textcolor{gray75}{|}\hsp}{0pt}{\Huge\bfseries}
\usepackage{multirow,array}
\usepackage{siunitx}
\usepackage{tocloft} %costumize the list of...
\usepackage{amssymb}
\usepackage{amsmath} %add mathematic symbols
\usepackage{caption} %for tables andfigures
\usepackage{subcaption} %add many sub (tables/figures) with the same caption
\usepackage{chemfig}
\renewcommand*\printatom[1]{\ensuremath{\mathsf{#1}}}
\usepackage{tikz}
\usepackage{hyperref} %add a hyperlink to the contents
\usepackage{setspace}
\usepgfplotslibrary{groupplots}
\usetikzlibrary{matrix,positioning}
\begin{document}
\chapter{BJH}
\pagebreak
\center{\huge{\hspace{2 cm}BJH}}\\
~\\
\begin{tikzpicture}
\begin{groupplot}[group style={group size= 2 by 3,horizontal sep =1.5cm,vertical sep =1.5cm},height=6.5cm,width=8cm]
\nextgroupplot[legend pos=north east,
legend style={draw=none},
y tick label style={anchor=east},
xticklabel=\empty,
ytick pos=left,
scaled ticks=true,
xmin=0,
xmax=110,
xlabel=(1),
]
\addlegendimage{empty legend};
\addplot[red, mark=+] table{Annexes/resultats/BET/GRAPbjh1.dat};\label{plotsplot1}
\addlegendentry{Graphite}[15 pt];
\coordinate (top) at (rel axis cs:0,1);% coordinate at top of the first plot
\nextgroupplot[legend pos=north east,
legend style={draw=none},
scaled ticks=false, %enlever le.10^-5 !!!!!!!!!!!!
yticklabel pos=left,
ytick pos=left,
scaled ticks=true,
y tick label style={anchor=east},
xmin=0,
xmax=140,
xticklabel=\empty,
xlabel=(2),
]
\addlegendimage{empty legend}
\addplot[red, mark=+] table{Annexes/resultats/BET/CUCEGRAPbjh1.dat};
\addlegendentry{CuCe$_{2}$O$_{4}$/Graphite}
\nextgroupplot[legend pos=north east,
legend style={draw=none},
scaled ticks=false, %enlever le.10^-5 !!!!!!!!!!!!
y tick label style={anchor=east},
ytick pos=left,
scaled ticks=true,
xmin=0,
xmax=110,
xticklabel=\empty,
xlabel=(3),
]
\addlegendimage{empty legend}
\addplot[red, mark=+] table{Annexes/resultats/BET/GRAPbjh1.dat};
\addlegendentry{Graphite}
\nextgroupplot[legend pos=north east,
legend style={draw=none},
scaled ticks=false, %enlever le.10^-5 !!!!!!!!!!!!
yticklabel pos=left,
ytick pos=left,
scaled ticks=true,
y tick label style={anchor=east},
xmin=0,
xmax=100,
xticklabel=\empty,
xlabel=(4),
]
\addlegendimage{empty legend}
\addplot[red, mark=+] table{Annexes/resultats/BET/CULAGRAPbjh1.dat};
\addlegendentry{CuLa$_{2}$O$_{4}$/Graphite}
\nextgroupplot[legend pos=north east,
legend style={draw=none},
scaled ticks=false, %enlever le.10^-5 !!!!!!!!!!!!
y tick label style={anchor=east},
ytick pos=left,
scaled ticks=true,
xmin=0,
xmax=110,
xticklabel=\empty,
xlabel=(5),
]
\addlegendimage{empty legend}
\addplot[red, mark=+] table{Annexes/resultats/BET/GRAPbjh1.dat};
\addlegendentry{Graphite}
\nextgroupplot[legend pos=north east,
legend style={draw=none},
scaled ticks=false, %enlever le.10^-5 !!!!!!!!!!!!
yticklabel pos=left,
ytick pos=left,
scaled ticks=true,
y tick label style={anchor=east},
xmin=0,
xmax=130,
xticklabel=\empty,
xlabel=(6),
]
\addlegendimage{empty legend}
\addplot[red, mark=+] table{Annexes/resultats/BET/CUSMGRAPbjh1.dat};
\addlegendentry{CuSm$_{2}$O$_{4}$/Graphite}
\coordinate (bot) at (rel axis cs:0,0);% coordinate at bottom of the last plot
\end{groupplot}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{groupplot}[group style={group size= 2 by 3,horizontal sep = 1.5cm,vertical sep =1.5cm},height=6.5cm,width=8cm
]
\nextgroupplot[legend pos=north east,
legend style={draw=none},
scaled ticks=false, %enlever le.10^-5 !!!!!!!!!!!!*
%ylabeltickpos= left,
%yticklabel pos=left,
y tick label style={anchor=west},
yticklabel pos=right,
ytick pos=right,
scaled ticks=true,
every y tick scale label/.append style={xshift=1cm},
xmin=0,
xmax=110,
]
\addlegendimage{empty legend};
\addplot[green, mark=o] table{Annexes/resultats/BET/GRAPbjh2.dat};\label{plotsplot2}
\addlegendentry{Graphite}[15 pt];
\coordinate (top) at (rel axis cs:0,1);% coordinate at top of the first plot
\nextgroupplot[legend pos=north east,
legend style={draw=none},
scaled ticks=false, %enlever le.10^-5 !!!!!!!!!!!!
ytick pos=right,
y tick label style={anchor=west},
xmin=0,
xmax=140,
yticklabel pos=right,
scaled ticks=true,
every y tick scale label/.append style={xshift=1cm},
]
legend pos=north east,
legend style={draw=none},
scaled ticks=false, %enlever le.10^-5 !!!!!!!!!!!!
\addlegendimage{empty legend}
\addplot[green, mark=o] table{Annexes/resultats/BET/CUCEGRAPbjh2.dat};
\addlegendentry{CuCe$_{2}$O$_{4}$/Graphite}
\nextgroupplot[legend pos=north east,
legend style={draw=none},
scaled ticks=false, %enlever le.10^-5 !!!!!!!!!!!!
y tick label style={anchor=west},
xmin=0,
xmax=110,
yticklabel pos=right,
ytick pos=right,
scaled ticks=true,
every y tick scale label/.append style={xshift=1cm},
]
\addlegendimage{empty legend}
\addplot[green, mark=o] table{Annexes/resultats/BET/GRAPbjh2.dat};
\addlegendentry{Graphite}
\nextgroupplot[legend pos=north east,
legend style={draw=none},
scaled ticks=false, %enlever le.10^-5 !!!!!!!!!!!!
yticklabel pos=right,
ytick pos=right,
scaled ticks=true,
y tick label style={anchor=west},
xmin=0,
xmax=100,
every y tick scale label/.append style={xshift=1cm},
]
\addlegendimage{empty legend}
\addplot[green, mark=o] table{Annexes/resultats/BET/CULAGRAPbjh2.dat};
\addlegendentry{CuLa$_{2}$O$_{4}$/Graphite}
\nextgroupplot[xlabel={Pression Relative p/p$°$}, legend pos=north east,
legend style={draw=none},
scaled ticks=false, %enlever le.10^-5 !!!!!!!!!!!!
y tick label style={anchor=west},
xmin=0,
xmax=110,
yticklabel pos=right,
ytick pos=right,
scaled ticks=true,
every y tick scale label/.append style={xshift=1cm},
]
\addlegendimage{empty legend}
\addplot[green, mark=o] table{Annexes/resultats/BET/GRAPbjh2.dat};
\addlegendentry{Graphite}
\nextgroupplot[xlabel={Pression Relative p/p$°$},
legend pos=north east,
legend style={draw=none},
scaled ticks=false, %enlever le.10^-5 !!!!!!!!!!!!
yticklabel pos=right,
ytick pos=right,
scaled ticks=true,
y tick label style={anchor=west},
xmin=0,
xmax=130,
every y tick scale label/.append style={xshift=1cm},
]
\addlegendimage{empty legend}
\addplot[green, mark=o] table{Annexes/resultats/BET/CUSMGRAPbjh2.dat};
\addlegendentry{CuSm$_{2}$O$_{4}$/Graphite}
\coordinate (bot) at (rel axis cs:0,0);% coordinate at bottom of the last plot
\end{groupplot}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\path (top-|current bounding box.west)-- node[anchor=south,rotate=90] {Quantité Adsorbée ($cm^{3}/g$ STP)} (bot-|current bounding box.west);
% legend
\path (top|-current bounding box.north)--
coordinate(legendpos)
(bot|-current bounding box.north);
\end{tikzpicture}
%\ref{named}
%\restoregeometry
%***********************************************************
\chapter{Isothermes}
\pagebreak
\center{\huge{\hspace{2 cm}Isothermes}}\\
~\\
\begin{tikzpicture}
\begin{groupplot}[group style={group size= 2 by 3},height=6.5cm,width=8cm]
\nextgroupplot[legend pos=north west,
legend style={draw=none},
scaled ticks=false, %enlever le.10^-5 !!!!!!!!!!!!*
xlabel=(a),
]
\addlegendimage{empty legend};
\addplot[red, mark=+] table{Annexes/resultats/BET/GRAP1.dat};\label{plotsplot1}
\addplot[magenta, mark=o] table{Annexes/resultats/BET/GRAP2.dat};\label{plotsplot2}
\addlegendentry{Graphite}[15 pt];
\coordinate (top) at (rel axis cs:0,1);% coordinate at top of the first plot
\nextgroupplot[legend pos=north west,
legend style={draw=none},
scaled ticks=false, %enlever le.10^-5 !!!!!!!!!!!!
xlabel=(b),
]
legend pos=north west,
legend style={draw=none},
scaled ticks=false, %enlever le.10^-5 !!!!!!!!!!!!
\addlegendimage{empty legend}
\addplot[red, mark=+] table{Annexes/resultats/BET/CUCEGRAP1.dat};
\addplot[magenta, mark=o] table{Annexes/resultats/BET/CUCEGRAP2.dat};
\addlegendentry{CuCe$_{2}$O$_{4}$/Graphite}
\nextgroupplot[legend pos=north west,
legend style={draw=none},
scaled ticks=false, %enlever le.10^-5 !!!!!!!!!!!!
xlabel=(c),
]
\addlegendimage{empty legend}
\addplot[red, mark=+] table{Annexes/resultats/BET/GRAP1.dat};
\addplot[magenta, mark=o] table{Annexes/resultats/BET/GRAP2.dat};
\addlegendentry{Graphite}
\nextgroupplot[legend pos=north west,
legend style={draw=none},
scaled ticks=false, %enlever le.10^-5 !!!!!!!!!!!!
xlabel=(d),
]
\addlegendimage{empty legend}
\addplot[red, mark=+] table{Annexes/resultats/BET/CULAGRAP1.dat};
\addplot[magenta, mark=o] table{Annexes/resultats/BET/CULAGRAP2.dat};
\addlegendentry{CuLa$_{2}$O$_{4}$/Graphite}
\nextgroupplot[xlabel={Pression Relative p/p$°$}, legend pos=north west,
legend style={draw=none},
scaled ticks=false, %enlever le.10^-5 !!!!!!!!!!!!
xlabel=(e),
]
\addlegendimage{empty legend}
\addplot[red, mark=+] table{Annexes/resultats/BET/GRAP1.dat};
\addplot[magenta, mark=o] table{Annexes/resultats/BET/GRAP2.dat};
\addlegendentry{Graphite}
\nextgroupplot[xlabel={Pression Relative p/p$°$},
legend pos=north west,
legend style={draw=none},
scaled ticks=false, %enlever le.10^-5 !!!!!!!!!!!!
xlabel=(f),
]
\addlegendimage{empty legend}
\addplot[red, mark=+] table{Annexes/resultats/BET/CUSMGRAP1.dat};
\addplot[magenta, mark=o] table{Annexes/resultats/BET/CUSMGRAP2.dat};
%\addplot[green] table{Annexes/resultats/BET/GRAP1.dat};
\addlegendentry{CuSm$_{2}$O$_{4}$/Graphite}
\coordinate (bot) at (rel axis cs:0,0);% coordinate at bottom of the last plot
\end{groupplot}
\path (top-|current bounding box.west)-- node[anchor=south,rotate=90] {Quantité Adsorbée ($cm^{3}/g$ STP)} (bot-|current bounding box.west);
% legend
\path (top|-current bounding box.north)--
coordinate(legendpos)
(bot|-current bounding box.north);
\end{tikzpicture}
%\ref{named}
\end{document}
Best Answer
You can load
subcaption
andcaption
packages and use\captionof
inside a node likeThe node option
text
widthis needed for
\captionof` to work inside the node.Tweaking the format of sub caption labels and reference format i further is left as an exercise.