我正在尝试重现此图。但我无法画出箭头?你能帮我吗?
另外,有没有办法以某种方式唯一地定义一个点的坐标,例如用 (a) 代替 (-2.5.6.0),对其他点也同样如此?非常感谢
\documentclass[margin=20pt]{standalone}
%\documentclass{minimal}
\usepackage{tikz}
\usepackage{bm}
\newcommand{\degre}{\ensuremath{^\circ}}
% \renewcommand{\rmdefault}{phv}
\renewcommand{\sfdefault}{phv}
\renewcommand{\rmdefault}{phv}
%\usepackage{mathpple}
%\usepackage{palatino}
\usepackage{lxfonts}
\usepackage{sansmath}
\begin{document}
\newcommand{\boundellipse}[3]% center, xdim, ydim
{(#1) ellipse (#2 and #3)
}
\begin{tikzpicture}
%\draw \boundellipse{0,0}{10}{5};
%\draw \boundellipse{4,1}{-2}{4};
\draw[very thick, fill=white] \boundellipse{-2,4}{2}{3};
\draw[very thick, fill=white] \boundellipse{4,4}{2}{3};
%%%ELEMENTI DI A
\draw [very thick,fill=black,fill opacity=1.0] (-2.5,6.0) circle (0.1cm);
\draw[color=black] (-2.5,6.0) node[below = 3] {\Large $a$};
\draw [very thick,fill=black,fill opacity=1.0] (-1.5,4.0) circle (0.1cm);
\draw[color=black] (-1.5,4.0) node[left = 3] {\Large $b$};
\draw [very thick,fill=black,fill opacity=1.0] (-2.0,2.0) circle (0.1cm);
\draw[color=black] (-2.0,2.0) node[left = 3] {\Large $c$};
\draw[color=black] (-4.0,2.0) node[left = 3] {\Huge $A$}; %%NOME INSIEME A
%%%ELEMENTI DI B
\draw [very thick,fill=black,fill opacity=1.0] (3.5,6.0) circle (0.1cm);
\draw[color=black] (3.5,6.0) node[below = 3] {\Large $1$};
\draw [very thick,fill=black,fill opacity=1.0] (2.5,4.0) circle (0.1cm);
\draw[color=black] (2.5,4.0) node[right = 3] {\Large $2$};
\draw [very thick,fill=black,fill opacity=1.0] (3.0,2.0) circle (0.1cm);
\draw[color=black] (3.0,2.0) node[right = 3] {\Large $3$};
\draw[color=black] (7.0,2.0) node[left = 3] {\Huge $B$}; %%NOME INSIEME B
\end{tikzpicture}
\end{document}
答案1
要获得弯曲的箭头,您可以执行以下操作\draw [->] (a) to[bend left] (b);
。
此外,正如我在评论中提到的,您可以使用\coordinate (foo) at (x,y);
它来保存坐标。但使用节点来保存点可能同样容易,例如定义一个样式,如
dot/.style={
circle,fill,draw,minimum size=2mm,inner sep=0
}
并使用
\node [dot,label=below:\Large$a$] (a) at (-2.5,6.0) {};
$a$
在指定的坐标处绘制一个填充黑色的圆圈,圆圈下方有一个。
\documentclass[margin=20pt]{standalone}
\usepackage{tikz}
\newcommand{\boundellipse}[3]% center, xdim, ydim
{(#1) ellipse (#2 and #3)
}
\begin{document}
\begin{tikzpicture}[
dot/.style={
circle,fill,draw,minimum size=2mm,inner sep=0
}]
\draw[very thick, fill=white] \boundellipse{-2,4}{2}{3};
\draw[very thick, fill=white] \boundellipse{4,4}{2}{3};
%%%ELEMENTI DI A
\node [dot,label=below:\Large$a$] (a) at (-2.5,6.0) {};
\node [dot,label=left:\Large$b$] (b) at (-1.5,4.0) {};
\node [dot,label=left:\Large$c$] (c) at (-2,2.0) {};
\node at (-4.3,2.0) {\Huge $A$}; %%NOME INSIEME A
%%%ELEMENTI DI B
\node [dot,label=below:\Large$1$] (1) at (3.5,6.0) {};
\node [dot,label=right:\Large$2$] (2) at (2.5,4.0) {};
\node [dot,label=right:\Large$3$] (3) at (3.0,2.0) {};
\node at (6.5,2.0) {\Huge $B$}; %%NOME INSIEME B
% arrows
\begin{scope}[red,-latex]
% all paths in the scope will be red by default, with the "latex" arrow tip at the end
\draw (a) to[bend left] (1);
\draw (b) to[bend left] (1);
\draw (b) -- (2);
\draw (b) to[bend right] (3);
\draw (c) to[bend right] (3);
\end{scope}
\end{tikzpicture}
\end{document}