我有以下 MWE。我想淡化这个方块、标题和我将放在方块中的所有内容。
\documentclass{standalone}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
% % % % % Rectangle Model
\node (sensor) at (-6.5,-10){};
\node (sensor_rect1) at (-4.25,-7.25){};
\node (sensor_rect2) at (-8.75,-12){};
\draw[line width=2pt,rounded corners=1cm] (sensor_rect1) rectangle (sensor_rect2);
\node at (-6.5,-10.5) {\textbf{content here}};
\node at (-6.5,-12.25){\textbf{ model}};
\end{tikzpicture}
\end{document}
答案1
从评论中可以看出,您想淡化部分内容tikzpicture
以突出显示某一部分。
您可以将图表的一部分包裹在具有指定不透明度的范围内:
\documentclass{standalone}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
\node (sensor) at (-6.5,-10){};
\node (sensor_rect1) at (-4.25,-7.25){};
\node (sensor_rect2) at (-8.75,-12){};
\draw[line width=2pt,rounded corners=1cm] (sensor_rect1) rectangle (sensor_rect2);
\node at (-6.5,-10.5) {\textbf{content here}};
\node at (-6.5,-12.25){\textbf{ model}};
\begin{scope}[opacity=0.2]
\node (sensorb) at (0,-10){};
\node (sensorb_rect1) at (2.25,-7.25){};
\node (sensorb_rect2) at (-2.75,-12){};
\draw[line width=2pt,rounded corners=1cm] (sensorb_rect1) rectangle (sensorb_rect2);
\node at (0,-10.5) {\textbf{content here}};
\node at (0,-12.25){\textbf{ model}};
\end{scope}
\end{tikzpicture}
\end{document}
答案2
尝试这个:
\begin{tikzpicture}[color=gray!10]