扭曲复杂的阴影

扭曲复杂的阴影

我正在尝试在 Ti 中重新创建图像Z。下面左边的是原作,下面右边的是我迄今为止的作品。

在此处输入图片描述 在此处输入图片描述

这是一个将生成我当前结果的 MWE:

\documentclass[margin=2mm]{standalone}

\usepackage{tikz}
\usepackage{amsmath}

\usetikzlibrary{decorations.pathreplacing,positioning}

\begin{document}




\pgfdeclareverticalshading{rainbow}{2cm}{color(0mm)=(red); color(4mm)=(orange); color(7mm)=(yellow); color(8mm)=(yellow); color(11mm)=(green); color(14mm)=(blue!50); color(15mm)=(blue!50); color(20mm)=(purple)}
\begin{tikzpicture}[yscale=1.4]
    \footnotesize
    \begin{scope}[
        every node/.style={black,midway,text width=2cm,align=center}
    ]
        \fill [gray!50] (0,0) rectangle (2,1) node{Radio waves};
        \fill [brown!65!black!55] (0,1) rectangle (2,3.5) node{Microwave};
        \fill [brown!60!red!40] (0,3.5) rectangle (2,4.75) node{Thermal infrared};
        \fill [brown!40!red!60] (0,4.75) rectangle (2,5.625) node{Middle infrared};
        \fill [brown!20!red!70] (0,5.625) rectangle (2,6.375) node{Shortwave infrared};
        \fill [red!80] (0,6.375) rectangle (2,6.875) node{Near infrared};
        \shade [shading=rainbow] (0,6.875) rectangle (2,7.5) node{Visible};
        \fill [red!60!blue!30] (0,7.5) rectangle (2,8.75) node{Ultraviolet};
        \fill [red!20!blue!27] (0,8.75) rectangle (2,10.375) node{X-rays};
        \fill [red!20!blue!27] (0,10.375) rectangle (2,12) node{Gamma rays};
    \end{scope}
    
    \draw (0,0) -- (0,12);
    \draw (2,0) -- (2,12);
    \draw [densely dashed] (0,7.75) -- ++(2,0) node[right,text width=1cm]{0.28};
    \foreach \y/\val in {1/$10^6$\\(1 m),3.5/$10^3$\\(1 mm),4.75/5.50,5.625/3.00,6.375/1.50,6.875/0.70,7.5/0.40,8.75/$0.01(10^{-2})$,10.375/} {
        \draw (0,\y) -- ++(2,0) node[right,text width=1cm]{\val};
    }
    \node [anchor=west,text width=1cm] at (2,2.6) {$10^4$};
    \node [anchor=west,text width=1cm] at (2,9.6) {$10^{-4}$};
    \node [anchor=west,text width=1cm] at (2,11.8) {$10^{-8}$};
    \node [rotate=90] at (3.6,6) {Micrometers ($\mu$m)};

    \shade [shading=rainbow] (-2,6.375) rectangle (-1.5,8);
    \draw [densely dashed] (0,6.875) -- (-1.5,6.375) (0,7.5) -- (-1.5,8);
    \begin{scope}[node distance=-1.6pt]
        \node (a) at (-2.5,7.9) {0.400};
        \node (b) [below=of a]  {0.424};
        \node (c) [below=of b]  {0.491};
        \node (d) [below=of c]  {0.575};
        \node (e) [below=of d]  {0.585};
        \node (f) [below=of e]  {0.647};
        \node (g) [below=of f]  {0.710};
    \end{scope}
    \begin{scope}[
        every path/.style={decorate,decoration={brace,mirror}},
        every node/.style={left=1.3cm,anchor=west}
    ]
        \draw (a.west) -- node(v){Violet} (b.west);
        \draw (b.west) -- node{Blue}   (c.west);
        \draw (c.west) -- node{Green}  (d.west);
        \draw (d.west) -- node{Yellow} (e.west);
        \draw (e.west) -- node{Orange} (f.west);
        \draw (f.west) -- node(r){Red}    (g.west);
    \end{scope}
    \draw [decorate,decoration={brace,mirror}] (v.north west) -- node[rotate=90,above]{Visible light} (r.south west);

    \node [anchor=west,text width=3cm] at (-4.7,11.2) {Energy discharges from atomic nuclei};
    \node [anchor=west,text width=3cm] at (-4.7,9.5) {\quad(hard X-ray)\\Medical applications\\\quad(soft X-ray)};
    \node [anchor=west,text width=3cm] at (-4.7,4.1) {Heat lamp};
    \node [anchor=west,text width=3cm] at (-4.7,2.3) {Microwave\\radar};
    \node [anchor=west,text width=3cm] at (-4.7,0.5) {Television\\FM radio\\[6pt]AM radio};
\end{tikzpicture}




\end{document}

如您所见,我几乎已经把所有东西都弄得足够接近我喜欢的样子了。但是,我不知道如何创建向外平滑扇形的彩虹阴影。重复一遍,我可以通过\pgfdeclareverticalshading如图所示线性地进行彩虹阴影,但我不知道如何从标记为“可见”的挤压阴影到左侧带有数字的较长阴影创建梯形过渡区域。我知道这是一件小事,但我只是很好奇,因为我已经浏览过这个网站和 PGF 手册,但还是没能弄明白 :)

