
Ich habe Sharelatex zum Schreiben meiner Abschlussarbeit verwendet und dabei viele PGF-Plots angesammelt. Ich kann nicht mehr als ~6 PGF-Plots einbinden, die von CSV-Dateien erstellt wurden, bevor es beim Kompilieren zu einer Zeitüberschreitung kommt. Ich habe meine Plots auf mehrere Tex-Dateien aufgeteilt. Gibt es eine Möglichkeit, am Ende alles auf einfache Weise zusammenzufügen? Ich habe gesucht und es scheint, als ob eine Möglichkeit darin besteht, PDF-Dateien in PNGs umzuwandeln und die Plots als Bilder hinzuzufügen, aber dabei geht die Qualität und Schärfe der Abbildung verloren (ich habe Imagemagick ausprobiert und war mit dem Ergebnis nicht zufrieden). Welche Möglichkeiten habe ich? Bitte geben Sie mir einen Rat. Danke.
Hier ist ein Gruppendiagramm von vielen (als Beispiel):
\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}
Antwort1
Ich kann das nicht testenweil ich Ihr Beispiel nicht kompilieren kann, da es im Wesentlichen von einer Datei abhängt, die ich nicht habe. Sie möchten jedoch, dass Ihre Plotdatei ungefähr so aussieht:
\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}
In Ihr Hauptdokument fügen Sie den Plot dann etwa so ein:
\begin{figure}
\centering
\includegraphics{myfabulousplot}
\caption{My Fabulous Plot}
\label{fig:fabplot}
\end{figure}
Verwenden Sie die figure
Umgebung nicht in der Datei des einzelnen Plots . Sie möchten beispielsweise .tex
nur die individuelle Umgebung.tikzpicture
Sie können dies auch automatisch tun. Wenn Sie jedoch Zeitüberschreitungen vermeiden möchten, ist die automatische Vorgehensweise keine gute Idee.