Direction Field / Slope Field Plotter screenshot

Direction Field / Slope Field Plotter

Plot the slope field of dy/dx = f(x, y) on the shared plotting engine, with the grid and skipped non-finite slopes stated.

Privacy First
0 Runs
Updated 2026-11-22
Runs in your browser
No sign-up, no upload
Sampling stated

Direction Field / Slope Field Plotter

Plot the slope field of dy/dx = f(x, y) on the shared plotting engine, with the grid and skipped non-finite slopes stated.

How this page computes

A direction field draws a short segment at each grid point whose slope is dy/dx there. The page samples f(x, y) on a stated grid, draws one segment per point, and reports the grid size and how many slopes were finite.

On x − y over [−3, 3]² with a 21 × 21 grid every slope is finite, and the picture shows the field converging toward the line y = x. Raising the grid refines the picture; the page caps it at 41 × 41.

A point where f is not finite is skipped and counted, not drawn as a vertical segment the expression did not state. The page uses the plotting family's existing canvas and SVG backends rather than a second drawing layer.

The calculation runs entirely in this browser tab; nothing is uploaded.

A slope field shows the direction a solution would take at every point. The page draws one segment per grid cell for dy/dx = f(x, y), and prints the domain, the grid and the number of finite slopes: for x − y over a 21 × 21 grid, all 441.

The picture is drawn by the same plotting engine as the graphers, so the canvas preview and the downloaded SVG are the same operations. The caption states the sampling, because a field is a sampling claim and a coarse grid can hide a steep region.

How to use Direction Field / Slope Field Plotter

Type dy/dx = f(x, y). The variables are x and y.

Set the x and y domains, the grid size and the segment length in cells.

Press Draw. Read the picture, then the panel beneath it: the domains, the grid, the finite count and any skipped points. Download PNG or SVG if you need the file.

How the method works

At each grid point the page evaluates f once and draws a segment through that point with slope f. Normalising the direction to a fixed length keeps the picture readable; the slope, not the segment length, is the information.

A non-finite slope has no direction the page can honestly draw. It is skipped and counted. The grid and domain are printed because a different grid is a different sample of the same field, and the caption has to say which one you are looking at.

What to Expect

Best for

  • Seeing the qualitative behaviour of a first-order ODE
  • Checking where solutions are flat, steep or undefined
  • A picture to accompany a numeric ODE solution

Not ideal for

  • An exact solution curve
  • A field with a discontinuity the grid does not resolve
  • A three-dimensional field

What this tool keeps

  • The expression, domains and grid exactly as typed

What may need cleanup

  • Nothing: the field and its caption are final

Common errors

  • Equal domain ends are refused
  • A grid outside 3 to 41 is refused with the cap
  • A field that is nowhere finite is refused rather than drawn empty

Example use cases

  • Plot dy/dx = x - y
  • Plot a logistic field y·(1-y)
  • See where a field is undefined

Sample input

dy/dx = x - y, x and y in [-3, 3], 21 by 21 grid

Sample output

441 finite slopes on a 21 × 21 grid, drawn as a direction field with PNG and SVG download

Who this is for

  • Students meeting direction fields
  • Readers who want a picture beside an ODE

Frequently asked questions

Why are some segments missing?

The slope is not finite at that grid point, so there is no direction to draw. The panel reports how many were skipped, and the caption keeps the count rather than leaving a silent gap.

What does the grid size change?

It changes how finely the field is sampled. A coarse grid is faster and can miss a narrow feature; a fine grid shows more but is capped at 41 by 41 so the tab stays responsive.

Can I download the picture?

Yes. The page offers PNG and SVG; the SVG is generated from the same drawing operations as the canvas, so the two are the same picture at different resolutions.

Developer program

Build custom tools for your store

Join the SDK program to create useful ecommerce utilities for your store.