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 July 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: MARINE RULER, DIVIDER, AND PROTRACTOR INCLUDED.

  • DURABLE MATERIALS ENSURE ACCURATE READINGS ON EVERY MARINE JOURNEY.

  • USER-FRIENDLY DESIGN SIMPLIFIES NAVIGATION FOR BOTH BEGINNERS AND PROS.

BUY & SAVE
$36.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 Nicpro 22 PCS Compass Geometry Tools with Case, Drafting Tools Geometry Set with Swing Arm Protractor, Rulers, Metal Compass, Square Set, Mechanical Pencil, Back to School Supplies for Students

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

  • ALL-IN-ONE SET: COMPASSES, RULERS, AND PENCILS FOR EVERY NEED.
  • HIGH-QUALITY METAL COMPASSES ENSURE PRECISION IN EVERY DRAWING.
  • COMPACT CASE DESIGN MAKES IT PERFECT FOR ON-THE-GO USE.
BUY & SAVE
$11.99 $12.99
Save 8%
Nicpro 22 PCS Compass Geometry Tools with Case, Drafting Tools Geometry Set with Swing Arm Protractor, Rulers, Metal Compass, Square Set, Mechanical Pencil, Back to School Supplies for Students
3 3 Pcs Marine Navigation Kit, Nautical Chart Plotting Tool Set with Single Hand Divider, Navigation Ruler and Protractor, Drafting Supplies for Boating, Sailing, Seafaring

3 Pcs Marine Navigation Kit, Nautical Chart Plotting Tool Set with Single Hand Divider, Navigation Ruler and Protractor, Drafting Supplies for Boating, Sailing, Seafaring

  • COMPLETE KIT FOR SAFE NAVIGATION: EVERYTHING YOU NEED FOR SEAFARING.
  • PRECISE & RELIABLE MEASUREMENTS: CLEAR SCALES ENSURE ACCURATE CHART PLOTTING.
  • EFFORTLESS CHART PLOTTING: PARALLEL RULER SIMPLIFIES AND SPEEDS UP NAVIGATION TASKS.
BUY & SAVE
$25.98 $29.98
Save 13%
3 Pcs Marine Navigation Kit, Nautical Chart Plotting Tool Set with Single Hand Divider, Navigation Ruler and Protractor, Drafting Supplies for Boating, Sailing, Seafaring
4 Liquidraw Solid Brass Navigation Divider 8" (20cm) | Single Handed Marine Nautical Plotting Tool | Professional Navigational Instrument for Drafting, Maritime Measurement & Technical Drawing

Liquidraw Solid Brass Navigation Divider 8" (20cm) | Single Handed Marine Nautical Plotting Tool | Professional Navigational Instrument for Drafting, Maritime Measurement & Technical Drawing

  • DURABLE SOLID BRASS DESIGN ENSURES LONG-LASTING PRECISION AT SEA.
  • ACCURATE PLOTTING TOOL IDEAL FOR SAILORS AND MARITIME PROFESSIONALS.
  • CLASSIC VINTAGE LOOK MAKES IT A PERFECT GIFT FOR NAVIGATION ENTHUSIASTS.
BUY & SAVE
$14.99
Liquidraw Solid Brass Navigation Divider 8" (20cm) | Single Handed Marine Nautical Plotting Tool | Professional Navigational Instrument for Drafting, Maritime Measurement & Technical Drawing
5 Weems & Plath #176 Marine Navigation Ultralight Divider

Weems & Plath #176 Marine Navigation Ultralight Divider

  • DURABLE MARINE ALLOY & PLASTIC RESISTS CORROSION FOR LONG-LASTING USE.
  • COMPLETE SET: SPARE POINTS, KNOB, WHEEL, AND LEAD INCLUDED.
  • TRUSTED GERMAN ENGINEERING WITH A LIMITED LIFETIME WARRANTY.
BUY & SAVE
$31.95
Weems & Plath #176 Marine Navigation Ultralight Divider
6 Weems & Plath Marine Navigation Parallel Plotter

Weems & Plath Marine Navigation Parallel Plotter

  • BUILT TO LAST WITH A MARINE-GRADE ALUMINUM ROLLER ASSEMBLY.

  • VERSATILE SCALES FOR ALL U.S. COAST AND HARBOR CHARTS INCLUDED.

  • EASY NAVIGATION WITH PROTRACTORS FOR PRECISE COURSE MEASURING.

BUY & SAVE
$41.79 $48.00
Save 13%
Weems & Plath Marine Navigation Parallel Plotter
7 Calyron Architect Triangular Set Boat Architectural Stationery Navigation Compasses Course Triangle & Positioning Triangle (33cm Each) Pencil Brass Nautical Divider Bag Set for Training Purposes

Calyron Architect Triangular Set Boat Architectural Stationery Navigation Compasses Course Triangle & Positioning Triangle (33cm Each) Pencil Brass Nautical Divider Bag Set for Training Purposes

  • ALL-IN-ONE SET: ESSENTIAL TOOLS FOR STUDENTS, ARCHITECTS, AND ARTISTS.
  • PRECISION & DURABILITY: BRASS DIVIDER AND TRIANGLES FOR ACCURATE DESIGNS.
  • PORTABLE DESIGN: CONVENIENT CARRY BAG FOR ORGANIZED, ON-THE-GO USE.
BUY & SAVE
$25.00
Calyron Architect Triangular Set Boat Architectural Stationery Navigation Compasses Course Triangle & Positioning Triangle (33cm Each) Pencil Brass Nautical Divider Bag Set for Training Purposes
8 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 WITHOUT GPS: RELIABLE PLOTTING TOOLS FOR SAILORS.

  • COMPLETE KIT: EVERYTHING NEEDED FOR PRECISE NAUTICAL CHART PLOTTING.

  • IDEAL FOR MARITIME STUDENTS: EXCEL IN BOATING EXAMS WITH EASE.

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
+
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.