Skip to main content
St Louis

Back to all posts

How to Make Figure Rectangle In Matplotlib?

Published on
2 min read
How to Make Figure Rectangle In Matplotlib? image

Best Plotting Tools to Buy in March 2026

1 Dunzoom 3 Pcs Marine Navigation Kit, Basic Navigation Set Include 18" Marine Parallel Ruler with Clear Scales, 8" Diameter Nautical Plotter Protractor, 6" Fixed Point Divider for Boat Accessories

Dunzoom 3 Pcs Marine Navigation Kit, Basic Navigation Set Include 18" Marine Parallel Ruler with Clear Scales, 8" Diameter Nautical Plotter Protractor, 6" Fixed Point Divider for Boat Accessories

  • ALL-IN-ONE NAVIGATION KIT FOR ACCURATE MARINE JOURNEY SKILLS.
  • DURABLE, PRECISE TOOLS ENSURE EFFICIENT AND RELIABLE NAVIGATION.
  • EASY-TO-USE DESIGN ENHANCES CONVENIENCE AND SAILING EXPERIENCE.
BUY & SAVE
$35.99
Dunzoom 3 Pcs Marine Navigation Kit, Basic Navigation Set Include 18" Marine Parallel Ruler with Clear Scales, 8" Diameter Nautical Plotter Protractor, 6" Fixed Point Divider for Boat Accessories
2 Weems & Plath #176 Marine Navigation Ultralight Divider

Weems & Plath #176 Marine Navigation Ultralight Divider

  • DURABLE MARINE ALLOY & PLASTIC RESIST CORROSION FOR LASTING USE.
  • EASY-TO-USE CENTER GEAR WITH SPARE POINT AND KNOB INCLUDED.
  • BACKED BY A LIFETIME WARRANTY FOR PEACE OF MIND!
BUY & SAVE
$33.75
Weems & Plath #176 Marine Navigation Ultralight Divider
3 13 Pieces Geometry Set Compass Geometry Tools Math Compass and Protractors Set Metal Drawing Compass Precision Set Graphic Compasses Triangle Rulers Pencils Protractor with Storage Case

13 Pieces Geometry Set Compass Geometry Tools Math Compass and Protractors Set Metal Drawing Compass Precision Set Graphic Compasses Triangle Rulers Pencils Protractor with Storage Case

  • 13-PIECE SET: COMPLETE GEOMETRY TOOLS FOR STUDENTS AND PROFESSIONALS.
  • DURABLE DESIGN: HIGH-QUALITY, BREAK-RESISTANT MATERIALS FOR LASTING USE.
  • PERFECT GIFTS: IDEAL FOR TEACHERS AND STUDENTS, GREAT FOR SCHOOL OR HOME.
BUY & SAVE
$13.99
13 Pieces Geometry Set Compass Geometry Tools Math Compass and Protractors Set Metal Drawing Compass Precision Set Graphic Compasses Triangle Rulers Pencils Protractor with Storage Case
4 Mariners Chart Plotting Tool Kit - Marine Navigation Equipment, Weems and Plath Parallel Rulers, Dividers & Accessories for Nautical Charts, Sailing and Boating Exam Preparation

Mariners Chart Plotting Tool Kit - Marine Navigation Equipment, Weems and Plath Parallel Rulers, Dividers & Accessories for Nautical Charts, Sailing and Boating Exam Preparation

  • MASTER NAVIGATION SKILLS WITHOUT GPS USING OUR COMPLETE TOOLKIT!
  • INCLUDES ESSENTIAL TOOLS FOR PRECISE PLOTTING & EXAM PREPARATION.
  • DURABLE DESIGN ENSURES ACCURACY FOR PROFESSIONAL & RECREATIONAL USE.
BUY & SAVE
$100.00
Mariners Chart Plotting Tool Kit - Marine Navigation Equipment, Weems and Plath Parallel Rulers, Dividers & Accessories for Nautical Charts, Sailing and Boating Exam Preparation
5 Saypacck Marine Navigation Slide Rule Nautical Plotter Protractor Ship Navigation Tools Course Plotter Divider

Saypacck Marine Navigation Slide Rule Nautical Plotter Protractor Ship Navigation Tools Course Plotter Divider

  • NAVIGATE WITH PRECISION USING OUR SPECIALIZED MARINE SLIDE RULE.
  • FLEXIBLE PVC CONSTRUCTION FOR DURABILITY IN HARSH MARINE CONDITIONS.
  • QUICKLY CALCULATE SPEED, TIME, AND DISTANCE FOR EFFICIENT NAVIGATION.
