Advertisement
Guest User

Untitled

a guest
May 4th, 2015
264
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.44 KB | None | 0 0
  1. begin{tikzpicture}
  2. begin{axis}[
  3. xlabel=Strike Price (K),
  4. ylabel={Put Value (p)}
  5. ]
  6. addplot [only marks=*,blue] plot coordinates {
  7. (40,10)
  8. (50,20)
  9. (70,30)
  10. };
  11. addplot [smooth=*,red] plot coordinates {
  12. (40,10)
  13. (70,30)
  14. };
  15. end{axis}
  16. end{tikzpicture}
  17.  
  18. documentclass{article}
  19. usepackage{pgfplots}
  20. pgfplotsset{compat=1.12}
  21. usepgfplotslibrary{fillbetween}
  22. begin{document}
  23. begin{tikzpicture}
  24. begin{axis}[
  25. xlabel=Strike Price (K),
  26. ylabel={Put Value (p)}
  27. ]
  28. addplot [mark=*,blue,smooth,name path=A] plot coordinates {
  29. (40,10)
  30. (50,20)
  31. (70,30)
  32. };
  33. addplot [mark=o,red,name path=B] plot coordinates {
  34. (40,10)
  35. (70,30)
  36. };
  37. addplot[olive!40] fill between[of=A and B];
  38. end{axis}
  39. end{tikzpicture}
  40. end{document}
  41.  
  42. documentclass{article}
  43. usepackage{pgfplots}
  44. pgfplotsset{compat=1.12}
  45. usepgfplotslibrary{fillbetween}
  46. begin{document}
  47. begin{tikzpicture}
  48. begin{axis}[
  49. xlabel=Strike Price (K),
  50. ylabel={Put Value (p)}
  51. ]
  52. %% the upper curve
  53. addplot [mark=*,blue,smooth,name path=A] plot coordinates {
  54. (40,10)
  55. (50,20)
  56. (70,30)
  57. };
  58. %% The lower curve
  59. addplot [no marks,green,smooth,name path=B] plot coordinates {
  60. (40,10)
  61. (60,15)
  62. (70,30)
  63. };
  64. %% the straight line
  65. addplot [mark=o,red,name path=C] plot coordinates {
  66. (40,10)
  67. (70,30)
  68. };
  69. %% filling
  70. addplot[olive!40] fill between[of=B and C];
  71. end{axis}
  72. end{tikzpicture}
  73. end{document}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement