Following the answer I received in https://tex.stackexchange.com/a/652074/61517 I wanted to make the figures even more compact by moving the corresponding labels above/to the left of the figure (as for example demonstrated by Subfigures. To add A and B to subfigures (in the top left corner), and to label them for referencing). With the code, given as
\documentclass{article}
\usepackage{standalone}
\usepackage{tikz}
\usepackage{caption}
\usepackage{subfig}
\usetikzlibrary{external}
\usepackage{pgfplotstable}
\usepackage{pgfplots}
\usepackage{filecontents}
\usepackage{floatrow}
\usepackage{tikzscale}
\begin{filecontents*}{file1.dat}
x y
0 0
1 1
2 2
3 3
4 4
5 5
\end{filecontents*}
%\usepackage{subcaption}
\tikzexternalize[prefix=tikz-cache/]
\tikzset{external/force remake}
\usetikzlibrary{pgfplots.groupplots}
\pgfplotsset{every axis/.append style={
label style={font=\footnotesize\bfseries},
tick label style={font=\footnotesize},
legend style={font=\footnotesize}
},
y axis/.append style={align=center}}
\tikzset{Line Label/.style={font=\footnotesize,scale=2}}
\newcommand{\figurefontsize}{\footnotesize}
\floatsetup[figure]{style=plain,subcapbesideposition=top}
\begin{document}
\begin{figure}[htpb]
\centering
\hspace{\fill}%
\pgfplotsset{trim axis left, /pgfplots/ylabel style={opacity=0}}%
\pgfplotsset{/pgfplots/xlabel style = {opacity=0}}%
\pgfplotsset{/pgfplots/ylabel style={opacity=100}}%
\sidesubfloat[]{\hspace{-.5cm}\includegraphics[height=.33\linewidth]{sub.tikz}\hspace{.5cm}}\hfill%
\pgfplotsset{trim axis left, /pgfplots/ylabel style={opacity=0}}%
\sidesubfloat[]{\hspace{-.5cm}\includegraphics[height=.33\linewidth]{subII.tikz}\hspace{.5cm}}\hfill%
\sidesubfloat[]{\hspace{-.5cm}\includegraphics[height=.33\linewidth]{subIII.tikz}\hspace{.5cm}}\hspace{\fill}\vspace{-.5cm}\%
\hspace*{\fill}%
\pgfplotsset{trim axis left, /pgfplots/ylabel style={opacity=0}}%
\pgfplotsset{/pgfplots/xlabel style = {opacity=100}}%
\pgfplotsset{/pgfplots/ylabel style={opacity=100}}%
\sidesubfloat[]{\hspace{-.5cm}\includegraphics[height=.33\linewidth]{subIV.tikz}\hspace{.5cm}}\hfill%
\pgfplotsset{trim axis left, /pgfplots/ylabel style={opacity=0}}%
\sidesubfloat[]{\hspace{-.5cm}\includegraphics[height=.33\linewidth]{subV.tikz}\hspace{.5cm}}\hfill%
\sidesubfloat[]{\hspace{-.5cm}\includegraphics[height=.33\linewidth]{subVI.tikz}\hspace{.5cm}}\hspace*{\fill}%
\end{figure}
\end{document}
in the main file, and
\pgfplotstableread{file1.dat}{\tablea}
\begin{tikzpicture}
\begin{axis}[
ymin=0, ymax=30,
xmin=0, xmax=5,
xlabel={$x$},
ylabel={$y$-entry, typically long},
grid=major,
legend entries={\(y_1\),\(y_2\),\(y_1+y_2\)},
legend pos = north west
]
% Select appropriate columns
\addplot [blue, mark=*] table [x=x,y=y] {\tablea};
\end{axis}
\end{tikzpicture}
in the tikz-files I got the following result:

Unfortunately, I am already heavily relying on subcaption in my project, and I do not want to change all other figures now, which prevents me using subfig. Therefore, I arrived at two problems:
- How can I replicate the demonstrated behavior by using
subfigure(or similar, contained insubcaption? - Ideally, how can I move the labels into the figures, to the top left corner, without having to place them there manually?
I am currently not sure how to solve either of them. Which options do I have?
