我如何使 tikz 图像淡出?

我如何使 tikz 图像淡出?

我有以下 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]

相关内容