Figura del gráfico del grupo de centrado

Figura del gráfico del grupo de centrado

¿Alguien puede mostrarme cómo centrar esto group plot? Probé todos los trucos del libro tex.stackexchange de publicaciones similares (por ejemplo,¿Cómo centrar figuras grandes en LaTeX y cómo arreglar líneas cortas justificadas?).

\documentclass[]{article}
    \usepackage{pgfplots, alphalph}
    \usepgfplotslibrary{groupplots}

\begin{document}

\begin{figure}
    \begin{tikzpicture}[font=\footnotesize\sffamily]
      \begin{groupplot}[
         group style={group size=3 by 2, vertical sep=70pt,
    ylabels at=edge left
    },
          view={0}{90},
          width=5.2cm,
          height=5.2cm,
      scale only axis,
      scaled ticks = false,
      tick label style={/pgf/number format/fixed},
      title={My title},
      xlabel={x-axis},
      ylabel={y-axis}],
          unbounded coords=jump]
        ]
        \nextgroupplot [title={\it{Title 1}}]       
\addplot[black, thick, mark=o, only marks]
    coordinates {
        };

        \nextgroupplot [title={\it{Title 2}}]      
\addplot[black, thick, mark=o, only marks]
    coordinates {
        };

        \nextgroupplot [title={\it{Title 3}}]      
\addplot[black, thick, mark=o, only marks]
    coordinates {
        };

        \nextgroupplot [title={\it{Title 4}}]      
\addplot[black, thick, mark=o, only marks]
    coordinates {
        };

        \nextgroupplot [title={\it{Title 5}}]      
\addplot[black, thick, mark=o, only marks]
    coordinates {
        };

         \end{groupplot}

    \end{tikzpicture}
  \end{figure}



\end{document}

Respuesta1

Tus tramas son demasiado amplias. Puede intentar colocar 2 gráficos en una fila en lugar de 3. Sin embargo, siempre existen técnicas de este cuadro que se pueden utilizar.

\documentclass[]{article}
    \usepackage{pgfplots, alphalph}
    \usepgfplotslibrary{groupplots}

\begin{document}

\begin{figure}
\makebox[\textwidth]{%
    \begin{tikzpicture}[font=\footnotesize\sffamily]
      \begin{groupplot}[
         group style={group size=3 by 2, vertical sep=70pt,
    ylabels at=edge left
    },
          view={0}{90},
          width=5.2cm,
          height=5.2cm,
      scale only axis,
      scaled ticks = false,
      tick label style={/pgf/number format/fixed},
      title={My title},
      xlabel={x-axis},
      ylabel={y-axis}],
          unbounded coords=jump]
        ]
        \nextgroupplot [title={\it{Title 1}}]
\addplot[black, thick, mark=o, only marks]
    coordinates {
        };

        \nextgroupplot [title={\it{Title 2}}]
\addplot[black, thick, mark=o, only marks]
    coordinates {
        };

        \nextgroupplot [title={\it{Title 3}}]
\addplot[black, thick, mark=o, only marks]
    coordinates {
        };

        \nextgroupplot [title={\it{Title 4}}]
\addplot[black, thick, mark=o, only marks]
    coordinates {
        };

        \nextgroupplot [title={\it{Title 5}}]
\addplot[black, thick, mark=o, only marks]
    coordinates {
        };

         \end{groupplot}

    \end{tikzpicture}
    }
  \end{figure}




\end{document}

ingrese la descripción de la imagen aquí

Si desea centrar los dos últimos gráficos, puede usar un ancho adecuado para todos los gráficos (para saber cuánto desplazar) y usar xshiftcomo

\nextgroupplot [xshift=1.2in,title={\it{Title 4}}]
\addplot[black, thick, mark=o, only marks]
    coordinates {
        };

        \nextgroupplot [xshift=1.2in,title={\it{Title 5}}]
\addplot[black, thick, mark=o, only marks]
    coordinates {
        };

