Skip to main content
TopMiniSite

Back to all posts

How to Plot A Cartesian Equation With Sympy?

Published on
4 min read
How to Plot A Cartesian Equation With Sympy? image

Best Mathematics Plotting Tools to Buy in October 2025

1 Mr. Pen Geometry Set with 6 Inch Swing Arm Protractor, Divider, Set Squares, Ruler, Compasses and Protractor, 15 Piece Set

Mr. Pen Geometry Set with 6 Inch Swing Arm Protractor, Divider, Set Squares, Ruler, Compasses and Protractor, 15 Piece Set

  • COMPREHENSIVE 15-PIECE SET CATERS TO ALL LEARNING LEVELS.
  • PORTABLE AND REUSABLE POUCH FOR EASY STORAGE AND TRANSPORT.
  • EXPERTLY DESIGNED BY MATH PROFESSIONALS FOR QUALITY AND PRECISION.
BUY & SAVE
$11.99
Mr. Pen Geometry Set with 6 Inch Swing Arm Protractor, Divider, Set Squares, Ruler, Compasses and Protractor, 15 Piece Set
2 Carson Dellosa 11-Piece Be Clever Wherever Grades 2-3 Mathematics Tool Kit, Sticker, Multiplication Chart, Spin Wheel, Dice Game, and More Math Manipulatives

Carson Dellosa 11-Piece Be Clever Wherever Grades 2-3 Mathematics Tool Kit, Sticker, Multiplication Chart, Spin Wheel, Dice Game, and More Math Manipulatives

  • FUN, PORTABLE KIT MAKES MATH LEARNING ENGAGING ANYWHERE, ANYTIME!

  • INCLUDES 11 HANDS-ON TOOLS FOR ESSENTIAL MATH SKILL REINFORCEMENT.

  • TRUSTED BRAND WITH 40+ YEARS OF EDUCATIONAL EXCELLENCE AND SUPPORT.

BUY & SAVE
$5.99 $10.00
Save 40%
Carson Dellosa 11-Piece Be Clever Wherever Grades 2-3 Mathematics Tool Kit, Sticker, Multiplication Chart, Spin Wheel, Dice Game, and More Math Manipulatives
3 Nicpro 22 PCS Compass Geometry Tools with Case, Drafting Tools Geometry Set with Swing Arm Protractor, Rulers, Metal Compass, Divider, Square Set, Pencil, Back to School Supplies for Students Kids

Nicpro 22 PCS Compass Geometry Tools with Case, Drafting Tools Geometry Set with Swing Arm Protractor, Rulers, Metal Compass, Divider, Square Set, Pencil, Back to School Supplies for Students Kids

  • ALL-IN-ONE SET: INCLUDES COMPASSES, RULERS, AND PENCILS FOR ALL NEEDS.
  • PRECISION TOOLS: METAL COMPASSES ENSURE ACCURACY FOR FLAWLESS DRAFTING.
  • PORTABLE CASE: LIGHTWEIGHT DESIGN PERFECT FOR STUDENTS ON THE GO.
BUY & SAVE
$13.99 $15.99
Save 13%
Nicpro 22 PCS Compass Geometry Tools with Case, Drafting Tools Geometry Set with Swing Arm Protractor, Rulers, Metal Compass, Divider, Square Set, Pencil, Back to School Supplies for Students Kids
4 Mr. Pen- Professional Geometry Set, 15 pcs, Geometry Kit for Artists and Students, Geometry Set, Metal Rulers and Compasses, Drawing Tools, Drafting Supplies, Drafting Set, Drafting Tools and Kits

Mr. Pen- Professional Geometry Set, 15 pcs, Geometry Kit for Artists and Students, Geometry Set, Metal Rulers and Compasses, Drawing Tools, Drafting Supplies, Drafting Set, Drafting Tools and Kits

  • COMPLETE GEOMETRY SET FOR STUDENTS, TEACHERS, AND PROFESSIONALS.
  • DURABLE CASE ENSURES TOOLS STAY ORGANIZED AND PROTECTED.
  • IDEAL GIFT FOR STUDENTS, ARTISTS, AND DESIGN ENTHUSIASTS.
BUY & SAVE
$19.85
Mr. Pen- Professional Geometry Set, 15 pcs, Geometry Kit for Artists and Students, Geometry Set, Metal Rulers and Compasses, Drawing Tools, Drafting Supplies, Drafting Set, Drafting Tools and Kits
5 STAEDTLER Math Set - 4 pc Geometry Kit for Students - School Supplies with Clear Protractor, 6in Ruler & 2 Triangles – Metric & Imperial Scales

