我在 Tikz 中有下图,你能帮我把这个图的某些部分变得更透明吗?类似于附图。
\documentclass{standalone}
\usepackage{amsmath}
\usepackage{amsthm}
\usepackage{amssymb}
\usepackage{mathrsfs,dsfont}
\usepackage{color}
\usepackage{mathtools}
\usepackage{mathrsfs}
\usepackage{tikz}
\usepackage{verbatim}
\usetikzlibrary{shapes,arrows.meta,decorations, positioning, arrows.meta, calc, shapes.geometric}
\begin{document}
\begin{tikzpicture}[
font=\sf \scriptsize,
>=LaTeX,
cell/.style={rectangle, rounded corners=5mm, fill=green!15, draw,very thick,},
operator/.style={circle,draw,inner sep=-0.5pt,minimum height =0.5cm, fill=red!10, font = \large},
block/.style={draw, fill=blue!15, rectangle,
minimum height=2em, minimum width=4em, font = \LARGE},
bl/.style={draw, fill=blue!15, rectangle, rotate=90,
minimum height=2em, minimum width=4em, font = \LARGE}
sum/.style={draw, fill=blue!15, circle, node distance=1cm},
input/.style={coordinate},
output/.style={coordinate},
dot/.style = {circle,fill, inner sep=0.01pt, node contents={}}
function/.style={ellipse, draw,inner sep=1pt},
ct/.style={circle,draw,line width = .75pt,minimum width=1cm,inner sep=1pt,},
gt/.style={rectangle,draw,minimum width=4mm,minimum height=3mm,inner sep=1pt},
dot/.style = {circle,fill, inner sep=0.001mm, fill=black!15, node contents={}},
mylabel/.style={font=\scriptsize\sffamily},
ArrowC1/.style={rounded corners=.25cm,thick,},
ArrowC2/.style={rounded corners=.5cm,thick,},
ArrowC3/.style={rounded corners=.1cm,thick,},
dot/.style = {circle,fill, inner sep=0.01pt, node contents={}},
alr/.style = {Stealth-Stealth},
arr/.style = {-Stealth},]
\node [cell, minimum height =4.5cm, minimum width=7.4cm] at (2.7,-1.7){} ;
\node[operator, name = operator] {$\times$};
\node[operator, right = 3cm of operator ] (plus) {+};
\node[block, below = 2cm of operator] (kapa1) {$\kappa$};
\node[block, below = 2cm of plus] (kapa2) {$\tilde{\kappa}$};
\node[block, right = 0.35cm of kapa1] (kapa3) {$\kappa$};
\node[block, right = 0.35cm of kapa2] (kapa4) {$\kappa$};
\node[operator, above = 0.4cm of kapa4] (time2) {$\times$};
\node[operator, above = 0.7cm of kapa2 ] (times) {$\times$};
\node[block, above = 0.4cm of time2] (kapa5) {$\tilde{\kappa}$};
\node (dot1) [dot,below= 0.5cm of kapa1]{};
\node (dot2) [dot,below= 0.5cm of kapa2]{};
\node (dot3) [dot,below= 0.5cm of kapa3]{};
\node (dot4) [dot,below= 0.5cm of kapa4]{};
\node (dot5) [dot,left= 1.3cm of operator]{};
\node (dot6) [dot,left= 1.6cm of dot1]{};
\node (dot7) [dot,right= 0.6cm of time2]{};
\node (dot8) [dot,above= 2.8cm of dot7]{};
\node (dot9) [dot,left= 1cm of dot1]{};
\node[output, right = 3.21cm of plus] (ct) {$c(t)$};
\node (dot10) [dot,below= 0.8cm of dot9]{};
\node (dot11) [dot,left= 0.6cm of dot1]{};
\node[output, right = 0.8cm of dot7, font = \large] (h_t) {};
\draw[arr, line width=0.30mm] (kapa1) -- node[pos = 0.405, right, font = \Large]{$\varrho_t$}(operator);
\draw[arr, line width=0.30mm] (kapa2) -- node[pos = 0.405, right, font = \Large]{$\tilde{c}_t$}(times);
\draw[arr, line width=0.30mm] (times) -- node[pos = 0.405]{}(plus);
\draw[arr, line width=0.30mm] (kapa4) -- node[pos = 0.505, right, font = \Large]{$o_t$}(time2);
\draw[arr, line width=0.30mm] (time2) -- node[pos = 0.405]{}(kapa5);
\draw[arr, line width=0.30mm] (dot1) -- node[pos = 0.405]{}(kapa1);
\draw[arr, line width=0.30mm] (dot2) -- node[pos = 0.405]{}(kapa2);
\draw[arr, line width=0.30mm] (dot3) -- node[pos = 0.405]{}(kapa3);
\draw[arr, line width=0.30mm] (dot4) -- node[pos = 0.405]{}(kapa4);
\draw[ line width=0.30mm] (dot1) -- node{}(dot4);
\draw[arr, line width=0.30mm] (operator) -- node{}(plus);
\draw[arr, line width=0.30mm] (dot6) -| node{}(kapa4);
\draw[arr, line width=0.30mm] (kapa3) |- node[pos = 0.505, above right, font = \Large]{$I_t$}(times);
\draw[ line width=0.30mm] (dot6) |- node[above, font = \Large]{$c_{t-1}$}(dot1);
\draw[ line width=0.30mm] (dot5) |- node[pos = 0.405]{}(operator);
\draw[ line width=0.30mm, red] (kapa5) |- node[pos = 0.405]{}(plus);
\draw[ line width=0.30mm, red ] (kapa5) |- node[pos = 0.405]{}(plus);
\draw[ arr, line width=0.30mm, ] (dot5) -- node[above left, font = \Large]{$h_{t-1}$}(operator);
\draw[ line width=0.30mm] (time2) -- node[pos = 0.405]{}(dot7);
\draw[arr, line width=0.30mm] (dot7) -- node[pos = 0.905, right, font = \Large]{$h_t$}(dot8);
\draw[arr, line width=0.30mm] (time2) -- node[pos= 0.8,above right, font = \Large]{$h_t$}(h_t);
\draw[ArrowC2, line width=0.30mm] (dot10) |- node[pos= -.16, , font = \Large]{$x_t$}(dot11);
\draw[arr, line width=0.30mm, red] (kapa5) |- node[pos= 0.9,above right, font = \Large]{$c_t$}(ct);
\end{tikzpicture}
\end{document}
答案1
由于大多数组件需要不那么显眼,因此将其添加到opacity=0.25
的选项中tikzpicture
。这将使所有内容都不那么显眼。现在,分别转到您希望它们可见的组件并添加opacity=1
。这将覆盖 值的选项0.25
。
\documentclass[border=1cm]{standalone}
\usepackage{amsmath}
\usepackage{amsthm}
\usepackage{amssymb}
\usepackage{mathrsfs,dsfont}
\usepackage{color}
\usepackage{mathtools}
\usepackage{mathrsfs}
\usepackage{tikz}
\usepackage{verbatim}
\usetikzlibrary{shapes,arrows.meta,decorations, positioning, arrows.meta, calc, shapes.geometric}
\begin{document}
\begin{tikzpicture}[
opacity=0.25,
font=\sf \scriptsize,
>=LaTeX,
cell/.style={rectangle, rounded corners=5mm, fill=green!15, draw,very thick,},
operator/.style={circle,draw,inner sep=-0.5pt,minimum height =0.5cm, fill=red!10, font = \large},
block/.style={draw, fill=blue!15, rectangle,
minimum height=2em, minimum width=4em, font = \LARGE},
bl/.style={draw, fill=blue!15, rectangle, rotate=90,
minimum height=2em, minimum width=4em, font = \LARGE}
sum/.style={draw, fill=blue!15, circle, node distance=1cm},
input/.style={coordinate},
output/.style={coordinate},
dot/.style = {circle,fill, inner sep=0.01pt, node contents={}}
function/.style={ellipse, draw,inner sep=1pt},
ct/.style={circle,draw,line width = .75pt,minimum width=1cm,inner sep=1pt,},
gt/.style={rectangle,draw,minimum width=4mm,minimum height=3mm,inner sep=1pt},
dot/.style = {circle,fill, inner sep=0.001mm, fill=black!15, node contents={}},
mylabel/.style={font=\scriptsize\sffamily},
ArrowC1/.style={rounded corners=.25cm,thick,},
ArrowC2/.style={rounded corners=.5cm,thick,},
ArrowC3/.style={rounded corners=.1cm,thick,},
dot/.style = {circle,fill, inner sep=0.01pt, node contents={}},
alr/.style = {Stealth-Stealth},
arr/.style = {-Stealth},]
\node [cell, minimum height =4.5cm, minimum width=7.4cm,opacity=1] at (2.7,-1.7){} ;
\node[operator, name = operator] {$\times$};
\node[operator, right = 3cm of operator ] (plus) {+};
\node[block, below = 2cm of operator] (kapa1) {$\kappa$};
\node[block, below = 2cm of plus] (kapa2) {$\tilde{\kappa}$};
\node[block, right = 0.35cm of kapa1] (kapa3) {$\kappa$};
\node[block, right = 0.35cm of kapa2] (kapa4) {$\kappa$};
\node[operator, above = 0.4cm of kapa4] (time2) {$\times$};
\node[operator, above = 0.7cm of kapa2 ] (times) {$\times$};
\node[block, above = 0.4cm of time2] (kapa5) {$\tilde{\kappa}$};
\node (dot1) [dot,below= 0.5cm of kapa1]{};
\node (dot2) [dot,below= 0.5cm of kapa2]{};
\node (dot3) [dot,below= 0.5cm of kapa3]{};
\node (dot4) [dot,below= 0.5cm of kapa4]{};
\node (dot5) [dot,left= 1.3cm of operator]{};
\node (dot6) [dot,left= 1.6cm of dot1]{};
\node (dot7) [dot,right= 0.6cm of time2]{};
\node (dot8) [dot,above= 2.8cm of dot7]{};
\node (dot9) [dot,left= 1cm of dot1]{};
\node[output, right = 3.21cm of plus] (ct) {$c(t)$};
\node (dot10) [dot,below= 0.8cm of dot9]{};
\node (dot11) [dot,left= 0.6cm of dot1]{};
\node[output, right = 0.8cm of dot7, font = \large] (h_t) {};
\draw[arr, line width=0.30mm] (kapa1) -- node[pos = 0.405, right, font = \Large]{$\varrho_t$}(operator);
\draw[arr, line width=0.30mm] (kapa2) -- node[pos = 0.405, right, font = \Large]{$\tilde{c}_t$}(times);
\draw[arr, line width=0.30mm] (times) -- node[pos = 0.405]{}(plus);
\draw[arr, line width=0.30mm] (kapa4) -- node[pos = 0.505, right, font = \Large]{$o_t$}(time2);
\draw[arr, line width=0.30mm] (time2) -- node[pos = 0.405]{}(kapa5);
\draw[arr, line width=0.30mm] (dot1) -- node[pos = 0.405]{}(kapa1);
\draw[arr, line width=0.30mm] (dot2) -- node[pos = 0.405]{}(kapa2);
\draw[arr, line width=0.30mm] (dot3) -- node[pos = 0.405]{}(kapa3);
\draw[arr, line width=0.30mm] (dot4) -- node[pos = 0.405]{}(kapa4);
\draw[ line width=0.30mm] (dot1) -- node{}(dot4);
\draw[arr, line width=0.30mm] (operator) -- node{}(plus);
\draw[arr, line width=0.30mm] (dot6) -| node{}(kapa4);
\draw[arr, line width=0.30mm] (kapa3) |- node[pos = 0.505, above right, font = \Large]{$I_t$}(times);
\draw[ line width=0.30mm] (dot6) |- node[above, font = \Large]{$c_{t-1}$}(dot1);
\draw[ line width=0.30mm] (dot5) |- node[pos = 0.405]{}(operator);
\draw[ line width=0.30mm, red, opacity=1] (kapa5) |- node[pos = 0.405]{}(plus);
\draw[ line width=0.30mm, red, opacity=1 ] (kapa5) |- node[pos = 0.405]{}(plus);
\draw[ arr, line width=0.30mm, ] (dot5) -- node[above left, font = \Large]{$h_{t-1}$}(operator);
\draw[ line width=0.30mm] (time2) -- node[pos = 0.405]{}(dot7);
\draw[arr, line width=0.30mm] (dot7) -- node[pos = 0.905, right, font = \Large]{$h_t$}(dot8);
\draw[arr, line width=0.30mm] (time2) -- node[pos= 0.8,above right, font = \Large]{$h_t$}(h_t);
\draw[ArrowC2, line width=0.30mm] (dot10) |- node[pos= -.16, , font = \Large]{$x_t$}(dot11);
\draw[arr, line width=0.30mm, red, opacity=1] (kapa5) |- node[pos= 0.9,above right, font = \Large]{$c_t$}(ct);
\end{tikzpicture}
\end{document}