Skip to main content
BlogWeb

Back to all posts

How to Plot Two Lists Of Tuples With Matplotlib?

Published on
4 min read
How to Plot Two Lists Of Tuples With 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 SET: ESSENTIAL TOOLS FOR EVERY MARINE JOURNEY INCLUDED.

  • DURABLE AND ACCURATE TOOLS: MADE FROM ROBUST MATERIALS FOR RELIABLE READINGS.

  • USER-FRIENDLY DESIGN: SIMPLIFIES NAVIGATION TASKS FOR EFFICIENCY AND CONVENIENCE.

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 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 SAFER NAVIGATION: ESSENTIAL TOOLS FOR EVERY SEAFARER.
  • PRECISION MEASUREMENT: CLEAR SCALES ENSURE ACCURATE AND EFFICIENT PLOTTING.
  • STABLE AND USER-FRIENDLY: EASY ADJUSTMENTS FOR SMOOTH, QUICK CHART WORK.
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
3 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: 3 COMPASSES, PROTRACTORS, PENCILS, AND RULER INCLUDED!
  • PRECISION TOOLS: METAL COMPASSES FOR ACCURATE CIRCLES UP TO 6 INCHES.
  • COMPACT CASE: LIGHTWEIGHT DESIGN FOR EASY TRANSPORT AND ORGANIZATION.
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
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 BRASS BUILD: LONG-LASTING PRECISION TOOL FOR MARINE PROFESSIONALS.

  • PRECISION NAVIGATION: IDEAL FOR ACCURATE CHART PLOTTING & DISTANCE MEASUREMENT.

  • GIFT-READY DESIGN: CLASSIC BRASS FINISH MAKES A PERFECT NAUTICAL GIFT.

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 7-INCH DESIGN, PERFECT FOR LASTING PERFORMANCE.
  • CORROSION-RESISTANT MATERIALS ENSURE LONGEVITY AND RELIABILITY.
  • COMPLETE WITH SPARE PARTS AND BACKED BY A LIMITED LIFETIME WARRANTY!
BUY & SAVE
$31.95
Weems & Plath #176 Marine Navigation Ultralight Divider
6 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

  • COMPLETE NAVIGATION SET FOR STUDENTS, ARCHITECTS, AND ARTISTS ALIKE!
  • PREMIUM BRASS DIVIDER DELIVERS PRECISION FOR ALL YOUR DESIGNS.
  • LIGHTWEIGHT CARRY BAG KEEPS TOOLS ORGANIZED AND EASY TO TRANSPORT.
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
7 Weems & Plath Marine Navigation Parallel Plotter

Weems & Plath Marine Navigation Parallel Plotter

  • DURABLE ACRYLIC DESIGN ENSURES LONG-LASTING PERFORMANCE AT SEA.
  • MULTIPLE DISTANCE SCALES FIT ALL U.S. COAST AND HARBOR CHARTS.
  • INCLUDED PROTRACTORS SIMPLIFY COURSE MEASURING AND NAVIGATION.
BUY & SAVE
$41.79 $48.00
Save 13%
Weems & Plath Marine Navigation Parallel Plotter
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 TECHNIQUES WHEN GPS FAILS WITH OUR TOOLKIT.

  • COMPLETE SET ENSURES PRECISE PLOTTING FOR ALL BOATING ENTHUSIASTS.

  • IDEAL FOR MARITIME STUDENTS PREPARING FOR CERTIFICATION EXAMS.

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 plot two lists of tuples with Matplotlib, you can first unpack the tuples into two separate lists of x and y coordinates. Then, you can use Matplotlib's plt.plot() function to plot the points on a graph. Make sure to import matplotlib.pyplot as plt at the beginning of your code. You can also customize the appearance of the plot by adding labels, titles, and formatting options. Finally, call plt.show() to display the plot.

What is the syntax for plotting multiple lists of tuples with matplotlib?

To plot multiple lists of tuples with matplotlib, you can use the plot function multiple times within the same axes object. Here is an example of the syntax:

import matplotlib.pyplot as plt

Define the lists of tuples

list1 = [(1, 2), (2, 3), (3, 4)] list2 = [(1, 3), (2, 4), (3, 5)]

Extract x and y values from the lists of tuples

x1, y1 = zip(*list1) x2, y2 = zip(*list2)

Plot the data

plt.plot(x1, y1, label='List 1') plt.plot(x2, y2, label='List 2')

Add labels and legend

plt.xlabel('X-axis') plt.ylabel('Y-axis') plt.legend()

Show the plot

plt.show()

In this example, we first define two lists of tuples list1 and list2. We then extract the x and y values from each list using the zip function. Finally, we plot each set of data using the plot function, providing labels for each dataset, adding axes labels, and displaying a legend. The show function is used to display the plot.

How to plot two lists of tuples with matplotlib?

To plot two lists of tuples with matplotlib, you can follow these steps:

  1. Import the necessary libraries:

import matplotlib.pyplot as plt

  1. Create your two lists of tuples with x and y coordinates:

list_1 = [(1, 2), (2, 3), (3, 4), (4, 5)] list_2 = [(1, 5), (2, 4), (3, 3), (4, 2)]

  1. Extract the x and y coordinates from each list of tuples:

x1, y1 = zip(*list_1) x2, y2 = zip(*list_2)

  1. Plot the data using matplotlib:

plt.plot(x1, y1, label='List 1') plt.plot(x2, y2, label='List 2') plt.xlabel('X-axis') plt.ylabel('Y-axis') plt.legend() plt.show()

This code will plot two lines, one for each list of tuples, with the x-axis representing the x coordinates and the y-axis representing the y coordinates. The label parameter in plt.plot function is used to differentiate between the two lines in the legend.

How to add labels to a matplotlib plot?

To add labels to a matplotlib plot, you can use the xlabel() and ylabel() functions from the plt object. Here's how you can do it:

  1. Import the necessary libraries:

import matplotlib.pyplot as plt

  1. Create a sample plot:

x = [1, 2, 3, 4, 5] y = [10, 20, 25, 30, 35]

plt.plot(x, y)

  1. Add labels to the plot:

plt.xlabel('X-axis Label') plt.ylabel('Y-axis Label')

  1. Show the plot:

plt.show()

By following these steps, you should be able to add labels to a matplotlib plot.

How to create a 3D plot with matplotlib?

To create a 3D plot using matplotlib, you can use the Axes3D class from the mpl_toolkits.mplot3d module. Here's an example code snippet to demonstrate how to create a simple 3D plot with matplotlib:

import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D import numpy as np

Create some data

x = np.linspace(-5, 5, 100) y = np.linspace(-5, 5, 100) X, Y = np.meshgrid(x, y) Z = np.sin(np.sqrt(X**2 + Y**2))

Create a 3D plot

fig = plt.figure() ax = fig.add_subplot(111, projection='3d') ax.plot_surface(X, Y, Z, cmap='viridis')

Set labels and title

ax.set_xlabel('X') ax.set_ylabel('Y') ax.set_zlabel('Z') ax.set_title('3D Plot')

plt.show()

This code creates a surface plot of the function z = sin(sqrt(x**2 + y**2)) in a 3D space. You can customize the plot further by changing parameters like the colormap, labels, and title. Make sure to have the mpl_toolkits.mplot3d package installed in order to use the Axes3D class.