サブフロート配列にカラーバーを配置する

サブフロート配列にカラーバーを配置する

私は、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

これは問題の解決策ではありませんが、垂直方向の位置合わせの問題を回避できる代替の配布です。

垂直形式のカラーマップの代わりに、図の上に水平に配置します。

\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

私も同じ問題を抱えていましたが、ゴンサロ・メディナさんが非常に役立つ解決策を提案してくれました。 このトピック

確認する価値はあります。特に、martin がここで質問したように、いくつかのサブ図とともに垂直のカラーバーが必要な場合にはそうです。

関連情報