Platzieren Sie die Farbleiste im Subfloat-Array

Platzieren Sie die Farbleiste im Subfloat-Array

Ich habe ein Subfloat-Array erstellt, das verschiedene Heatmaps anzeigt, die ich mit Matlab generiert habe. Das funktioniert sehr gut, bis ich eine Farbleiste einfügen möchte, die ich mit Tikz generiert habe.Bildbeschreibung hier eingeben

Ich weiß, dass mein Ansatz nicht funktionieren kann, aber ich weiß nicht, wie ich ihn machen soll. So habe ich das erzeugt, was Sie oben sehen können:

\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} %******

Ich möchte die Farbleiste vertikal an der ersten Bildreihe ausrichten. Wie geht das?

Antwort1

Dies ist keine Lösung für Ihr Problem, sondern eine alternative Verteilung, mit der das Problem der vertikalen Ausrichtung vermieden werden kann.

Statt einer Farbkarte im vertikalen Format platzieren Sie diese horizontal über der Abbildung.

\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}

Bildbeschreibung hier eingeben

Antwort2

Ich hatte das gleiche Problem und Gonzalo Medina schlug eine sehr nützliche Lösung vor in dieses Thema.

Es lohnt sich, das zu prüfen. Insbesondere, wenn man eine vertikale Farbleiste zusammen mit einigen Unterabbildungen benötigt, wie Martin hier gefragt hat.

verwandte Informationen