我正在尝试制作如下的映射图:
\begin{tikzpicture}
\tikzset{
elps/.style 2 args={draw,ellipse,minimum width=#1,minimum height=#2},
node distance=3 cm,
font=\footnotesize,
>=latex, }
\node(y)[elps={2cm}{3cm},label={below left:$X$}]{};
\node(v)[elps={2cm}{3cm},right=3 of y,label={below left:$ Y $}]{};
\node(z)[elps={2cm}{3cm},right=3 of v,label={below right:$Z$}]{};
\draw[->](y)to[bend left=10] node[below]{$ f $}(v);
\draw[->](v)to[bend left=10] node[below right]{$ g $}(z);
\draw[->](y)to[bend right=40]node[below]{$ h $}(z);
\end{tikzpicture}
现在我想从 $X$ 中指出一个元素 $x$,然后在 $Y$ 中指出 $f(x)$。那么我如何在 $X$ 中画一个点,命名为 $x$。谢谢。
答案1
例如,附加一个项目符号样式:
\documentclass[border=10pt]{standalone}
\usepackage{tikz}
\usetikzlibrary{shapes,positioning}
\begin{document}
\begin{tikzpicture}
\tikzset{
elps/.style 2 args={draw, ellipse,minimum width=#1, minimum height=#2},
node distance=3 cm,
font=\footnotesize,
>=latex,
% Add this style:
bullet/.style = {circle, inner sep=1pt, fill}}
\node(y)[elps={2cm}{3cm}, label={below left:$X$}]{};
\node(v)[elps={2cm}{3cm}, right=3 of y,label={below left:$ Y $}]{};
\node(z)[elps={2cm}{3cm}, right=3 of v,label={below right:$Z$}]{};
\draw[->](y)to[bend left=10] node[below]{$ f $}(v);
\draw[->](v)to[bend left=10] node[below right]{$ g $}(z);
\draw[->](y)to[bend right=40]node[below]{$ h $}(z);
% Add:
\node (element) [circle, inner sep = 1pt, fill,
below left = -0.5cm and -1 cm of y, label = {below right:$x$}] {};
\node (element) [bullet, below left = -0.5cm and -1 cm of y,
label = {below right:$x$}] {};
\node (value) [bullet, above left = -0.5cm and -1 cm of v,
label = {below right:$f(x)$}] {};
\draw[->, dashed] (element) to[bend right=20] (value);
\end{tikzpicture}
\end{document}