3

I'm working on a frame where I progressively show four different images using two different datasets and across two different conditions. Hence, I was thinking to use a 2×2 table to do so.

However, I'm facing some issues with the leftmost part of the table I'm working on; specifically, the dataset row should be separated by a vertical line from the below: samples and genomes which also should be rotated and vertically centered in the cell.

It also appears the spacing and alignment is akward between dataset and rows below as well as between thier cells content...

MWE

\documentclass[xcolor=svgnames,aspectratio=149]{beamer}
\usepackage[T1]{fontenc}

\usetheme{Singapore}
\usecolortheme{dolphin}

\usepackage{multirow}

\usepackage{tikz}
\usepackage{tikzducks}
\usepackage[table]{xcolor}

\begin{document}

\begin{frame}
\centering
\begin{tabular}{@{} cc cc @{}}
    & \multicolumn{2}{c@{}}{\textbf{approach}} \\
    \cline{2-3}
    & raw \texttt{d-values} & \texttt{KL} corrcted \\
    \multirow{2}{*}{\rotatebox[origin=c]{90}{\textbf{dataset}}}
     \rotatebox{90}{genomes} &
    \includegraphics<1->[width=1.25in,keepaspectratio]{example-image-a} &
    \visible<2->{\begin{tikzpicture}
        \duck[recedinghair=white,beard,book]
        \begin{scope}[scale=0.03,rotate=-20,xshift=500,yshift=700]
        \only<2->{\cellcolor{Gainsboro}}
        \draw[white,rotate around={36.9:(5,5)}] (5,5) rectangle ++(3,3);
        \draw[white,rotate around={36.9:(0,5)}] (0,5) rectangle ++(4,4);
        \draw[white] (0,0) rectangle (5,5);
        \end{scope}
    \end{tikzpicture}} \\
    \rotatebox{90}{samples} &
    \visible<3->{\begin{tikzpicture}
        \duck[recedinghair=white,beard,book]
        \begin{scope}[scale=0.03,rotate=-20,xshift=500,yshift=700]
        \only<3->{\cellcolor{Gainsboro}}
        \draw[white,rotate around={36.9:(5,5)}] (5,5) rectangle ++(3,3);
        \draw[white,rotate around={36.9:(0,5)}] (0,5) rectangle ++(4,4);
        \draw[white] (0,0) rectangle (5,5);
        \end{scope}
    \end{tikzpicture}} &
    \includegraphics<4>[width=1.25in,keepaspectratio]{example-image-a}
  \end{tabular}
\end{frame}

\end{document}

Final slide output output

Intended result sketch

2
  • \end{document} is missing Commented 10 hours ago
  • @samcarter_is_at_topanswers.xyz sorry my bad I didn't realize it... Commented 10 hours ago

1 Answer 1

3

I would suggest to use the tabularray package. This makes it very easy to draw partial lines:

\documentclass{beamer}

\usepackage{tikzducks}
\usepackage{tabularray}
\usepackage[export]{adjustbox}
\UseTblrLibrary{tikz}

\begin{document}

\begin{frame}
\centering
\begin{tblrtikzbelow}
\fill<3->[lightgray] (4-3.south west) rectangle (4-3.north east);
\fill<2->[lightgray] (3-4.south west) rectangle (3-4.north east);
\end{tblrtikzbelow}%
\begin{tblr}{
  colspec={cccc},
  vline{2} = {3-4}{solid,1pt},
  hline{2} = {3-4}{solid,1pt}
}
&& \SetCell[c=2]{} approach &\\
&& raw d-values & KL corrected\\
\SetCell[r=2]{} \rotatebox[origin=c]{90}{dataset} & \rotatebox[origin=c]{90}{genomes} &  \includegraphics<visible@1->[width=1.25in,keepaspectratio,valign=c]{example-image-a} &
    \visible<2->{\begin{adjustbox}{valign=c}
    \begin{tikzpicture}
        \duck[recedinghair=white,beard,book]
        \begin{scope}[scale=0.03,rotate=-20,xshift=500,yshift=700]
        \draw[white,rotate around={36.9:(5,5)}] (5,5) rectangle ++(3,3);
        \draw[white,rotate around={36.9:(0,5)}] (0,5) rectangle ++(4,4);
        \draw[white] (0,0) rectangle (5,5);
        \end{scope}
    \end{tikzpicture}\end{adjustbox}}\\
 & \rotatebox[origin=c]{90}{samples} & \visible<3->{\begin{adjustbox}{valign=c}\begin{tikzpicture}
         \duck[recedinghair=white,beard,book]
         \begin{scope}[scale=0.03,rotate=-20,xshift=500,yshift=700]
         \draw[white,rotate around={36.9:(5,5)}] (5,5) rectangle ++(3,3);
         \draw[white,rotate around={36.9:(0,5)}] (0,5) rectangle ++(4,4);
         \draw[white] (0,0) rectangle (5,5);
         \end{scope}
     \end{tikzpicture}\end{adjustbox}} & \includegraphics<visible@4>[width=1.25in,keepaspectratio,valign=c]{example-image-a}\\
\end{tblr}
\end{frame}

\end{document}

enter image description here

2
  • thanks for cleaning-up the code! In all honesty, I aslo attempted a tblr approach but I faced more difficulties (although I happen to use it more often now), but thanks to this solutions I could see what I was doing wrong! Commented 8 hours ago
  • You're welcome! Commented 8 hours ago

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.