서브플로트 배열에 컬러바 배치

서브플로트 배열에 컬러바 배치

matlab을 사용하여 생성한 다양한 히트맵을 표시하는 하위 부동 배열을 만들었습니다. 이것은 tikz로 생성한 컬러바를 포함하기 전까지는 매우 잘 작동합니다.여기에 이미지 설명을 입력하세요

내 접근 방식이 효과가 없다는 것을 알지만 어떻게 해야 할지 모르겠습니다. 위에서 볼 수 있는 내용을 생성한 방법은 다음과 같습니다.

\documentclass[12pt,a4paper, table]{report}

\usepackage{graphicx}
\usepackage{tikz,pgfplots}
\usepackage{tikz}
\usepackage{float}
\usetikzlibrary{shapes,arrows,shapes.multipart,positioning,decorations.text,fit}
\usepackage{lipsum}
\usepackage{tikz,pgfplots}
\usepackage{graphicx}
\usepackage{psfrag}
\usepackage{subfig}
\usepackage{subcaption}



\begin{document}%****************************************************

\begin{figure}[htp]
  \centering
  \subfloat[][]{\label{figur:1}\includegraphics[width=3cm]{Depth_n_10m_cy_0_rot_0.png}}
  \quad
  \subfloat[][]{\label{figur:2}\includegraphics[width=3cm]{Depth_n_10m_cy_3_rot_0.png}}
  \quad
  \fbox{\subfloat[][]{\label{figur:3}\includegraphics[width=3cm]{Depth_n_10m_cy_6_rot_0.png}}
 \begin{tikzpicture}
\begin{axis}[
    at={(-3,-0.5)},
%     hide axis,
%     scale only axis,
    height=0pt,
    width=0pt,
    colormap/jet,
      colorbar,
    point meta min=0,
    point meta max=10,
    colorbar style={
        height=0.20\textwidth,                 % Höhe der Colorbar
       xtick={2,4,6,8,10}
    }]
%     \addplot [] {};
    \end{axis}
\end{tikzpicture}}
  \\
  \subfloat[][]{\label{figur:4}\includegraphics[width=3cm]{Depth_n_10m_cy_0_rot_-0_1.png}}
  \quad
  \subfloat[][]{\label{figur:5}\includegraphics[width=3cm]{Depth_n_10m_cy_3_rot_-0_1.png}}
  \quad
  \subfloat[][]{\label{figur:6}\includegraphics[width=3cm]{Depth_n_10m_cy_6_rot_-0_1.png}}
  \\
  \subfloat[][]{\label{figur:7}\includegraphics[width=3cm]{Depth_n_10m_cy_0_rot_-0_2.png}}
  \quad
  \subfloat[][]{\label{figur:8}\includegraphics[width=3cm]{Depth_n_10m_cy_3_rot_-0_2.png}}
  \quad
  \subfloat[][]{\label{figur:9}\includegraphics[width=3cm]{Depth_n_10m_cy_6_rot_-0_2.png}}
  \label{fig:sensitivity towards pose}
  \caption{Figure}
  \end{figure}
\end{document} %******

컬러바를 이미지의 첫 번째 행에 수직으로 정렬하려고 합니다. 어떻게 해야 합니까?

답변1

이는 문제에 대한 해결책이 아니라 수직 정렬 문제를 피할 수 있는 대체 배포판입니다.

세로 형식의 컬러맵 대신 Figure 위에 가로로 배치합니다.

\documentclass[12pt,a4paper, table]{report}

\usepackage{graphicx}
\usepackage{tikz,pgfplots}
\usepackage{tikz}
\usepackage{float}
\usetikzlibrary{shapes,arrows,shapes.multipart,positioning,decorations.text,fit}
\usepackage{lipsum}
\usepackage{tikz,pgfplots}
\usepackage{graphicx}
\usepackage{psfrag}
\usepackage{subfig}
%\usepackage{subcaption}

\begin{document}

\begin{figure}[htp]
  \centering
  \begin{tabular}{ccc}
\multicolumn{3}{c}{\begin{tikzpicture}
\begin{axis}[
    at={(-3,-0.5)},
     hide axis,
     scale only axis,
    height=0pt,
    width=5cm,
    colormap/jet,
      colorbar horizontal,
    point meta min=0,
    point meta max=10,
    colorbar style={
%        height=0.20\textwidth,                 % Höhe der Colorbar
       xtick={2,4,6,8,10}
    }]
%     \addplot [] {};
    \end{axis}
\end{tikzpicture}}\\
                        \subfloat[][]{\label{figur:1}\includegraphics[width=3cm]{example-image}}
  &
  \subfloat[][]{\label{figur:2}\includegraphics[width=3cm]{example-image}}
  &
  \subfloat[][]{\label{figur:3}\includegraphics[width=3cm]{example-image}}\\
  \subfloat[][]{\label{figur:4}\includegraphics[width=3cm]{example-image}}
  &
  \subfloat[][]{\label{figur:5}\includegraphics[width=3cm]{example-image}}
  &
  \subfloat[][]{\label{figur:6}\includegraphics[width=3cm]{example-image}}
  \\
  \subfloat[][]{\label{figur:7}\includegraphics[width=3cm]{example-image}}
  &
  \subfloat[][]{\label{figur:8}\includegraphics[width=3cm]{example-image}}
  &
  \subfloat[][]{\label{figur:9}\includegraphics[width=3cm]{example-image}}
  \end{tabular}
  \label{fig:sensitivity towards pose}
  \caption{Figure}
  \end{figure}
  \end{document}

여기에 이미지 설명을 입력하세요

답변2

나도 같은 문제가 있었고 Gonzalo Medina는 다음에서 매우 유용한 솔루션을 제안했습니다. 이 주제.

확인해 볼 가치가 있습니다. 특히 마틴이 여기에서 요청한 것처럼 일부 하위 그림과 함께 수직 컬러바가 필요한 경우.

관련 정보