我正在尝试在 tikz 中创建一个类似于二维空间中 Q 的 winset 的插图(在 Inkscape 中绘制)的图像。
下面的代码将圆圈绘制为节点,因为这似乎是确保它们都经过相同任意点 Q 的最简单方法(目前我并不关心圆圈的标签),并且接近我想要的效果,但我更喜欢 a) 在非重叠部分完全没有阴影,以及 b) 在重叠部分使用较暗的阴影。有什么建议吗?
\documentclass[11pt]{article}
\usepackage[english]{babel}
\usepackage{amsmath,amsthm,amssymb}
\usepackage{amsfonts}
\usepackage{adjustbox}
\usepackage{color}
\usepackage{tikz}
\usetikzlibrary{calc,matrix,decorations.pathreplacing,arrows.meta,patterns,decorations.markings,shapes,shapes.misc,positioning}
\usetikzlibrary{through,intersections}
\usepackage{graphicx}
\begin{document}
\begin{adjustbox}{max totalsize={\textwidth}{.9\textheight},center}
\begin{tikzpicture}
\node (q) [label=below:{Q},circle,fill=black,inner sep=0pt,minimum size=1pt] at (0,0) {\large\textbullet};
\node (a) [label=below:{A},circle,fill=black,inner sep=0pt,minimum size=1pt] at (3.5,3) {\large\textbullet};
\node (b) [label=below:{B},circle,fill=black,inner sep=0pt,minimum size=1pt] at (-5.5,1) {\large\textbullet};
\node (c) [label=below:{C},circle,fill=black,inner sep=0pt,minimum size=1pt] at (1,-4.5) {\large\textbullet};
\begin{scope}[blend group=color burn]
\begin{scope}[blend group=multiply]
\node [draw,thick, fill=lightgray,fill opacity=.1] at (a) [circle through={(q)}] {};
\node [draw,thick, fill=lightgray,fill opacity=.1] at (b) [circle through={(q)}] {};
\node [draw,thick ,fill=lightgray,fill opacity=.1] at (c) [circle through={(q)}] {};
\end{scope}
\end{scope}
\end{tikzpicture}
\end{adjustbox}
\end{document}
答案1
这是一种方法。我改变了圆圈,用极坐标将圆心置于 Q 周围,这样我就可以预先知道圆圈的半径。但您\clip
也可以用同样的方式用圆圈对阴影部分进行 s 处理。
\documentclass[border=2mm,tikz]{standalone}
\usetikzlibrary{calc}
\begin{document}
\begin{tikzpicture}[scale=2]
\def\ra{1.5} % radius, circle A
\def\rb{1.6} % radius, circle B
\def\rc{1.4} % radius, circle C
% coordinates
\coordinate (Q) at (0,0);
\coordinate (A) at (150:\ra);
\coordinate (B) at (45:\rb);
\coordinate (C) at (-65:\rc);
% clips
\begin{scope}[gray!50]
\clip (A) circle (\ra);
\fill (B) circle (\rb);
\fill (C) circle (\rc);
\end{scope}
\begin{scope}[gray!50]
\clip (B) circle (\rb);
\fill (C) circle (\rc);
\end{scope}
% circles and centers
\foreach\c/\r/\a in {A/\ra/110, B/\rb/135, C/\rc/180} % center/radius/angle for the label
{%
\draw (\c) circle (\r);
\fill (\c) circle (0.025) node [above] {$\c$};
\node at ($(\c)+(\a:\r+0.25)$) {$I_\c(Q)$};
}
\fill (Q) circle (0.025) node [below] {$Q$};
\end{tikzpicture}
\end{document}