ingrese la descripción de la imagen aquí

Con table:

\documentclass[]{article}
    \usepackage{pgfplots, alphalph}
    \usepgfplotslibrary{groupplots}
\usepackage{filecontents}
 \begin{filecontents*}{mydata.dat}
  A   B      
  1    4
  2    6
  3    9
  4    2
  5    3
  \end{filecontents*}

\begin{document}

\begin{figure}
\makebox[\textwidth]{%
    \begin{tikzpicture}[font=\footnotesize\sffamily]
      \begin{groupplot}[
         group style={group size=3 by 2, vertical sep=70pt,
    ylabels at=edge left
    },
          view={0}{90},
          width=5.2cm,
          height=5.2cm,
      scale only axis,
      scaled ticks = false,
      tick label style={/pgf/number format/fixed},
      title={My title},
      xlabel={x-axis},
      ylabel={y-axis}],
          unbounded coords=jump]
        ]
        \nextgroupplot [title={\it{Title 1}}]
\addplot[black, thick, mark=o, only marks]
    table[x=A,y=B]{mydata.dat};

        \nextgroupplot [title={\it{Title 2}}]
\addplot[black, thick, mark=o, only marks]
    table[x=A,y=B]{mydata.dat};

        \nextgroupplot [title={\it{Title 3}}]
\addplot[black, thick, mark=o, only marks]
    table[x=A,y=B]{mydata.dat};

        \nextgroupplot [title={\it{Title 4}}]
\addplot[black, thick, mark=o, only marks]
    table[x=A,y=B]{mydata.dat};

        \nextgroupplot [title={\it{Title 5}}]
\addplot[black, thick, mark=o, only marks]
    table[x=A,y=B]{mydata.dat};

         \end{groupplot}

    \end{tikzpicture}
    }
  \end{figure}




\end{document}

y con

        \nextgroupplot [xshift=1.2in,title={\it{Title 4}}]
\addplot[black, thick, mark=o, only marks]
    table[x=A,y=B]{mydata.dat};

        \nextgroupplot [xshift=1.2in,title={\it{Title 5}}]
\addplot[black, thick, mark=o, only marks]
    table[x=A,y=B]{mydata.dat};

ingrese la descripción de la imagen aquí

Respuesta2

Otra alternativa: agregar \hspace*{-4cm}(ajustar cuántos centímetros desea lograr un bonito centrado). Por ejemplo:

\documentclass[]{article}
    \usepackage{pgfplots, alphalph}
    \usepgfplotslibrary{groupplots}

\begin{document}

\begin{figure}
\hspace*{-4cm}
    \begin{tikzpicture}[font=\footnotesize\sffamily]
      \begin{groupplot}[
         group style={group size=3 by 2, vertical sep=70pt,
    ylabels at=edge left
    },
          view={0}{90},
          width=5.2cm,
          height=5.2cm,
      scale only axis,
      scaled ticks = false,
      tick label style={/pgf/number format/fixed},
      title={My title},
      xlabel={x-axis},
      ylabel={y-axis}],
          unbounded coords=jump]
        ]
        \nextgroupplot [title={\it{Title 1}}]       
\addplot[black, thick, mark=o, only marks]
    coordinates {
        };

        \nextgroupplot [title={\it{Title 2}}]      
\addplot[black, thick, mark=o, only marks]
    coordinates {
        };

        \nextgroupplot [title={\it{Title 3}}]      
\addplot[black, thick, mark=o, only marks]
    coordinates {
        };

        \nextgroupplot [title={\it{Title 4}}]      
\addplot[black, thick, mark=o, only marks]
    coordinates {
        };

        \nextgroupplot [title={\it{Title 5}}]      
\addplot[black, thick, mark=o, only marks]
    coordinates {
        };

         \end{groupplot}

    \end{tikzpicture}
  \end{figure}



\end{document}

ingrese la descripción de la imagen aquí

información relacionada