如果我可以提供其他任何东西,请告诉我,谢谢!

答案1

使用一个小技巧。

\documentclass[margin=2mm]{standalone}

\usepackage{tikz}
\usepackage{amsmath}

\usetikzlibrary{decorations.pathreplacing,positioning}

\begin{document}




\pgfdeclareverticalshading{rainbow}{2cm}{color(0mm)=(red); color(4mm)=(orange); color(7mm)=(yellow); color(8mm)=(yellow); color(11mm)=(green); color(14mm)=(blue!50); color(15mm)=(blue!50); color(20mm)=(purple)}
\begin{tikzpicture}[yscale=1.4]
    \footnotesize
    \begin{scope}[
        every node/.style={black,midway,text width=2cm,align=center}
    ]
        \fill [gray!50] (0,0) rectangle (2,1) node{Radio waves};
        \fill [brown!65!black!55] (0,1) rectangle (2,3.5) node{Microwave};
        \fill [brown!60!red!40] (0,3.5) rectangle (2,4.75) node{Thermal infrared};
        \fill [brown!40!red!60] (0,4.75) rectangle (2,5.625) node{Middle infrared};
        \fill [brown!20!red!70] (0,5.625) rectangle (2,6.375) node{Shortwave infrared};
        \fill [red!80] (0,6.375) rectangle (2,6.875) node{Near infrared};
        \shade [shading=rainbow] (0,6.875) rectangle (2,7.5) node{Visible};
        \fill [red!60!blue!30] (0,7.5) rectangle (2,8.75) node{Ultraviolet};
        \fill [red!20!blue!27] (0,8.75) rectangle (2,10.375) node{X-rays};
        \fill [red!20!blue!27] (0,10.375) rectangle (2,12) node{Gamma rays};
    \end{scope}
    
    \draw (0,0) -- (0,12);
    \draw (2,0) -- (2,12);
    \draw [densely dashed] (0,7.75) -- ++(2,0) node[right,text width=1cm]{0.28};
    \foreach \y/\val in {1/$10^6$\\(1 m),3.5/$10^3$\\(1 mm),4.75/5.50,5.625/3.00,6.375/1.50,6.875/0.70,7.5/0.40,8.75/$0.01(10^{-2})$,10.375/} {
        \draw (0,\y) -- ++(2,0) node[right,text width=1cm]{\val};
    }
    \node [anchor=west,text width=1cm] at (2,2.6) {$10^4$};
    \node [anchor=west,text width=1cm] at (2,9.6) {$10^{-4}$};
    \node [anchor=west,text width=1cm] at (2,11.8) {$10^{-8}$};
    \node [rotate=90] at (3.6,6) {Micrometers ($\mu$m)};

    \shade [shading=rainbow] (-2,6.375)coordinate(DLVis) rectangle (-1.5,8) coordinate(URVis);
% trick
    \foreach \hShift[evaluate=\hShift as \vShift using \hShift/3] in {0,0.01,...,1.5} {
    \shade[shading=rainbow] ([shift={(\hShift cm,-\vShift cm)}]URVis) -- +(0.01cm,0) |- ([shift={(\hShift cm,\vShift cm)}]URVis |- DLVis) -- cycle;
    }

    %\draw [densely dashed] (0,6.875) -- (-1.5,6.375) (0,7.5) -- (-1.5,8);
    \begin{scope}[node distance=-1.6pt]
        \node (a) at (-2.5,7.9) {0.400};
        \node (b) [below=of a]  {0.424};
        \node (c) [below=of b]  {0.491};
        \node (d) [below=of c]  {0.575};
        \node (e) [below=of d]  {0.585};
        \node (f) [below=of e]  {0.647};
        \node (g) [below=of f]  {0.710};
    \end{scope}
    \begin{scope}[
        every path/.style={decorate,decoration={brace,mirror}},
        every node/.style={left=1.3cm,anchor=west}
    ]
        \draw (a.west) -- node(v){Violet} (b.west);
        \draw (b.west) -- node{Blue}   (c.west);
        \draw (c.west) -- node{Green}  (d.west);
        \draw (d.west) -- node{Yellow} (e.west);
        \draw (e.west) -- node{Orange} (f.west);
        \draw (f.west) -- node(r){Red}    (g.west);
    \end{scope}
    \draw [decorate,decoration={brace,mirror}] (v.north west) -- node[rotate=90,above]{Visible light} (r.south west);

    \node [anchor=west,text width=3cm] at (-4.7,11.2) {Energy discharges from atomic nuclei};
    \node [anchor=west,text width=3cm] at (-4.7,9.5) {\quad(hard X-ray)\\Medical applications\\\quad(soft X-ray)};
    \node [anchor=west,text width=3cm] at (-4.7,4.1) {Heat lamp};
    \node [anchor=west,text width=3cm] at (-4.7,2.3) {Microwave\\radar};
    \node [anchor=west,text width=3cm] at (-4.7,0.5) {Television\\FM radio\\[6pt]AM radio};
\end{tikzpicture}




\end{document}

阴影失真

相关内容