我有一张图中可以看到训练和测试分割的图。但是,我想让红色部分比蓝色部分“更宽”,但我在 shapes.multipart 中找不到允许我这样做的选项?
\documentclass{article}
\usepackage{graphicx}
\usepackage{tikz}
\usetikzlibrary{shapes.multipart}
\begin{document}
\tikzset{
state/.style={
rectangle split,
rectangle split parts=2,
rectangle split part fill={blue!30,red!20},
rounded corners,
rectangle split horizontal,
draw=black, thick,
minimum height=6em,
text width=0.8cm,
minimum width=1.5em,
inner sep=2pt,
text centered,
fill opacity=0.5
}
}
\begin{figure}
\centering
\begin{tikzpicture}
\node [state] at (0,0) {Train \nodepart{two} Test } ;
\end{tikzpicture}
\caption{Caption}
\label{fig:my_label}
\end{figure}
\end{document}