You can add the option ->
to draw the arrows. To add the ellipses, load the shapes.geometric
library, and add
nodes={ellipse,draw,minimum width=<length>}
to the list of options for the \matrix
command. Here, ellipse
causes the node to have an elliptical shape, draw
draws the elliptical border of the node, and minimum width=<length>
specifies the minimal width of the node.
Code
\documentclass[border=2pt]{standalone}
\usepackage{tikz}
\usetikzlibrary{matrix,arrows,shapes.geometric}
\begin{document}
\begin{tikzpicture}[description/.style={fill=white,inner sep=2pt}]
\matrix (m)[matrix of math nodes,
row sep=3em,column sep=2.5em,
text height=1.5ex, text depth=0.25ex,
nodes={ellipse,draw,minimum width=2cm},
]{
X && Y \\
& V & \\
};
\path[->,font=\scriptsize]
(m-1-1) edge node[auto] {$ f $} (m-1-3)
edge node[description] {$ g \circ f $} (m-2-2)
(m-1-3) edge node[auto] {$ g $} (m-2-2);
\end{tikzpicture}
\end{document}
Output
Upadate
An example that more closely resemble your picture:
Code
\documentclass[border=2pt]{standalone}
\usepackage{tikz}
\usetikzlibrary{calc,positioning,shapes.geometric}
\begin{document}
\begin{tikzpicture}
\tikzset{
elps/.style 2 args={draw,ellipse,minimum width=#1,minimum height=#2},
node distance=3cm,
font=\footnotesize,
>=latex,
}
\node(x)[elps={1.3cm}{1cm},label={below left:$X$}]{};
\node(y)[elps={2cm}{1.2cm},right=of x,label={below left:$Y$}]{};
\node(v)[elps={1.5cm}{.9cm},below right=2cm of x,label={below left:$V$}]{};
\fill[gray!50]($(y.center)-(5pt,5pt)$)circle[x radius=.7cm,y radius=.3cm]coordinate(im);
\node at (im){$\mathrm{im}(f)$};
\draw[->](x)to[bend right]node[above right]{$g\circ f$}(v);
\draw[->](y)to[bend left]node[right]{$g$}(v);
\draw[->](x)to[bend left=20]node[above]{$f$}(y);
\end{tikzpicture}
\end{document}
Output
Is this what you are looking for?
The code:
\documentclass[tikz]{standalone}
\usetikzlibrary{arrows,decorations.markings}
\begin{document}
\scriptsize
\begin{tikzpicture}[>=stealth]
\path[<-] (2,0)node[right]{$x$} edge(-2,0) (0,1.5)node[above]{$y$} edge(0,-1);
\path[draw,red,thick, postaction={decorate,
decoration={markings,
mark=between positions 0.15 and 1 step 0.15 with {\arrow[blue]{>};}}}]
(0:1) node[below]{$R$} arc (0:180:1) node[below]{$-R$}--cycle;
\node at(0,.5){$\times$};
\end{tikzpicture}
\end{document}
Note that instead of drawing it with plot
, I used the simple (single line) arc
path, which enables you to do easy decorations. For this simple curve, using plot
will not give you much power, but for complicated functions it is indispensable.
Best Answer
No nice code, but something for you to start with. This code is just a rough write up (could need some more time) of the graphic you have supplied. It's not mathematically correct and is just a draw from point a to b-solution. There are other ways to do this much more precisely and more sophisticated.
If you want more control over the figure i suggest you make use of
\coordinate
s and heavy use of thecalc
-library. You can find every information you need about this in thepgfmanual
. There are also many examples that will help you getting together everything you need.Rendered image: