You can either use an integer number of puffs or the intersections
library and find the points manually.
Notes:
- I used named coordinates for
(2,1)
and (2,2)
to not repeat hard-coded coordinates.
- The anchor
.center
is neede because in the second example (the one to (2,1)
) the (cloud) -- (2,1)
does not intersect with the cloud’s border.
Code
\documentclass[tikz]{standalone}
\usetikzlibrary{shapes,intersections}
\begin{document}
\begin{tikzpicture}
\node[
name path=cloud,
cloud, cloud puffs=15.7,
minimum width=3cm, draw,
] (cloud) at (0,0) {Cloud};
\path[name path=path22] (cloud.center) -- (2, 2) coordinate (to22);
\path[name path=path21] (cloud.center) -- (2, 1) coordinate (to21);
\draw[->,
name intersections={of=cloud and path22,name=from22},
name intersections={of=cloud and path21,name=from21}
] (from22-1) edge (to22)
(from21-1) to (to21);
\end{tikzpicture}
\end{document}
Output
As percusse mentions in his comment, adding the slash can be done using a decoration (in this case, using the decorations.markings
library); the number (if it's not part of the decoration) can be added in the path, using a node; something like:
\draw (<coord1>) -- node[below] {<text>} (<coord2>);
I also fixed the dashed arrows using the perpendicular coordinate system to guarantee that they are horizontal.
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{calc,decorations.markings}
\begin{document}
\begin{tikzpicture}[
inverter/.style={rectangle,draw,inner sep=2pt,minimum size=6mm},
dot/.style={circle,inner sep=0pt,minimum size=0.5mm,draw,fill=black},
decoration={
markings,
mark= at position 0.5 with {\node[font=\footnotesize] {/};}
}
]
\node (x) at (0,0) {$x$};
\node (delta) at (1,0) [shape=rectangle,draw,minimum height=18mm,minimum width=6mm] {$\delta$};
\node (ah) at ( 2, 0.5) [inverter] {$a_h$};
\node (al) at ( 2, -0.5) [inverter] {$a_l$};
\draw [->] (x) -- (delta);
\draw [->,dashed,dash pattern=on 1pt off 1pt,postaction={decorate}] (delta.58.75) -- node[below=1pt] {\tiny 4} (ah.west|-delta.58.75);
\draw [->,dashed,dash pattern=on 1pt off 1pt,postaction={decorate}] (delta.-58.75) -- node[below=1pt] {\tiny 4} (al.west|-delta.-58.75);
\end{tikzpicture}
\end{document}
As suggested by percusse, another, perhaps better way, to use the perpendicular coordinate system to have the arrows horizontal is to use:
\draw [->,dashed,dash pattern=on 1pt off 1pt,postaction={decorate}] (delta.east|-ah) -- node[below=1pt] {\tiny 4} (ah);
\draw [->,dashed,dash pattern=on 1pt off 1pt,postaction={decorate}] (delta.east|-al) -- node[below=1pt] {\tiny 4} (al);
Best Answer
All you need to do is change the
axis line style
:As @azetina notes, you can also use
stealth
, by doingaxis line style={stealth-stealth},
, which might be more aesthetically appealing: