Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- begin{tikzpicture}
- begin{axis}[
- xlabel=Strike Price (K),
- ylabel={Put Value (p)}
- ]
- addplot [only marks=*,blue] plot coordinates {
- (40,10)
- (50,20)
- (70,30)
- };
- addplot [smooth=*,red] plot coordinates {
- (40,10)
- (70,30)
- };
- end{axis}
- end{tikzpicture}
- documentclass{article}
- usepackage{pgfplots}
- pgfplotsset{compat=1.12}
- usepgfplotslibrary{fillbetween}
- begin{document}
- begin{tikzpicture}
- begin{axis}[
- xlabel=Strike Price (K),
- ylabel={Put Value (p)}
- ]
- addplot [mark=*,blue,smooth,name path=A] plot coordinates {
- (40,10)
- (50,20)
- (70,30)
- };
- addplot [mark=o,red,name path=B] plot coordinates {
- (40,10)
- (70,30)
- };
- addplot[olive!40] fill between[of=A and B];
- end{axis}
- end{tikzpicture}
- end{document}
- documentclass{article}
- usepackage{pgfplots}
- pgfplotsset{compat=1.12}
- usepgfplotslibrary{fillbetween}
- begin{document}
- begin{tikzpicture}
- begin{axis}[
- xlabel=Strike Price (K),
- ylabel={Put Value (p)}
- ]
- %% the upper curve
- addplot [mark=*,blue,smooth,name path=A] plot coordinates {
- (40,10)
- (50,20)
- (70,30)
- };
- %% The lower curve
- addplot [no marks,green,smooth,name path=B] plot coordinates {
- (40,10)
- (60,15)
- (70,30)
- };
- %% the straight line
- addplot [mark=o,red,name path=C] plot coordinates {
- (40,10)
- (70,30)
- };
- %% filling
- addplot[olive!40] fill between[of=B and C];
- end{axis}
- end{tikzpicture}
- end{document}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement