我正在尝试重新创建如下图所示的图表。但是,当我在 中执行此操作时tikz
,它似乎将其放在背景中或三角线后面的某个地方。我尝试将代码放在其他地方,或添加命令\pgfdeclarelayer{}
,但似乎根本没有解决问题。我也无法太有效地旋转轨道,例如 dz2 轨道来制作屏幕截图。有没有办法为这些添加旋转参数?请帮忙。
图像:
西北地区:
\documentclass[tikz,border=3mm]{standalone}
\usepackage{xcolor}
\usepackage{tikz}
\usepackage{tikzorbital}
\usetikzlibrary{fadings,patterns,backgrounds,fit,arrows}
\pgfdeclarelayer{backbackground}
\pgfsetlayers{backbackground,background,main}
\tikzset{dz2/.pic={code=\orbital[pos={(0,0)},pcolor={red},ncolor={blue}]{dz2};}}
\tikzset{dxy/.pic={code=\orbital[pos={(0,0)},pcolor={red},ncolor={blue}]{dxy};}}
\begin{document}
\begin{tikzpicture}
\coordinate (A) at (0,0);
\begin{pgfonlayer}{background layer}
\draw[thick,color=black!50] (-1,0) -- (1,0) -- (0,-1.75) -- cycle;
\draw[thick,color=black!50] (0,0) -- (-0.5,-0.875) -- (0.5,-0.875) -- cycle;
\end{pgfonlayer}
\path (A) pic[scale=0.75]{dxy};
\end{tikzpicture}
\end{document}
答案1
该tikzorbital
包似乎在图层上进行绘图background
。将三角形放置在图层上backbackground
(定义为 下方background
)似乎可行:
代码:
\documentclass[border=3mm]{standalone}
\usepackage{xcolor}
\usepackage{tikz}
\usepackage{tikzorbital}
\usetikzlibrary{fadings,patterns,backgrounds,fit,arrows}
\pgfdeclarelayer{backbackground}
\pgfsetlayers{backbackground,background,main,foreground}
\tikzset{dz2/.pic={code=\orbital[pos={(0,0)},pcolor={red},ncolor={blue}]{dz2};}}
\tikzset{dxy/.pic={code=\orbital[pos={(0,0)},pcolor={red},ncolor={blue}]{dxy};}}
\begin{document}
\begin{tikzpicture}
\coordinate (A) at (0,0);
\path (A) pic[scale=0.75]{dxy};
\begin{pgfonlayer}{backbackground}
\draw[thick,color=black!50] (-1,0) -- (1,0) -- (0,-1.75) -- cycle;
\draw[thick,color=black!50] (0,0) -- (-0.5,-0.875) -- (0.5,-0.875) -- cycle;
\end{pgfonlayer}
\end{tikzpicture}%
\end{document}