Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- % https://tex.stackexchange.com/a/356984/2288
- % https://chat.stackexchange.com/transcript/message/53146989#53146989
- \documentclass{article}
- \usepackage{pgfplots}
- \usepackage{siunitx}
- \usepackage[type=none]{fgruler}
- \usepackage[
- a4paper , includeheadfoot , right = 10mm , left = 10mm , top = 0 mm, headheight = 0 mm, headsep = 5 mm, foot = 5 mm, bottom = 0 mm, showframe
- ]{geometry}
- % http://tex.stackexchange.com/a/15002/100384
- \newcommand*{\getlength}[2]{%
- % Convert to `cm` and round to two fractional digits:
- \pgfmathsetmacro#1{round(0.0351459804*#2)}%
- }
- \pagestyle{empty}
- \begin{document}
- \vspace*{\fill}\vskip-\topskip
- \centering
- \begin{tikzpicture}
- \pgfmathsetmacro{\Hfactor}{0.95}% 0.9
- \pgfmathsetmacro{\Wfactor}{0.95}
- \getlength{\yMax}{\Hfactor*\textheight}
- \getlength{\xMax}{\Wfactor*\textwidth}
- \begin{axis}[
- set layers,
- width=\Wfactor\textwidth, height=\Hfactor\textheight,
- scale only axis, name=border,
- x = 1cm, y = 1cm,
- xtick={0,1,...,\xMax},
- ytick={0,1,...,\yMax},
- minor xtick={0,0.1,0.2,...,\xMax},
- minor ytick={0,0.1,0.2,...,\yMax},
- tick style = {line width = 0.6pt, black!40!white},
- minor tick style = {draw = none},
- major tick style = {draw = none},
- ticklabel style = {draw = none},
- xticklabels=\empty,
- yticklabels=\empty,
- axis line style = {-latex},
- grid = both,
- minor grid style={line width=0.2pt, black!20!white},
- major grid style={line width=0.6pt, black!60!white},
- ymin=0, ymax=\yMax,
- xmin=0, xmax=\xMax,
- ]
- \begin{pgfonlayer}{axis grid}
- \draw[line width=0.40pt, step=0.5cm, black!40!white] (axis cs: 0, 0) grid (axis cs: \xMax, \yMax);
- \end{pgfonlayer}
- \end{axis}
- % \pgfresetboundingbox
- % \path (border.south west) (border.north east);
- % \draw[red] (current bounding box.south west) rectangle (current bounding box.north east);
- \end{tikzpicture}\vspace*{\fill}
- \fgruler{lowerleft}{10mm}{5mm}
- \fgruler{upperright}{10mm}{5mm}
- \end{document}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement