I have some trouble with the image alignment in a minipage environment. I have 4 images and I need to align them in 2 coloumns. Left col 1 big image, right col 3 smaller images. I want the top of the right images to be algigned with the top edge of the left image and I want the right bottom image to be aligned with the bottom edge of the left bigger image. So, far the prinicipal alignment works, but the images are not aligned at the bottom.
Further I want to have a shared colorbar for the 3 smaller images. I prepared an example (in excel) and attached it.
The images have a custom lookup table, therefore I think I have to add the colorbar as a 5th image. If this is the case, I think I will have to use tikz in order to get axes tiks and labels on the colorbar.
I am not sure, wether minipage is the optimal solution here. If anyone has a better approach it's welcome.
Code: Select all
\documentclass{article}
\usepackage{mwe}
\usepackage[utf8]{inputenc}
\usepackage{graphicx}
\usepackage{subfig}
\usepackage[format=hang,justification=raggedright]{caption}
\usepackage{multicol}
\usepackage[export]{adjustbox}
\usepackage{float}
\usepackage{pgfplotstable}
\usepackage{subfiles}
% Inserts a scale bar into an image
% Optional argument 1: the colour of the bar and text
% Argument 2: an \includegraphics command
% Argument 3: the real world width of the image
% Argument 4: the length of the scale bar in pixels
% Argument 5: the length of the scale bar in mm
% Argument 6: the unit
% Usage: \scalebar{\includegraphics[width=\linewidth]{image.png}}{1186}{9.887}{15}{mm}
% src: https://gist.github.com/rbnvrw/00312251b756f6b48084#file-latexscalebars-md
\newcommand{\scalebar}[6][white]{
\begin{tikzpicture}
\node[anchor=south west,inner sep=0] (image) { #2 };
\begin{scope}[x={(image.south east)},y={(image.north west)}]
\draw [#1, line width=0.1em] (0.04,1.2em) -- node[below,inner sep=0.1em, font=\scriptsize] {\SI{#5}{#6}} (#4/#3+0.04,1.2em);
\end{scope}
\end{tikzpicture}
}
\begin{document}
\begin{figure}[htbp!]
\centering
\begin{minipage}[t]{.45\textwidth}
\vspace{0pt}
\subfloat[][]{\scalebar{\includegraphics[width=.9\textwidth]{example-image-1x1}}{200}{0}{}{}\label{val13_axial}}\par
\hfill
\end{minipage}\hfill
\begin{minipage}[t]{.45\textwidth}
\vspace{0pt}
\subfloat[][]{\scalebar{\includegraphics[width=.4\textwidth]{example-image-1x1}}{200}{0}{}{}\label{val13_top}}
\vfill
\subfloat[][]{\scalebar{\includegraphics[width=.4\textwidth]{example-image-1x1}}{200}{0}{}{}\label{val13_mid}}
\vfill
\subfloat[][]{\scalebar{\includegraphics[width=.4\textwidth]{example-image-1x1}}{200}{0}{}{}\label{val13_bottom}}
\vspace{0pt}
\end{minipage}%
\caption{Write caption here!!! }
\label{fig:val13_quanti}
\end{figure}
\end{document}
Edit:
I am sorry, but the output produces an error, because "\rule" is not recognized. I am not quiet sure how to handle the included graphics prpoerly online??? The principal code works for me without errors, but
1) the images are not properly aligned
2) I don't know how to get the desired colorbar on the right.