Choosing a window for ninety graphs

A fixed viewport ruins most curves. Two heuristics pick a sensible one automatically.

Choosing a window for ninety graphs

Every worked example on the rule pages carries a graph, and a single fixed window would wreck most of them. Two rules pick the frame instead.

Find the domain

The curves are sampled across a wide range and the stretch where both actually exist is measured. That puts arcsin on roughly [−1.1, 1.1], artanh(2x) on [−0.55, 0.55], and the square root on the positive half — without any of those being written down by hand.

Then fix the aspect

A steep function on a wide window draws as a vertical stripe. If the vertical spread is extreme relative to the horizontal, the window narrows and the check repeats. That turns x⁵ and 3^(2x) from walls into shapes.

The escape hatch

Content can still override the frame explicitly, for the rare case where the automatic choice is unhelpful. So far none of the ninety examples has needed it.

Back to the blog Back to the calculator