STAEDTLER Math Set - 4 pc Geometry Kit for Students - School Supplies with Clear Protractor, 6in Ruler & 2 Triangles – Metric & Imperial Scales

  • ALL-IN-ONE KIT: INCLUDES ESSENTIAL TOOLS FOR ACCURATE MEASUREMENTS.
  • PORTABLE DESIGN: KEEPS GEOMETRY TOOLS ORGANIZED AND ACCESSIBLE ANYWHERE.
  • IDEAL FOR ALL: PERFECT FOR STUDENTS, PROFESSIONALS, AND BUDDING ARTISTS.
BUY & SAVE
$4.99
STAEDTLER Math Set - 4 pc Geometry Kit for Students - School Supplies with Clear Protractor, 6in Ruler & 2 Triangles – Metric & Imperial Scales
6 Mr. Pen- Compass and Protractor Set, Math Compass for Geometry and Drawing

Mr. Pen- Compass and Protractor Set, Math Compass for Geometry and Drawing

  • DURABLE COMPASS AND PROTRACTOR SET DESIGNED FOR PRECISION AND LONGEVITY.
  • CLEAR MARKINGS IN INCHES AND CENTIMETERS FOR ACCURATE MEASUREMENTS.
  • COMFORTABLE GRIP AND EASY ADJUSTMENTS ENSURE STABLE, PRECISE DRAWING.
BUY & SAVE
$6.99
Mr. Pen- Compass and Protractor Set, Math Compass for Geometry and Drawing
7 Zonon Math Geometry Set 10 Pcs Student Supplies with Shatterproof Storage Box, Includes Rulers Protractor Compass Pencil Sharpener Lead Refills Eraser Pencil for Drafting and Drawings (Black)

Zonon Math Geometry Set 10 Pcs Student Supplies with Shatterproof Storage Box, Includes Rulers Protractor Compass Pencil Sharpener Lead Refills Eraser Pencil for Drafting and Drawings (Black)

  • COMPLETE GEOMETRY SET ENSURES PRECISION FOR STUDENTS AND PROFESSIONALS.
  • DURABLE PLASTIC AND METAL TOOLS FOR LONG-LASTING PERFORMANCE.
  • PORTABLE DESIGN MAKES IT PERFECT FOR SCHOOL, HOME, AND ON-THE-GO USE.
BUY & SAVE
$6.55 $8.95
Save 27%
Zonon Math Geometry Set 10 Pcs Student Supplies with Shatterproof Storage Box, Includes Rulers Protractor Compass Pencil Sharpener Lead Refills Eraser Pencil for Drafting and Drawings (Black)
8 Nicpro 30PCS Professional Drafting Tools & Geometry Set with Case, Architect Protractor Set, Metal Mechanical Pencils, Pen, Scale Ruler Metal Ruler, 5 Drawing Templates for Interior Design House Plan

Nicpro 30PCS Professional Drafting Tools & Geometry Set with Case, Architect Protractor Set, Metal Mechanical Pencils, Pen, Scale Ruler Metal Ruler, 5 Drawing Templates for Interior Design House Plan

  • COMPREHENSIVE 30 PCS SET: EVERYTHING NEEDED FOR PROFESSIONAL DRAFTING!

  • REUSABLE TEMPLATES: DESIGN EFFICIENTLY WITH ENDURING, FLEXIBLE TEMPLATES.

  • PORTABLE & ORGANIZED: DURABLE CASE ENSURES EASY ACCESS AND STORAGE!

BUY & SAVE
$28.99 $32.99
Save 12%
Nicpro 30PCS Professional Drafting Tools & Geometry Set with Case, Architect Protractor Set, Metal Mechanical Pencils, Pen, Scale Ruler Metal Ruler, 5 Drawing Templates for Interior Design House Plan
9 Nicpro 21PCS Professional Drafting Tools & Geometry Set with Case, Architect Compass & Protractor Set, Metal Pencils, Pens, Scale Ruler Metal Ruler, 5 Drawing Templates for Interior House Plan Design

Nicpro 21PCS Professional Drafting Tools & Geometry Set with Case, Architect Compass & Protractor Set, Metal Pencils, Pens, Scale Ruler Metal Ruler, 5 Drawing Templates for Interior House Plan Design

  • COMPLETE DRAFTING KIT WITH ESSENTIAL TOOLS FOR PRECISE DESIGNS!

  • DURABLE, FLEXIBLE TEMPLATES FOR ACCURATE PATTERNS ON ANY SURFACE.

  • ORGANIZED CASE FOR EASY TRANSPORT - PERFECT FOR STUDENTS AND PROS!

