Skip to content

Function Plotting

The plotting tool lets you create interactive 2D and 3D graphs inside a Drawing Area. You can plot functions, inequalities, parametric curves, vector fields, and more — all with a visual editor.

Click the plot icon in the Drawing Area toolbar to open the plot settings dialog.

The dialog has four tabs: Expressions, Axes, X Axis, and Y Axis. A live preview of the graph is shown on the right side.

The Expressions tab is where you add and configure the functions to plot.

Click + Add to see all available expression types:

Add expression dropdown

TypeFormatDescription
Regular Ploty = 2xStandard function of x
Inequality Ploty > 2xShade the region above or below a function
Bounded Regionf(x) < y < g(x)Shade the region between two functions
X in term of Yx = 2yFunction where x is expressed in terms of y
Parametricsin(t), cos(t)Parametric curve defined by x(t) and y(t)
Implicit0 = x + cos(2y)Implicit equation in x and y
Points4,5 6,7Plot individual points
Vectors(1,2) (5,6)Draw arrow vectors
Vector Fieldi(x,y), j(x,y)Visualize a 2D vector field
Poincaré Discdx/dt=P, dy/dt=QPhase portrait of a dynamical system

Each expression has an inline math editor where you type the function. Below the expression you can configure:

Expression editor

  • Color — click the color circle to change the plot color
  • Range — optionally restrict the domain (e.g., limit x to a specific interval)
  • Line style — choose between solid, dashed, or other stroke types
  • Line thickness — adjust the stroke width
  • Remove Range — remove the domain restriction

You can add multiple expressions of different types to the same graph. Each expression gets its own color and is plotted together on the same axes:

Multiple expressions on one graph

You can drag and drop expressions to reorder them in the list. The order affects the drawing order — expressions lower in the list are drawn on top of earlier ones.

Expression list with multiple plot types

Click the visibility toggle (the colored circle) next to an expression to hide it from the graph without deleting it. This is useful for temporarily removing a plot from view while keeping its configuration. Click again to show it.

At the bottom of the Expressions tab, click Variables + to define named variables (single letters a–z) with numeric values. These variables can be referenced inside your expressions, making it easy to adjust parameters without editing the function.

The Axes tab controls the overall appearance of the coordinate system.

Three visual styles are available:

School — traditional style with axis labels and arrows:

School axes type

Scientific — grid-based with labeled tick marks and no arrows:

Scientific axes type

Scientific Clean — minimal grid with no axis lines.

Controls the layering order of axis, plot, and labels:

OptionDescription
Label TopLabels drawn on top of everything
Plot TopPlot curves drawn on top of axes
Axis TopAxis lines drawn on top of plots
OptionDescription
Positive OnlyArrows at the positive end of each axis
Both EndsArrows at both ends of each axis
NoneNo arrows on axes

Set the scale in pixels for each axis independently. The default is 8.5 px per unit for both X and Y.

The X Axis and Y Axis tabs configure individual axis properties. Both tabs have the same options:

X Axis settings

  • Number — standard numeric labels (1, 2, 3, …)
  • Radian — labels in multiples of π
  • Show axis — toggle the tick marks on or off
  • Grid — toggle vertical/horizontal grid lines
  • Count — number of major tick divisions (or Auto)
  • Show numbers — toggle numeric labels on ticks
  • Text color — color picker for the labels
  • Font size — label font size (8–22 px)
  • Show axis — toggle minor tick marks
  • Grid — toggle minor grid lines
  • Count — number of minor divisions between major ticks

The Poincaré Disc expression type plots a phase portrait of a 2D dynamical system defined by:

  • P(x,y) = dx/dt — the x-component of the vector field
  • Q(x,y) = dy/dt — the y-component of the vector field

Poincaré Disc with trajectories

Trajectories show the flow of the system from given initial conditions:

  • Click to Add — click directly on the plot to place a trajectory starting point
  • + Add — manually enter the initial (x, y) coordinates
  • Each trajectory has its own color and visibility toggle
  • The Boundary circle shows the boundary of the Poincaré disc

At the bottom of the dialog:

  • Cancel — discard changes and close
  • Apply — apply changes without closing (useful for previewing)
  • Ok — apply changes and close the dialog

Mathcha also supports 3D plotting. To create a 3D plot, select Function 3d Plot from the Drawing Area toolbar:

3D Plot toolbar option

Click + Add in the 3D plot editor to see the available expression types:

3D expression types

TypeFormatDescription
Regularz = 2x * ySurface defined as z in terms of x and y
Implicit0 = cos(x) + y + zImplicit 3D equation
Parametric Surfacex(u,v), y(u,v), z(u,v)Surface defined by parametric equations in two parameters
Parametric Curvex(u), y(u), z(u)Space curve defined by parametric equations in one parameter
Points4,5,6 1,1,1Plot individual 3D points
Vector(1,1,1) (3,3,3)Draw 3D arrow vectors
Vector Fieldi,j,kVisualize a 3D vector field

Example: Drawing a Cone with Parametric Surface

Section titled “Example: Drawing a Cone with Parametric Surface”

You can create complex 3D shapes using the Parametric Surface type. For example, a circular cone can be expressed as:

  • x(u,v) = v * cos(u)
  • y(u,v) = v * sin(u)
  • z(u,v) = v

With u range [0, 2π] and v range [0, h] (where h is the desired height).

3D cone using parametric surface

Other approaches for plotting cone-like surfaces:

  • Regular surface: z = sqrt(x² + y²) for an upward cone, with appropriate x/y ranges
  • Implicit surface: x² + y² - z² = 0