Несколько pgfplots с общей осью Y

Несколько pgfplots с общей осью Y

Графики с общей осью YВ рамках рукописи мне нужно построить несколько графиков, диапазоны осей x и y которых одинаковы. Я использую subflot вместе с tikzpicture. Мой вопрос в том, что поскольку диапазоны значений обеих осей одинаковы, ось y можно исключить и построить все графики бок о бок с индивидуальной осью x, но общей осью y. Каждый график имеет диаграмму рассеяния и линейный график (фактические и подобранные данные). В руководстве упоминаются стековые диаграммы, но это не то, что мне нужно. Пожалуйста, помогите мне.

    \documentclass[3p, dvipsnames]{elsarticle}
    \usepackage{pgfplots,pgfplotstable}
    \usetikzlibrary{plotmarks}
    \pgfplotsset{every  tick/.style={thick,}}
    \pgfkeys{/pgf/number format/set thousands separator = }
    \pgfplotsset{scaled x ticks= true}
    \pgfplotsset{compat=1.13}
    \usepgfplotslibrary{patchplots,colormaps, colorbrewer}
    \usepackage{subfig}
    \usepackage{graphicx}
    %......................................................................................
    \begin{document}
    \begin{figure*}[tb]
        \centering
        \subfloat[][]{
            \begin{tikzpicture}[scale=0.68, font = \large]
\begin{axis}[
            ylabel={$y'$},
            xlabel={$y$},
            ]
            %..............................................................................................................................
            \addplot[mark = none, line width=1.25pt, color =black][domain = 25:350, samples= 50]{(1.114938029*x)+(-16.01)};
            \legend{$\, Y_1$}
            \end{axis}
            \end{tikzpicture}\label{fig:label1}
        }
        \subfloat[][]{
            \begin{tikzpicture}[scale=0.68, font = \large]
            \begin{axis}[
            ylabel={$y'$},
            xlabel={$ y $},
            ]
            %..............................................................................................................................
            \addplot[mark = none, line width=1.25pt, color = RedOrange][domain = 25:350, samples= 50]{(0.96*x)+(5.98)};
            \legend{$\, Y_2$}
            \end{axis}
            \end{tikzpicture}\label{fig:label2}
        }
        \subfloat[][]{
            \begin{tikzpicture}[scale=0.68, font = \large]
            \begin{axis}[
            ylabel={$y'$},
            xlabel={$ y$},
            ]
            %..............................................................................................................................
            \addplot[mark = none, line width=1.25pt, color = Cerulean][domain = 25:350, samples= 50]{(0.96*x)+(6.00)};
            \legend{$\, Y_3$}
            \end{axis}
            \end{tikzpicture}\label{label3}
        }
        \caption{My caption.}\label{figlabel}
    \end{figure*}
    
    \end{document}

решение1

Если вы хотите, чтобы было как на вашем изображении, то больше нет смысла использовать subfig. Вот один из способов сделать это:

\documentclass[tikz, border=1cm]{standalone}
\usepackage{pgfplots}
\pgfplotsset{compat=1.18}
\pgfplotsset{legend pos=north west, ymin=-10, ymax=400}
\begin{document}
\begin{tikzpicture}

\begin{axis}[
name=plot1,
ytick pos=left,
xlabel={$y$}, ylabel={$y'$},
]
\addplot[very thick][domain=25:350, samples=2]{(1.114938029*x)+(-16.01)};
\legend{$\, Y_1$}
\end{axis}

\begin{axis}[
name=plot2, at={(plot1.south east)},
ytick=\empty,
xlabel={$y$},
]
\addplot[orange, very thick][domain=25:350, samples=2]{(0.96*x)+(5.98)};
\legend{$\, Y_2$}
\end{axis}

\begin{axis}[
name=plot3, at={(plot2.south east)},
ytick=\empty,
xlabel={$y$},
]
\addplot[teal, very thick][domain=25:350, samples=2]{(0.96*x)+(6.00)};
\legend{$\, Y_3$}
\end{axis}

\end{tikzpicture}
\end{document}

Трехсвязный граф с общей осью Y

Связанный контент