BUY & SAVE
$25.99 $28.99
Save 10%
Nicpro 21PCS Professional Drafting Tools & Geometry Set with Case, Architect Compass & Protractor Set, Metal Pencils, Pens, Scale Ruler Metal Ruler, 5 Drawing Templates for Interior House Plan Design
+
ONE MORE?

To plot a cartesian equation with sympy, you first need to define the equation as a symbolic expression using the sympy library in Python. Once you have the equation defined, you can use the sympy.plot() function to create a plot of the equation. Simply pass the equation as an argument to the plot() function to generate the plot.

You can customize the plot by specifying the range of values for the x and y axes, adding labels and titles, and changing the appearance of the plot (such as color and line style). Additionally, you can plot multiple equations on the same plot by passing a list of equations to the plot() function.

After creating the plot, you can display it using the show() function. This will open a new window showing the plot of the cartesian equation you defined. So, by following these steps, you can easily plot a cartesian equation using sympy in Python.

What is the command for plotting parametric equations in sympy?

In SymPy, you can use the plot_parametric function to plot parametric equations. The syntax for the function is as follows:

from sympy import symbols, cos, sin, pi, plot_parametric

t = symbols('t') # define the parameter x_expr = cos(t) # define the x-coordinate as a function of t y_expr = sin(t) # define the y-coordinate as a function of t

plot_parametric(x_expr, y_expr, (t, 0, 2*pi)) # plot the parametric equations for t ranging from 0 to 2*pi

This code will plot the parametric curve defined by the equations x = cos(t) and y = sin(t) as t ranges from 0 to 2*pi. You can modify the range of t as needed to plot different portions of the curve.

How to plot a piecewise function in sympy?

To plot a piecewise function in Sympy, you can use the Piecewise class along with the plot function from the sympy.plotting module. Here is an example of how to plot a simple piecewise function:

import sympy as sp from sympy.plotting import plot

x = sp.symbols('x') f = sp.Piecewise((x, x < 0), (x**2, x >= 0))

p = plot(f, (x, -2, 2), show=False) p.title = 'Plot of Piecewise Function' p.xlabel = 'x-axis' p.ylabel = 'y-axis' p.show()

In this example, we define a piecewise function f with two cases: x for x less than 0, and x**2 for x greater than or equal to 0. We then use the plot function to plot this piecewise function over the range -2 to 2.

You can modify the function and the range of the plot as needed for your specific piecewise function.

What is the benefit of using sympy for plotting equations?

One of the benefits of using Sympy for plotting equations is that it provides a simple and powerful way to generate high-quality mathematical plots. Sympy can handle both 2D and 3D plots, and supports various types of plots such as line plots, scatter plots, contour plots, and surface plots. Additionally, Sympy integrates seamlessly with other scientific libraries such as Matplotlib and Plotly, allowing for further customization and manipulation of plots. Sympy also has built-in support for LaTeX formatting, making it easy to include mathematical symbols and expressions in plots. Overall, Sympy provides a user-friendly and versatile tool for visualizing mathematical equations and functions.

What is the default plotting style in sympy?

The default plotting style in Sympy is a simple line plot.

What is the command for saving a sympy plot as an image file?

To save a sympy plot as an image file, you can use the save method from the Plot class. Here is an example of how to save a sympy plot as a PNG image file:

from sympy import Plot from sympy.plotting.plot import MatplotlibBackend

plot = Plot(title='My Plot', backend=MatplotlibBackend) plot.save('my_plot.png')

In this example, a sympy plot is created with the title "My Plot" and saved as a PNG image file named "my_plot.png" using the save method. You can change the file format by changing the file extension in the save method.

How to plot a plane equation in sympy?

To plot a plane equation in Sympy, you can use the plot_implicit function. Here's an example of how to plot the plane equation 2x + 3y - z = 0:

from sympy import symbols, Eq from sympy.plotting import plot_implicit

Define the variables

x, y, z = symbols('x y z')

Define the plane equation

plane_eq = Eq(2*x + 3*y - z, 0)

Plot the plane equation

plot_implicit(plane_eq)

This code will plot the plane equation 2x + 3y - z = 0 in a 3D coordinate system. You can customize the plot by adjusting the range of the axes or adding labels and titles.