Advertisement
diaaa

Untitled

Feb 26th, 2020
772
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Latex 1.95 KB | None | 0 0
  1.  
  2. % https://tex.stackexchange.com/a/356984/2288
  3. % https://chat.stackexchange.com/transcript/message/53146989#53146989
  4.  
  5. \documentclass{article}
  6.  
  7. \usepackage{pgfplots}
  8. \usepackage{siunitx}
  9. \usepackage[type=none]{fgruler}
  10.  
  11. \usepackage[
  12. a4paper , includeheadfoot , right = 10mm , left = 10mm , top = 0 mm, headheight = 0 mm, headsep = 5 mm, foot = 5 mm, bottom = 0 mm, showframe
  13. ]{geometry}
  14.  
  15. % http://tex.stackexchange.com/a/15002/100384
  16. \newcommand*{\getlength}[2]{%
  17.     % Convert to `cm` and round to two fractional digits:
  18.     \pgfmathsetmacro#1{round(0.0351459804*#2)}%
  19. }
  20.  
  21. \pagestyle{empty}
  22.  
  23. \begin{document}
  24.     \vspace*{\fill}\vskip-\topskip
  25.     \centering
  26.     \begin{tikzpicture}
  27.     \pgfmathsetmacro{\Hfactor}{0.95}% 0.9
  28.     \pgfmathsetmacro{\Wfactor}{0.95}
  29.     \getlength{\yMax}{\Hfactor*\textheight}
  30.     \getlength{\xMax}{\Wfactor*\textwidth}
  31.     \begin{axis}[
  32.     set layers,
  33.     width=\Wfactor\textwidth, height=\Hfactor\textheight,
  34.     scale only axis, name=border,
  35.     x = 1cm, y = 1cm,
  36.     xtick={0,1,...,\xMax},
  37.     ytick={0,1,...,\yMax},
  38.     minor xtick={0,0.1,0.2,...,\xMax},
  39.     minor ytick={0,0.1,0.2,...,\yMax},
  40.     tick style = {line width = 0.6pt, black!40!white},
  41.     minor tick style = {draw = none},
  42.     major tick style = {draw = none},
  43.     ticklabel style = {draw = none},
  44.     xticklabels=\empty,
  45.     yticklabels=\empty,
  46.     axis line style = {-latex},
  47.     grid = both,
  48.     minor grid style={line width=0.2pt, black!20!white},
  49.     major grid style={line width=0.6pt, black!60!white},
  50.     ymin=0, ymax=\yMax,
  51.     xmin=0, xmax=\xMax,
  52.     ]
  53.     \begin{pgfonlayer}{axis grid}
  54.     \draw[line width=0.40pt, step=0.5cm, black!40!white] (axis cs: 0, 0) grid (axis cs: \xMax, \yMax);
  55.     \end{pgfonlayer}
  56.     \end{axis}
  57.     %        \pgfresetboundingbox
  58.     %        \path (border.south west) (border.north east);
  59.     %        \draw[red] (current bounding box.south west) rectangle (current bounding box.north east);
  60.     \end{tikzpicture}\vspace*{\fill}
  61.     \fgruler{lowerleft}{10mm}{5mm}
  62.     \fgruler{upperright}{10mm}{5mm}
  63. \end{document}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement