Advertisement
Guest User

Untitled

a guest
Jun 16th, 2019
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.61 KB | None | 0 0
  1. documentclass[tikz]{standalone}
  2. usepackage[utf8]{inputenc}
  3. usepackage{libertine}
  4. usepackage[libertine]{newtxmath} % Math fonts
  5.  
  6. usepackage{filecontents}
  7. begin{filecontents*}{testt.txt}
  8. -1 -1
  9. 1 2
  10. 2 4
  11. 3 2
  12. 4 1
  13. 5 0
  14. end{filecontents*}
  15.  
  16. begin{filecontents*}{testp.txt}
  17. -1 6
  18. 1 4
  19. 2 2
  20. 3 1.5
  21. 4 2
  22. 5 3
  23. end{filecontents*}
  24.  
  25. begin{document}
  26. begin{tikzpicture}[scale=2]
  27. fill[gray!10] (1,1) rectangle (4,4);
  28. node[rotate=90,above,font=small] at (1,2.5) {intensity};
  29. node[below,font=small] at (2.5,1) {size};
  30. begin{scope}
  31. clip (1,1) rectangle (4,4);
  32. % grid
  33. foreach i in {1,2,...,4}
  34. {
  35. draw[gray!50] (i,1) -- (i,4);
  36. draw[gray!50] (1,i) -- (4,i);
  37. }
  38. % axis labels
  39. foreach i in {2,3}
  40. {
  41. node[gray!50,above,fill=gray!10,font=tiny,inner sep=2pt,yshift=2pt] at (i,1) {i};
  42. node[gray!50,below,fill=gray!10,font=tiny,inner sep=2pt,yshift=-2pt] at (i,4) {i};
  43. node[gray!50,below,fill=gray!10,font=tiny,inner sep=2pt,xshift=2pt,rotate=90] at (1,i) {i};
  44. node[gray!50,above,fill=gray!10,font=tiny,inner sep=2pt,xshift=-2pt,rotate=90] at (4,i) {i};
  45. }
  46. % corner labels
  47. node[gray!50,above left,fill=gray!10,font=tiny,inner sep=2pt,xshift=-2pt,rotate=90] at (4,4) {4};
  48. node[gray!50,below right,fill=gray!10,font=tiny,inner sep=2pt,yshift=-2pt] at (1,4) {1};
  49. node[gray!50,above left,fill=gray!10,font=tiny,inner sep=2pt,yshift=2pt] at (4,1) {4};
  50. node[gray!50,below right,fill=gray!10,font=tiny,inner sep=2pt,xshift=2pt,rotate=90] at (1,1) {1};
  51. draw[line width=1pt] plot[smooth] file {testt.txt};
  52. draw[line width=1pt,red] plot[smooth] file {testp.txt};
  53. end{scope}
  54. draw[color=gray] (1,1) rectangle (4,4);
  55. end{tikzpicture}
  56. end{document}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement