0

How can I get equal scaling? In the MWE I would like to have it so that the grid consists of squares.

\documentclass{article}

\usepackage{geometry} \geometry{textwidth=150mm, textheight=270mm}

% Abbildungen erstellen, auch Graphen plotten \usepackage{tikz}

%For environment axis \usepackage{pgfplots}

\pgfplotsset{compat=1.13}

\begin{document}

\begin{center}

\begin{tikzpicture} \begin{axis}[ samples=60, domain=-10:10, xmax=11, ymin=-2, ymax=102, restrict y to domain=-2:121, axis lines=center, y=0.5cm/2.5, x=0.5cm, grid=both, xtick={-10,...,10}, ytick={0,2,...,100}, xlabel=$x$, xlabel style={at={(1,0)}, anchor=north}, ylabel=$f(x)$, ylabel style={at={(0.52,1)}, anchor=north} ] \addplot [style=ultra thick, blue, axis=equal] {x^2}; \end{axis} \end{tikzpicture} \end{center}

\end{document}

enter image description here

Stefan Pinnow
  • 29,535

1 Answers1

1

In this case it should be

y=0.5cm/2,
x=0.5cm,

to get a square grid.