Advertisement
diaaa

Untitled

Jan 7th, 2020
271
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.24 KB | None | 0 0
  1. %https://tex.stackexchange.com/a/356984/2288
  2.  
  3. \documentclass{article}
  4.  
  5. \usepackage{pgfplots}
  6. \usepackage{siunitx}
  7.  
  8. \usepackage[
  9. a4paper , margin = 10 mm ,
  10. ]{geometry}
  11.  
  12. \begin{document}
  13. \centering
  14.  
  15. \pagestyle{empty}
  16.  
  17.  
  18.  
  19. % http://tex.stackexchange.com/a/15002/100384
  20. \newcommand*{\getlength}[2]{%
  21. % Convert to `cm` and round to two fractional digits:
  22. \pgfmathsetmacro#1{round(0.0351459804*#2)}%
  23. }
  24.  
  25. \rotatebox{90}{
  26. \begin{tikzpicture}
  27. % a factor for measures, since pfplots produces slightly bigger images than defined
  28. % in width/height. This can be used to adjust that problem manually
  29. \pgfmathsetmacro{\factor}{0.90}
  30.  
  31. % we will need some length in `cm`, without units, and rounded
  32. \getlength{\yMax}{\factor*\textwidth}
  33. \getlength{\xMax}{\factor*\textheight}
  34.  
  35. \begin{axis}[
  36. set layers,
  37. width=\factor\textheight, height=\factor\textwidth,
  38. x = 1cm, y = 1cm,
  39. %axis lines = middle,
  40. %xlabel = {t\lbrack\si{\second}\rbrack},
  41. %ylabel = {x\lbrack\si{\metre}\rbrack},
  42. %x label style = {anchor = north west, font = \scriptsize},
  43. %y label style = {anchor = north east, font = \scriptsize, shift={(0,0.5cm)}},
  44. %xtick={0,1,...,\xMax},
  45. %ytick={0,1,...,\yMax},
  46. minor xtick={0,0.1,0.2,...,\xMax},
  47. minor ytick={0,0.1,0.2,...,\yMax},
  48. tick style = {line width = 0.6pt, black!40!white},
  49. minor tick style = {draw = none},
  50. ticklabel style = {draw = none},
  51. xticklabels=\empty,
  52. yticklabels=\empty,
  53. axis line style = {-latex},
  54. grid = both,
  55. minor grid style={line width=0.3pt, black!40!white},
  56. grid style={line width=0.6pt, black!40!white},
  57. ymin=0, ymax=\yMax,
  58. xmin=0, xmax=\xMax,
  59. ]
  60.  
  61. % now manually draw the 0.5cm grid on the grid layer
  62. \begin{pgfonlayer}{axis grid}
  63. \draw[line width=0.45pt, step=0.5cm, black!40!white] (axis cs: 0, 0) grid (axis cs: \xMax, \yMax);
  64. \end{pgfonlayer}
  65. \end{axis}
  66. \end{tikzpicture}
  67. }
  68.  
  69. \end{document}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement