지수가 포함된 두 개의 독립형 플롯의 높이를 정확하게 제어하는 ​​방법

지수가 포함된 두 개의 독립형 플롯의 높이를 정확하게 제어하는 ​​방법

나는 pgfplots 패키지를 사용하여 두 개를 그렸습니다.독립형플롯. 나는 같은 높이의 두 플롯을 원하지만 실패했습니다.

내 논문에 표시된 이미지는 다음과 같습니다. 종이에 표시된 이미지 보시다시피 오른쪽이 왼쪽보다 조금 더 높습니다.

나는 다음과 같은 것들을 시도했습니다:

  1. 사용 scaled x ticks=false. 이 문제는 이 방법으로 해결될 수 있습니다. 하지만 숫자가 너무 가까워서 마음에 들지 않습니다. 나는 그것이 지수에 의한 것이라고 생각합니다. 그래서 2. 다음으로 해보았습니다.

  2. 지수를 다른 곳으로 이동하십시오.

    every x tick scale label/.style={ at={(rel axis cs:0.9,-0.2)} }

    그러나 이 문제는 해결될 수 없습니다. 그들은 여전히 ​​​​같은 높이가 아닙니다.

왼쪽 플롯의 코드:

\usepackage{pgfplots, pgfplotstable}
\pgfplotsset{compat=1.16}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{mathpazo}

\begin{document}
\pgfplotstableread[col sep=&, header=true]{
noise level   &rmse    &mean error
0             &13.8735 &5.4890
0.001         &14.8757 &5.6138
0.002         &16.6551 &5.8121
0.003         &18.1159 &6.0338
0.004         &20.0011 &6.2824
0.005         &21.9840 &6.5650
0.006         &23.8113 &6.8693
0.007         &25.8505 &7.1813
0.008         &27.4285 &7.5026
0.009         &29.4434 &7.8572
0.01          &31.1316 &8.2160
}\datatableentry



\begin{tikzpicture}
\begin{axis}[
  major grid style={line width=.5pt,draw=gray!50},
  title={\quad},
  xtick ={0.000,0.002,...,0.010},
  minor xtick ={0.001,0.003,...,0.01},
  ymajorgrids,
%  yminorgrids,
  xtick pos=left,
  ytick pos=left,
  scaled x ticks=true,
  ymin=0,
  xmin=0,
  xmax=0.01,
  ymax=40,
  legend style={legend pos= north west, legend cell align=left},
  mark size=2,
  xlabel={$p$},
  ylabel={Value (m)},
  tick scale binop=\times,
  semithick,
  height=5cm,
  mark repeat={2},
  every  x tick scale label/.style={
    at={(rel axis cs:0.9,-0.2)},overlay
  },
]
% red,gray,yellow,green,lime,black,red,blude,cyan
\addlegendentry{RMSE};
\addplot [color=orange,thick,mark=o] table [y=rmse, x=noise level] {\datatableentry};
\addlegendentry{mean error};
\addplot [color=cyan,thick,mark=diamond] table [y=mean error, x=noise level] {\datatableentry};
\end{axis}
\end{tikzpicture}
\end{document}

올바른 플롯의 코드

\documentclass{standalone}
\usepackage{pgfplots, pgfplotstable}
\pgfplotsset{compat=1.16}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{mathpazo}

\begin{document}
\pgfplotstableread[col sep=&, header=true]{
noise level   &rmse    &mean error
0             &13.8735 &5.4890
0.2           &13.8491 &5.4878
0.4           &14.1604 &5.5624
0.6           &14.2584 &5.6174
0.8           &14.5146 &5.7072
1.0           &15.0029 &5.8409
1.2           &14.9655 &5.9318
1.4           &15.2164 &6.0813
1.6           &15.5703 &6.2642
1.8           &15.9604 &6.4683
2.0           &16.4144 &6.7071
2.2           &16.8802 &6.9842
2.4           &17.6332 &7.3055
2.6           &18.2558 &7.6403
2.8           &19.1625 &8.0250
3.0           &19.9934 &8.4352
}\datatableentry



\begin{tikzpicture}
\begin{axis}[
  %grid style={line width=.1pt, draw=gray!20},
  major grid style={line width=.5pt,draw=gray!50},
  title={\quad},
%  minor y tick num=4,
%   xtick=data,
  xtick ={0,1,...,3},
  minor xtick={0.2,0.4,...,3},
  ymajorgrids,
%  yminorgrids,
  xtick pos=left,
  ytick pos=left,
  scaled y ticks=true,
  ymin=0,
  xmin=0,
  xmax=3,
  ymax=25,
  ytick={0,5,...,25},
  legend style={legend pos= north west,legend cell align=left},
  mark size=2,
  xlabel={$\sigma_n$(degrees)},
  ylabel={Value (m)},
  tick scale binop=\times,
  height=5cm,
  semithick,
  mark repeat={2},
  scaled x ticks={base 10:0}
]
% red,gray,yellow,green,lime,black,red,blude,cyan
\addlegendentry{RMSE};
\addplot [color=orange,thick,mark=o] table [y=rmse, x=noise level] {\datatableentry};
\addlegendentry{mean error};
\addplot [color=cyan,thick,mark=diamond] table [y=mean error, x=noise level] {\datatableentry};
\end{axis}
\end{tikzpicture}
\end{document}

다음과 같이 용지에 삽입됩니다.

\begin{figure}[htb]
  \centering
  \subfloat[Performance  under different levels of increment noise]{\includegraphics[height=4cm]{incremental_noise/incremental_noise}}
\hspace{.5cm}
  \subfloat[Performance  under different levels of deviation noise]{\includegraphics[height=4cm]{deviation_noise/deviation_noise}}
  \caption{Resistence to different kind of noise.}
  \label{fig:noise_resistence}
\end{figure}

이 문제를 해결할 생각이 있나요? 감사해요!

답변1

나는 문제를 해결하기 위해 무엇을 해야 할지 알고 있었습니다. \raisebox{-0.25ex}[0pt][0pt]메인 tex 파일을 추가했는데 결과가 괜찮아 보입니다.이 답변 보기상세 사항은.

관련 정보