Combine vários pgfplots de arquivos tex

Combine vários pgfplots de arquivos tex

Tenho usado o Sharelatex para escrever minha tese e acumulei muitos pgfplots. Não posso incluir mais de ~ 6 pgfplots produzidos por arquivos csv antes de atingir o tempo de compilação. Tenho dividido meus lotes entre vários arquivos tex. Existe uma maneira de combinar tudo isso de uma forma simples? Tentei pesquisar e parece que uma opção é converter arquivos pdf para pngs e adicionar os gráficos como imagens, mas perdi a qualidade e a nitidez da figura (tentei o imagemagick e não fiquei satisfeito com o resultado). Quais são minhas opções, por favor informe. Obrigado.

Aqui está um gráfico de grupo de muitos (como exemplo):

\documentclass{standalone}
\usepackage[utf8]{inputenc}
\usepackage{graphicx}
\usepackage{floatrow}
\usepackage{tikz}
\usepackage{pgfplots}
\usepackage{fixltx2e}
\usepackage{siunitx}
\usepackage{lscape}
\usepackage{diagbox}
\usepackage{caption}
\usepackage{xcolor}
\usepackage[version=4]{mhchem}
\usepackage{subcaption}
\usepgfplotslibrary{groupplots}
\DeclareSIUnit{\molar}{M}
\pgfplotsset{compat=newest}



\begin{document}

\begin{figure}[h]
\setlength{\abovecaptionskip}{15pt plus 3pt minus 2pt}
\begin{minipage}{\columnwidth}
\centering
\begin{tikzpicture}[scale = .65, transform shape,trim left]    
\begin{groupplot}[
group style={
group size=2 by 3,
horizontal sep=0pt,
vertical sep=50pt
},
    scale only axis,
    xlabel={nm},
    ylabel={Abs},
    xmin=385, xmax=565, 
    xtick pos=left,
    ytick pos=left,
    no marks,
    max space between ticks=1000pt,
    try min ticks=4,
    xlabel={},
    ylabel={}
]

\nextgroupplot[title=\textbf{(a)} $15:60$ (TPPS\textsubscript{4}-\ce{2Cl}:\Lig{1})]
\addplot  table [col sep=comma, x=nm, y=10] {ST053 1560 Por SG.csv};\label{1560porsg1} 
\addplot  table [col sep=comma, x=nm, y=100] {ST053 1560 Por SG.csv};\label{1560porsg2}
\addplot  table [col sep=comma, x=nm, y=200] {ST053 1560 Por SG.csv};\label{1560porsg3}

\nextgroupplot[title=\textbf{(e)} $60:15$ (TPPS\textsubscript{4}-\ce{2Cl}:\Lig{1})]
\addplot  table [col sep=comma, x=nm, y=10] {ST053 6015 Por SG.csv};
\addplot  table [col sep=comma, x=nm, y=100] {ST053 6015 Por SG.csv};
\addplot  table [col sep=comma, x=nm, y=200] {ST053 6015 Por SG.csv};

\nextgroupplot[title=\textbf{(g)} $60:15$ (TPPS\textsubscript{4}-\ce{2Cl}:Buffer)]
\addplot table [col sep=comma, x=nm, y=10] {ST053 6015 Por blank SG.csv};
\addplot table [col sep=comma, x=nm, y=100] {ST053 6015 Por blank SG.csv};
\addplot table [col sep=comma, x=nm, y=200] {ST053 6015 Por blank SG.csv};

\end{groupplot}
\node at ($(group c1r2.west)!0.5!(group c1r2.west)$)[xshift=-1.5cm]{\rotatebox{90}{\large{Absorption}}};
\node at ($(group c1r3.south)!0.5!(group c2r3.south)$)[yshift=-1.5cm]{\large{Nanometer}};
\end{tikzpicture}
\end{minipage}
\caption{Caption}
\end{figure}

\end{document}

Responder1

não posso testar issoporque não consigo compilar o seu exemplo, pois depende essencialmente de um arquivo que não tenho. No entanto, você deseja que seu arquivo de plotagem seja parecido com isto:

\documentclass[tikz]{standalone}
\usepackage[utf8]{inputenc}
\usepackage{pgfplots}
\usepackage{siunitx}
\usepackage{diagbox}
\usepackage[version=4]{mhchem}
\usepgfplotslibrary{groupplots}
\DeclareSIUnit{\molar}{M}
\pgfplotsset{compat=newest}

\begin{document}
\begin{tikzpicture}[scale = .65, transform shape, trim left]
  \begin{groupplot}[
    group style={
      group size=2 by 3,
      horizontal sep=0pt,
      vertical sep=50pt
    },
    scale only axis,
    xlabel={nm},
    ylabel={Abs},
    xmin=385, xmax=565,
    xtick pos=left,
    ytick pos=left,
    no marks,
    max space between ticks=1000pt,
    try min ticks=4,
    xlabel={},
    ylabel={}
    ]

    \nextgroupplot[title=\textbf{(a)} $15:60$ (TPPS\textsubscript{4}-\ce{2Cl}:\Lig{1})]
    \addplot  table [col sep=comma, x=nm, y=10] {ST053 1560 Por SG.csv};\label{1560porsg1}
    \addplot  table [col sep=comma, x=nm, y=100] {ST053 1560 Por SG.csv};\label{1560porsg2}
    \addplot  table [col sep=comma, x=nm, y=200] {ST053 1560 Por SG.csv};\label{1560porsg3}

    \nextgroupplot[title=\textbf{(e)} $60:15$ (TPPS\textsubscript{4}-\ce{2Cl}:\Lig{1})]
    \addplot  table [col sep=comma, x=nm, y=10] {ST053 6015 Por SG.csv};
    \addplot  table [col sep=comma, x=nm, y=100] {ST053 6015 Por SG.csv};
    \addplot  table [col sep=comma, x=nm, y=200] {ST053 6015 Por SG.csv};

    \nextgroupplot[title=\textbf{(g)} $60:15$ (TPPS\textsubscript{4}-\ce{2Cl}:Buffer)]
    \addplot table [col sep=comma, x=nm, y=10] {ST053 6015 Por blank SG.csv};
    \addplot table [col sep=comma, x=nm, y=100] {ST053 6015 Por blank SG.csv};
    \addplot table [col sep=comma, x=nm, y=200] {ST053 6015 Por blank SG.csv};

  \end{groupplot}
  \node at ($(group c1r2.west)!0.5!(group c1r2.west)$)[xshift=-1.5cm]{\rotatebox{90}{\large{Absorption}}};
  \node at ($(group c1r3.south)!0.5!(group c2r3.south)$)[yshift=-1.5cm]{\large{Nanometer}};
\end{tikzpicture}
\end{document}

Em seu documento principal, você inclui o gráfico mais ou menos assim:

\begin{figure}
  \centering
  \includegraphics{myfabulousplot}
  \caption{My Fabulous Plot}
  \label{fig:fabplot}
\end{figure}

Não utilize o figureambiente no .texarquivo da parcela individual. Você só quer o tikzpictureambiente individual, por exemplo.

Você também pode fazer isso automaticamente. No entanto, se você está tentando evitar intervalos, o automático não é uma boa ideia.

informação relacionada