von jaunita » Fr 23. Okt 2020, 18:06
\documentclass[12pt,oneside]{report}
\usepackage{xcolor}
\usepackage{tikz}
\begin{document}
\begin{figure}[h!]
\centering
\begin{tikzpicture}[scale=1]
\begin{axis}
[xmin=0, xmax=3.8, ymin=0, ymax=24, xlabel=$\pmb{x}$, ylabel=$\pmb{p}$, ticks=none,
label style={color=black,font=\bfseries}, axis x line=bottom, axis y line=left, x label style={at={(current axis.right of origin)},anchor= north, left=-5mm},
y label style={at={(current axis.above origin)},rotate=270, anchor=east, above=.5mm},
samples=5,]
% add line
\addplot[YellowGreen, thick, mark=none] (x,20-5*x) node[above]{$x^A(p)$}; % demand
\addplot[blue, thick, mark=none] (x, 2+4*x); % supply
\addplot[orange, thick, mark=none] (x, x*0+10); % supply
% add shaded area
\addplot[fill=YellowGreen, draw=none, fill opacity=0.5] coordinates {(0,20) (2,10) (0,10)} \closedcycle;
\addplot[fill=blue, draw=none, fill opacity=0.4] coordinates {(0,2) (0,10) (2,10) (0,2)} \closedcycle;
% add dotted lines
\draw[thick, white, dotted] (axis cs:2,0) -- (axis cs:2,10);
\draw[thick, transparent, dotted] (axis cs:0,10) -- (axis cs:2,10); \end{axis}
\draw[dashed] (0,2.36) -| (3.6,0) node[below]{$x^{\ast}$};
\draw[thin] (2.4,0) -| (0,2.4) node[left]{$p^{\ast}$};
\draw [black, fill=black] (3.625,0) circle (2pt);
\draw [black, fill=black] (0,2.36) circle (2pt);
\end{tikzpicture}
\caption{Gleichgewicht auf vollständigen Märkten}
\end{figure}
\end{document}
Würde gerne die Flächen innerhalb der figure-Umgebung bezeichnen und auch die Kurven jeweils am Ende. Leider funktioniert "node" nicht mit \addplot oder ich weiß nicht, wie das geht. Daher wäre ich um Hilfe sehr dankbar!
[code]\documentclass[12pt,oneside]{report}
\usepackage{xcolor}
\usepackage{tikz}
\begin{document}
\begin{figure}[h!]
\centering
\begin{tikzpicture}[scale=1]
\begin{axis}
[xmin=0, xmax=3.8, ymin=0, ymax=24, xlabel=$\pmb{x}$, ylabel=$\pmb{p}$, ticks=none,
label style={color=black,font=\bfseries}, axis x line=bottom, axis y line=left, x label style={at={(current axis.right of origin)},anchor= north, left=-5mm},
y label style={at={(current axis.above origin)},rotate=270, anchor=east, above=.5mm},
samples=5,]
% add line
\addplot[YellowGreen, thick, mark=none] (x,20-5*x) node[above]{$x^A(p)$}; % demand
\addplot[blue, thick, mark=none] (x, 2+4*x); % supply
\addplot[orange, thick, mark=none] (x, x*0+10); % supply
% add shaded area
\addplot[fill=YellowGreen, draw=none, fill opacity=0.5] coordinates {(0,20) (2,10) (0,10)} \closedcycle;
\addplot[fill=blue, draw=none, fill opacity=0.4] coordinates {(0,2) (0,10) (2,10) (0,2)} \closedcycle;
% add dotted lines
\draw[thick, white, dotted] (axis cs:2,0) -- (axis cs:2,10);
\draw[thick, transparent, dotted] (axis cs:0,10) -- (axis cs:2,10); \end{axis}
\draw[dashed] (0,2.36) -| (3.6,0) node[below]{$x^{\ast}$};
\draw[thin] (2.4,0) -| (0,2.4) node[left]{$p^{\ast}$};
\draw [black, fill=black] (3.625,0) circle (2pt);
\draw [black, fill=black] (0,2.36) circle (2pt);
\end{tikzpicture}
\caption{Gleichgewicht auf vollständigen Märkten}
\end{figure}
\end{document}[/code]
Würde gerne die Flächen innerhalb der figure-Umgebung bezeichnen und auch die Kurven jeweils am Ende. Leider funktioniert "node" nicht mit \addplot oder ich weiß nicht, wie das geht. Daher wäre ich um Hilfe sehr dankbar!