2

I read most of answer to similar questions, but they did not help me. I have two problems: these are two graphics that I am trying to place side by side. But:

  • firstly, they turn out to be shifted relative to the signatures a and b,
  • and secondly, the y-label will shift to the left greatly, which also does not look godd.

Near, you can see my code and result.

    \documentclass[14pt,a4paper]{article}

\usepackage{graphicx} 
\usepackage{subcaption}
\usepackage{gnuplottex}


\begin{document}
\begin{figure}[h!] 
\begin{subfigure} [b]{0.50\textwidth}
\centering
 \fontsize{8}{8}\selectfont
 \begin{gnuplot}
  set terminal epslatex size 3,2
  set grid   
  set xlabel "X"
  set ylabel "Y $_a$"
  set xrange [0:5]
  set yrange [0:25]  
  plot x**2 title "x$^2$" w lp lc 8 pt 5 ps 1.1 lw 2
 \end{gnuplot}
 \caption{}
\end{subfigure}
\begin{subfigure} [b]{0.5\textwidth}
\centering
 \fontsize{8}{8}\selectfont
 \begin{gnuplot}
  set terminal epslatex size 3,2
  set grid   
  set xlabel "X"
  set ylabel "Y $_a$"
  set xrange [0:5]
  set yrange [0:25]  
  plot x**2 title "x$^2$" w lp lc 8 pt 5 ps 1.1 lw 2
 \end{gnuplot}
 \caption{}
\end{subfigure}
\caption{blabla}
\end{figure}

\end{document}

enter image description here

2
  • Your code is not compileable.
    – AndréC
    Dec 18, 2018 at 20:19
  • Changed the code, I hope it will work. Dec 18, 2018 at 20:42

1 Answer 1

1

Your images are too big:

\documentclass{article}
\usepackage{graphicx} 
\usepackage{subcaption}
\usepackage{gnuplottex,showframe}
\begin{document}

\begin{figure}
\begin{subfigure}[b]{\textwidth}
\centering
\footnotesize%
\begin{gnuplot}
            set terminal epslatex size 3,2
            set grid   
            set xlabel "X"
            set ylabel "Y $_a$"
            set xrange [0:5]
            set yrange [0:25]  
            plot x**2 title "x$^2$" w lp lc 8 pt 5 ps 1.1 lw 2
\end{gnuplot}
\caption{}
\end{subfigure}

\begin{subfigure}[b]{\textwidth}
        \centering
\footnotesize
        \begin{gnuplot}
            set terminal epslatex size 3,2
            set grid   
            set xlabel "X"
            set ylabel "Y $_a$"
            set xrange [0:5]
            set yrange [0:25]  
            plot x**2 title "x$^2$" w lp lc 8 pt 5 ps 1.1 lw 2
        \end{gnuplot}
\caption{}
\end{subfigure}
\caption{blabla}
\end{figure}    

\begin{figure}
    \begin{subfigure}[b]{0.49\textwidth}
    \footnotesize%
        \begin{gnuplot}
            set terminal epslatex size 2.5,1.75
            set grid   
            set xlabel "X"
            set ylabel "Y $_a$"
            set xrange [0:5]
            set yrange [0:25]  
            plot x**2 title "x$^2$" w lp lc 8 pt 5 ps 1.1 lw 2
        \end{gnuplot}
        \caption{}
    \end{subfigure}
%
    \begin{subfigure}[b]{0.49\textwidth}
        \footnotesize
        \begin{gnuplot}
            set terminal epslatex size 2.5,1.75
            set grid   
            set xlabel "X"
            set ylabel "Y $_a$"
            set xrange [0:5]
            set yrange [0:25]  
            plot x**2 title "x$^2$" w lp lc 8 pt 5 ps 1.1 lw 2
        \end{gnuplot}
        \caption{}
    \end{subfigure}
    \caption{blabla}
\end{figure}    

\end{document}

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .