How can i make a graph with clockwise orientation in latex? Such as this image
Asked
Active
Viewed 253 times
0
Stefan Pinnow
- 29,535
AndersJensen
- 53
-
3Have you already tried something you can show us? Its worthwile to have a look at the TikZ-package! – Bubaya Mar 29 '20 at 08:08
-
Well i have just made a normal graph but i have no clue how to make this. – AndersJensen Mar 29 '20 at 08:09
-
2How did you make the graph? Can you provide us with a minimal working example? – Bubaya Mar 29 '20 at 08:28
2 Answers
4
This is an answer using TikZ, a comprehensive graphics package with, besides, an excellent documentation and tutorial included therein.
Edit: To place multiple arrows on the line, one can use TikZ' decorations-library, as indicated by this answer. This gives:
\documentclass{scrartcl}
\usepackage{tikz}
\usetikzlibrary{patterns, quotes, positioning, decorations.markings}
\begin{document}
\begin{tikzpicture}[x=5mm, y=5mm, line width=0.75pt]
\draw (0,-5) to["$y$" at end] (0,5);
\draw (5,0) to["$x$" at start] (-5,0);
\draw[
pattern=north east lines,
decoration={
markings,
mark=at position 0.2 with {\arrow{<}},
mark=at position 0.6 with {\arrow{<}},
mark=at position 0.8 with {\arrow{<}}
},
postaction=decorate
] (-2,0) parabola[bend at end]
(0,4) coordinate (S)
parabola[at start] (2,0)
to cycle;
\node[right=9pt of S] {$y = 4 - x^2$};
\node[cyan, fill=white, inner sep=1pt, rounded corners] at (0.7,1.3) {$D$};
\end{tikzpicture}
\end{document}
Bubaya
- 2,279
-
Thanks! is it possible to get those arrows more places on the graph and also back on the X-line to start point? With D inside – AndersJensen Mar 29 '20 at 08:33
-
-
4
With use of the decorations.markings and patterns.meta library, graph is drawing by plot:
\documentclass[tikz, margin=3mm]{standalone}
\usetikzlibrary{arrows.meta,
decorations.markings,
patterns.meta}
\begin{document}
\begin{tikzpicture}[
decoration={
markings,% switch on markings
mark=between positions 0.2 and 0.8 step 0.2 with {\arrowreversed{stealth}}}
]
\draw[postaction={decorate}, semithick,
postaction={pattern={Lines[angle=45,distance={3pt},line width=0.2pt]},pattern color=gray}]
plot[domain=2:-2] (\x,4-\x*\x);
\node[right] at (1,3) {$y=4-x^2$};
\node at (1,1) {$D$};
\draw (-3,0) -- (3,0) node[below left] {$x$}
(0,-1) -- (0,5) node[below left] {$y$};
\end{tikzpicture}
\end{document}
Zarko
- 296,517
-
+1. When I compile your code, though, the arrowheads are forward- rather than backward-pointing. Am I missing something? – Mico Mar 29 '20 at 23:55