BUY & SAVE
$15.99 $18.99
Save 16%
Saypacck Marine Navigation Slide Rule Nautical Plotter Protractor Ship Navigation Tools Course Plotter Divider
6 Weems & Plath Marine Navigation Parallel Plotter

Weems & Plath Marine Navigation Parallel Plotter

  • HIGH-QUALITY MARINE PRODUCTS FOR RELIABLE PERFORMANCE AT SEA.
  • DURABLE DESIGN ENSURES LONG-LASTING USE IN HARSH CONDITIONS.
  • TRUSTED BRAND WITH EXCEPTIONAL CUSTOMER SUPPORT AND SERVICE.
BUY & SAVE
$39.00 $45.99
Save 15%
Weems & Plath Marine Navigation Parallel Plotter
7 Drawing Compass and 6 Inch Protractor, Student Geometry Math Set

Drawing Compass and 6 Inch Protractor, Student Geometry Math Set

  • ALL-IN-ONE SET: COMPASS AND PROTRACTOR FOR PRECISE MEASUREMENTS.
  • CONVENIENT STORAGE: COMES IN A TRANSPARENT BOX FOR EASY ORGANIZATION.
  • CLEAR VISIBILITY: EASILY READ MEASUREMENTS WITH CLEAR PROTRACTOR DESIGN.
BUY & SAVE
$5.95 $6.45
Save 8%
Drawing Compass and 6 Inch Protractor, Student Geometry Math Set
8 Premier Fixed Plotter for Pilots, Efficiently Plotting Tool for Pilots, Planning Flight Routes, Accurate Scale, Transparent

Premier Fixed Plotter for Pilots, Efficiently Plotting Tool for Pilots, Planning Flight Routes, Accurate Scale, Transparent

  • ACCURATE MEASUREMENTS FOR EFFORTLESS ROUTE PLANNING.
  • DURABLE RESIN WITHSTANDS EXTREME TEMPERATURES AND STRESS.
  • QUICK SCALE REFERENCES FOR STATUTE AND NAUTICAL MILES.
BUY & SAVE
$9.99
Premier Fixed Plotter for Pilots, Efficiently Plotting Tool for Pilots, Planning Flight Routes, Accurate Scale, Transparent
+
ONE MORE?

To create a rectangle figure in matplotlib, you can use the Rectangle class from the matplotlib.patches module. First, import the necessary modules:

import matplotlib.pyplot as plt import matplotlib.patches as patches

Then, create a Rectangle object by specifying the lower left corner coordinates, width, height, and other optional parameters:

fig, ax = plt.subplots()

rectangle = patches.Rectangle((0.1, 0.1), 0.5, 0.3, edgecolor='r', facecolor='none')

ax.add_patch(rectangle)

plt.show()

This code will create a red rectangle with a width of 0.5 and a height of 0.3, starting from the lower left corner at coordinates (0.1, 0.1). You can customize the rectangle further by changing the edge color, face color, and other properties as needed.

How to create a new figure in Matplotlib?

To create a new figure in Matplotlib, you can use the following steps:

  1. Import the necessary libraries:

import matplotlib.pyplot as plt

  1. Create a new figure using the plt.figure() function:

plt.figure()

  1. You can also specify the size of the new figure by providing the figsize argument in the plt.figure() function. For example, to create a figure with a size of 8x6 inches:

plt.figure(figsize=(8, 6))

  1. You can now start plotting on the new figure using the various plotting functions provided by Matplotlib.

plt.plot([1, 2, 3, 4], [1, 4, 9, 16]) plt.xlabel('X-axis') plt.ylabel('Y-axis') plt.title('My Plot')

  1. Finally, you can display the figure using the plt.show() function:

plt.show()

This will create a new figure with the specified size (if provided) and plot the data on it.

What is the purpose of a rectangle in Matplotlib?

In Matplotlib, a rectangle is typically used to create a shape with four sides, where the opposite sides are equal and parallel. Rectangles can be added to plots to highlight specific regions, add emphasis to certain data points, or to create boundaries for other graphical elements. They are also commonly used for creating annotations, legends, or color bars in plots. Overall, the purpose of a rectangle in Matplotlib is to visually enhance the representation of data in plots and graphs.

What is the default background color of a rectangle in Matplotlib?

The default background color of a rectangle in Matplotlib is white.