In Maple, plotting a function inside specific bounds means passing a range to the plot command. For a domain (x) limit you write plot(f, x = a .. b); for a vertical view limit you add y = c .. d; for a single-value bound or a functional restriction you clip with view, piecewise, or assumptions. The key condition is that x-limits control where the function is evaluated, while y-limits only control what the plot window shows, so a curve can still spike off-screen if you set only the viewing range.
That distinction catches a lot of users early on. People set a y-range expecting Maple to stop evaluating a function that blows up, and then wonder why the plot looks odd or why Maple complains. Getting the two kinds of limits straight, plus a couple of syntax details that changed across Maple versions, makes the whole job quick. This guide walks through the sequence: specifying the domain, restricting the view, handling singularities, using functional limits, and checking that what you plotted matches what you asked for.
Start With the Domain Limit: x = a .. b
The most common meaning of "plotting with limits" is drawing the curve only over an interval. Maple's basic two-dimensional plotting command is plot, and its first functional argument is the expression, followed by the plot variable and its range.
A minimal example:
That evaluates the expression across x from -10 to 10 and renders the result. The range uses two dots (..), which is Maple's range operator. Writing x = -10..10 without spaces around .. also works; writing x = -10 to 10 or x = -10, 10 does not produce a range. This single dot-dot-dot confusion accounts for many error messages.
If you want to plot from a numeric lower bound to an upper bound that depends on a parameter, you can use expressions in the bounds as long as they evaluate to numbers when the plot is drawn:
The variable name matters. If your function is in terms of t, use t = a .. b. If you write x = a .. b while the expression only has t, Maple either errors out or produces a misleading result depending on your version. Match the plot variable to the variable actually present in the expression.
For plots of multiple functions over the same domain, pass a list or set as the first argument:
All curves then share the x-limits. If you need different domains per curve, that is not what a single plot call with a shared range does; use separate plot structures and combine them with plots:-display, or clip each function using piecewise (covered later).
Implicit and vector plots use a different argument order
It is worth knowing that not every plot command takes limits the same way. implicitplot from the plots package takes an equation and then ranges for both variables:
And plot3d takes ranges for two independent variables:
If a plot command fails on limit syntax, check its help page with ?plot or ?plot3d and confirm the expected range order. Mixing up the order, or supplying an x-range where a y-range is expected, is a frequent source of confusion.
Setting the Vertical View Limit: y = c .. d
A second kind of limit is the visible y-window. Maple accepts a y-range as an optional argument to plot:
Here the x-limits decide calculation points; the y-limits crop the display. The function is still evaluated near zero, where it is unbounded, but anything outside y = -10 to y = 10 is clipped. The result is a plot that looks bounded even though the underlying function is not.
There are two related optional arguments worth knowing: view and scaling.
view = [xmin .. xmax, ymin .. ymax] sets both axes' display ranges explicitly. It is especially useful when you want a combined constraint. scaling = constrained forces equal units on both axes, which matters when you plot a circle or any geometry where aspect ratio carries meaning. With scaling = unconstrained (the default), Maple stretches the picture to fill the plot region, so a circle may look like an ellipse.
If you specify both an x range and a y range and scaling is unconstrained, the axes are drawn independently; the curve can look distorted. Use scaling = constrained when proportions matter and the display range is symmetric.
A note on what "limits" means in the viewing sense: a y-range does not prevent errors. If the function is undefined at a point in the x-domain, Maple still evaluates there and may return undefined, an infinity symbol, or an error depending on the expression. See the singularity section below for handling that.
Worked Example: Plotting a Piece Within a Window
Take f(x) = sin(1/x) near zero. It oscillates infinitely often as x approaches 0, so plotting over, say, x = -1 .. 1 without care produces a dense smear at the center.
Start with a truncated domain that avoids the trouble:
If you want the full picture but a controlled view, keep the wide domain and clip:
The second command evaluates near zero and clips the result. The oscillatory smear remains visible near the center, which is honest—it reflects what the function actually does. If you need a smooth, clean plot, narrow the domain instead of manipulating the view.
A third approach mixes both: plot only where you care about behavior and set a view that frames features of interest. For a function with a tall spike at one end, like tan(x) around π/2, restricting the domain to x = 0 .. 1.5 and setting y = -10 .. 10 keeps the spike from dominating the frame while preserving the rest of the curve.
Clipping With piecewise and Functional Limits
Sometimes "limits" means you want the function to be defined only within a band—for example, clipping a function to the range [−1, 1] rather than merely hiding the overflow. That is a functional restriction, and piecewise is the tool.
The simplest clamp:
This creates a function equal to -1 below -1, +1 above 1, and equal to x in between. The plot shows a horizontal segment, a diagonal segment, and another horizontal segment—a clean saturation curve with no off-screen excursion.
You can also restrict the domain to exclude a region entirely:
Here the function is undefined for negative x, so Maple plots only where it exists. The result avoids the complex-valued region without any error message. Using undefined rather than a number keeps the plot honest—the function truly has no real value there.
Maple also supports assumptions on the plot variable. assume(x > 0) followed by a plot can simplify expressions that depend on positivity, but be careful: assumptions persist in the session and can change later results. Clear them with x := 'x' if you rely on the assumption only once. For limit-conditioned plotting, piecewise is usually clearer and safer than assumptions because it makes the restriction explicit in the expression itself.
Handling Singularities and Discontinuities
Plot commands sometimes produce jagged artifacts or jump discontinuities because Maple's adaptive plotting samples finite points. You can control how this is handled.
discont and fdiscont (in the plots package) help locate discontinuities so you can exclude them or split the plot. A more direct route for most users is numPoints. Increasing numPoints yields finer sampling:
Beware that numPoints names behavior that varies by version; in many Maple releases, it sets the initial number of sample points, and the adaptive algorithm adds more where curvature is high. Check ?plot,options for the semantics in your installed version rather than trusting a remembered description.
discont = true can be passed to plotting commands so that Maple treats detected discontinuities as such rather than drawing lines across them. This is especially useful for step functions:
Combining discont = true with a modest view and, if needed, adaptive settings gives the cleanest result for functions with jumps or vertical asymptotes. For asymptotes in rational functions, you may still see the vertical line the plotting algorithm draws; a smaller vertical view or splitting the domain will suppress it.
Success Checks: Did the Plot Match the Request?
A plot can look right and still be wrong for your purpose. A quick verification sequence:
1: Verify the domain. Compare an x-axis tick at each end to your intended bounds. If Maple's axis range is broader than you set, you likely used view or omitted a range somewhere. 2: Verify the y-window. Zoom in on the axis labels; if a curve exits the top and re-enters the bottom, the vertical clip is working but the function is unbounded in the drawn domain. 3: Check for undefined regions. A gap in the curve should correspond to where the function has no real value. If you restricted the domain, there should be no gap. 4: Compare against a second sampling. Replot with numPoints increased or decreased and confirm the features you care about persist. A feature that appears only at high sampling may be an artifact of finite evaluation. 5: Render with scaling = constrained when geometry matters, then check proportions with two reference points.
A common failure is plotting a function whose domain was implicitly restricted by piecewise and then assuming the visible ends are the function's true limits. The endpoints of a piecewise plot reflect the piecewise boundaries, not the function's infimum and supremum. If the distinction matters, plot the unclamped expression on a narrower domain to see the true behavior.
Another common failure: specifying both x = a .. b and view = [c .. d, e .. f] with conflicting ranges. When the view's x-bounds exceed the domain, the plot whitespace reveals the mismatch. When the domain exceeds the view, the visible curve is a crop of a wider calculation, which is fine but can obscure what was evaluated. Decide which one you are controlling and be consistent.
Version and Interface Notes
Maple has been around long enough that syntax differences between versions are real. The comma-separated range syntax for plot options, the behavior of numPoints, and the availability of some plots package functions have evolved. Two practical consequences:
In the Standard worksheet interface and in 1-D math input, the same commands parse slightly differently. If a range with spaces around .. errors, remove the spaces or switch to 1-D input. In the 2-D math editor, entering a range visually looks different from typed syntax; if a pasted command fails, retype the range operator. The plots package functions (implicitplot, fdiscont, display, animate) must be loaded with with(plots) or referenced with the plots:- prefix. If a function is "not recognized," that prefix is usually the fix.
In recent Maple releases (Maple 2023 and later), the core plot command's range syntax and view behavior are stable; oscillations and discontinuities are still approximated by evaluation, so the practical guidance above applies across versions. If your results differ from a tutorial, check the tutorial's Maple version. Aging examples sometimes use options that were renamed or deprecated.
Frequently Asked Questions
Can I plot only part of a curve without changing the function?
Yes. Use piecewise to return the function inside a band and a constant or undefined outside, or use view to crop the display. The first changes what is evaluated; the second only changes what is shown. Choose based on whether you want to hide or to restrict.
Why does my y-range not stop Maple from evaluating near a pole?
Because y = c .. d is a display constraint, not an evaluation constraint. The function is still sampled at points in the x-domain. To prevent evaluation, exclude the pole with piecewise or narrow the x-domain.
Do x-limits and view conflict?
They can. The x-range sets evaluation bounds; the view x-interval sets visible bounds. If the view is wider, you see whitespace where no evaluation occurred. If the view is narrower, the curve is cropped. Either is valid, but state which one you intend.
How do I plot over an interval given by an expression?
Bounds can be expressions that evaluate to numeric values, such as x = 0 .. 2*Pi. If the bound contains a free variable, Maple cannot evaluate, and the plot fails. Substitute numeric values first.
What is the difference between discont = true and numPoints?
discont = true tells Maple the function has discontinuities and to handle jumps appropriately; numPoints controls sampling density. They solve different problems—one is about detecting jumps, the other about smoothing fine detail. Use both when a function has both features.