Data Visualization Using Pyplot
Chapter 16 · Tamil Nadu State Board
- 19 min read
- 5-question quiz
Every key point below shows the sentence from your textbook it comes from. Book back answers are solved and checked against the book; answers we could not prove are left out. How we check content
In short
This lesson explains how Data Visualization presents information graphically so people can understand and analyze data more easily. It introduces Matplotlib and Pyplot, including how to import the library and display plots. It teaches how line charts, bar charts and pie charts show different kinds of information. Choosing a suitable chart helps communicate patterns, comparisons and proportions clearly.
Written by AI from this lesson. How we check it
Key points
- Data Visualization uses graphical forms to communicate information to users.
From your textbook
“The objective of Data Visualization is to communicate information visually to users.”
- Charts, tables, graphs, maps, infographics and dashboards are general forms of Data Visualization.
From your textbook
“Charts • Tables • Graphs • Maps • Infographics • Dashboards”
- Matplotlib is a Python library for making two-dimensional charts.
From your textbook
“It allows you to create two dimension (2D) charts in few lines of code.”
- When plot() receives only one list, it treats the values as y-coordinates and creates x-coordinates starting at zero.
From your textbook
“matplotlib assumes it is a sequence of y values, and automatically generates the x values for you.”
- A line chart connects data markers and can show trends across time intervals.
From your textbook
“A Line Chart is often used to visualize a trend in data over intervals of time”
- Bar charts compare numeric values across categories, while pie charts show parts in relation to a whole.
From your textbook
“It’s useful when we want to compare a given numeric value on different categories.”
- A histogram has no gaps between its bars, unlike a bar graph.
From your textbook
“The histogram is drawn in such a way that there is no gap between the bars.”
Formulas in this chapter
- Insert a recordInsert into employee values(...);Explained here
- Add a fieldAlter table employee add(doj date);Explained here
- Update selected recordsupdate employee set doj = '21-03-2010' where empno=1221;Explained here
- Select students by departmentSelect * from Student where Dept='CSE';Explained here
- Select by age and departmentSelect * from Student where Age >=20 and Dept='ME';Explained here
- Group and order recordsSelect * from Student Group by Dept Order by Sname;Explained here
- Display distinct register numbersSelect Distinct Reg_No from Student;Explained here
- Change a class valueUpdate Student set Class='ME1' where Class='ME2';Explained here
Data Visualization and Its Uses
Definition
- Data Visualization
- Data Visualization is the graphical representation of information and data to communicate information visually.
Dots, lines, or bars can represent numerical data. Visual displays help users analyze and interpret data easily. Charts can also show relationships between one or more variables.
General types of Data Visualization
- Charts
- Tables
- Graphs
- Maps
- Infographics
- Dashboards
Definition
- Infographic
- An infographic, or information graphic, represents information in a graphic format.
Definition
- Dashboard
- A dashboard is a collection of resources assembled into one unified visual display.
Data visualizations and dashboards make complex ideas easier to understand. A dashboard can reveal patterns and relationships at a glance, even when they are hard to detect in text.
Remember: Data Visualization uses visual displays to make information easier to understand and interpret.
Matplotlib and Pyplot Basics
Matplotlib is a popular data visualization library in Python. It can create two dimension (2D) charts with a few lines of code. Its visualization types include line plots, scatter plots, histograms, box plots, bar charts, and pie charts.
Definition
- Scatter plot
- A scatter plot shows data as points, with each point's position based on its values along the horizontal and vertical dimensions.
Definition
- Box plot
- A box plot displays the distribution of data using the five number summary: minimum, first quartile, median, third quartile, and maximum.
Matplotlib can be installed using pip, a package manager software for installing Python packages. Import it with import matplotlib.pyplot as plt. In a Python script, use plt.show() to display a plot.
If plot() receives only one list or array, Matplotlib treats its values as y values and generates x values starting at 0. For example, [1,2,3,4] gets x values [0, 1, 2, 3]. If you provide two lists, their values are used as x and y coordinates.
For the lists [1,2,3,4] and [1,4,9,16], the coordinate pairs are (1,1), (2,4), (3,9) and (4,16). You can plot two lines by calling plt.plot() for each line. Use plt.xlabel() and plt.ylabel() for axis labels, plt.title() for the title, and plt.legend() to show the legend.
Matplotlib window buttons
- Home returns the chart to its original view.
- Forward and Back move between previous and later views.
- Pan Axis lets you drag the graph around.
- Zoom lets you drag a square to zoom in; right-click and drag to zoom out.
- Configure Subplots changes spacing options for the figure and plot.
- Save Figure saves the figure in various forms.
Remember: Use plt.show() in a Python script to display the plot.
Line Charts and Bar Charts
Definition
- Line Chart
- A Line Chart displays information as data points called markers, joined by straight line segments.
A Line Chart is often used to show trends over time. The data points are usually arranged chronologically when the chart shows a time series.
In the population example, years [2014, 2015, 2016, 2017, 2018] are plotted against total_populations [8939007, 8954518, 8960387, 8956741, 8943721]. The title is Year vs Population in India, and the axes are labelled Year and Total Population.
Definition
- Bar chart
- A Bar chart represents categorical data with rectangular bars whose heights correspond to the values they represent.
Bars can be vertical or horizontal. A bar chart is useful for comparing numerical values across categories. In Matplotlib, plt.bar() creates a bar chart.
In the marks example, labels are TAMIL, ENGLISH, MATHS, PHYSICS, CHEMISTRY, and CS. Their usage values are [79.8, 67.3, 77.8, 68.4, 70.2, 88.5]. The positions are created with range (len(labels)), and plt.xticks() places the labels along the x-axis.
Histogram and Bar Graph
| Histogram | Bar graph |
|---|---|
| Shows the frequency of numerical data. | Uses bars to compare categories of data. |
| Represents frequency distribution of continuous variables. | Compares discrete variables. |
| Presents numerical data. | Shows categorical data. |
| Bars have no gaps between them. | Bars have spacing between them to show discontinuity. |
| Numbers are grouped to represent ranges of data. | Items are treated as individual entities. |
Remember: A histogram has no gaps between its bars; a bar graph has gaps between its bars.
Pie Charts with Matplotlib
Definition
- Pie Chart
- A Pie Chart is a circular chart split into slices to show how parts relate to a whole.
Use plt.pie() to create a Pie Chart in Matplotlib. The autopct parameter displays percentage values using Python string formatting.
Worked example
Create a Pie Chart for the given subject values: Tamil 89, English 80, Maths 90, Science 100, Social 75.
Try it first, then show the solutionSolution
- Import matplotlib.pyplot as plt.
- Set sizes = [89, 80, 90, 100, 75].
- Set labels = ["Tamil", "English", "Maths", "Science", "Social"].
- Call plt.pie (sizes, labels = labels, autopct = "%.2f").
- Call plt.show().
Answer: The Pie Chart displays one labelled slice for each subject, with its percentage value.
Bar Graphs and Histograms
Bar Graph and Histogram
| Bar graph | Histogram |
|---|---|
| Blocks can commonly be rearranged from highest to lowest. | Blocks stay in the sequence of classes. |
| The width of the bars is always the same. | The width of the rectangular blocks may or may not be the same. |
Matplotlib Practice and Key Ideas
Chart practice tasks
- Plot a line chart using Average Pulse: 80, 85, 90, 95, 100 and Calorie Burnage: 240, 250, 260, 270, 280. Set titles for the x and y axes.
- Plot a Pie Chart for your marks in the recent examination.
- Plot a line chart showing the academic performance of Class 12 students in Computer Science for the past 10 years.
- Plot a bar chart showing the number of computer science periods in a week.
Remember: Use a Pie Chart to show how parts make up a whole. Use plt.pie() to create it, and autopct to display percentages.
Python Functions and Program Structure
Pure and impure functions
| Pure functions | Impure functions |
|---|---|
| Return the same result when given the same arguments. | No further description is provided. |
Definition
- Parameter
- A parameter is a variable in a function definition.
Definition
- Method
- A method is a function declared and defined inside a class.
Definition
- Recursion
- Recursion happens when a function calls itself.
Definition
- Lambda
- A lambda function is mostly used to create a small, one-time anonymous function.
Definition
- Scope
- Scope is where variables, parameters and functions are visible within a program.
LEGB rule
- Local
- Enclosed
- Global
- Built-in
A variable declared inside a function body or block has local scope. A nested block is a block inside another block. A namespace maps names of variables to objects.
Definition
- Mapping
- Mapping is the process of binding a variable name to an object.
Definition
- Routine
- A routine is another name for a function or method; in Python it is also called a definition.
Python Interpreter, Files and Errors
Ways to use the Python interpreter
| Interactive Mode | Script Mode |
|---|---|
| Type commands and expressions at the interpreter prompt. | Use a Python program stored in a file. |
Definition
- Interpreter
- An interpreter translates a program one statement at a time and stops when it meets the first error, which makes debugging easier.
Definition
- Prompt
- A prompt is the character displayed by the interpreter when it is ready for input; the Python prompt is >>>.
Definition
- Module
- A module is a file containing Python definitions and statements, and its file name has the suffix .py.
Definition
- Syntax
- Syntax is the structure of a program.
Definition
- Syntax Error
- A syntax error is an error that makes a program impossible to parse.
Definition
- Token
- A token is one of the basic elements in a program's syntactic structure.
Definition
- Parse
- To parse is to split input into pieces of data that can be stored or manipulated.
Definition
- pass
- The pass statement can act as a placeholder in functions and loops.
Python Collections and Data Concepts
Lists and tuples
| List | Tuple |
|---|---|
| An ordered, mutable collection of values. | A sequence of immutable objects, with values written between parentheses ( ). |
Stack and queue
| Stack | Queue |
|---|---|
| Items are added and removed at the same end, called the top. It follows LIFO: last-in, first-out. | One end is used to insert data (enqueue) and the other to remove data (dequeue). It follows First-In-First-Out: the first stored item is accessed first. |
Definition
- Object
- An object is a collection of data and functions.
Definition
- Instantiation
- Instantiation is the process of creating an object.
Definition
- Object Oriented Programming
- Object Oriented Programming is a computer programming concept based on real-world objects.
Definition
- Interface
- An interface defines what an object can do, but does not perform those actions itself.
Definition
- Iterator
- The next() function returns the next item from an iterator.
Definition
- Key
- A key is data that is mapped to a value in a dictionary.
Definition
- Selectors
- Selectors are functions that retrieve information from a data type.
Definition
- Subscript
- A subscript is an index number.
Definition
- Slicing
- Slicing means cutting.
Relations, Files and Python Function Reference
Relational operations
- Intersection gives the tuples that are in both A and B.
- Projection ( π ) keeps the attributes named in the projection list and removes the others.
- Select ( σ ) chooses a subset of tuples using a selection condition.
- Set difference (-) gives the tuples in A but not in B.
- Union operation (U) includes tuples that are in table A or table B.
File and system tools
- writerow() writes one row of data to a file.
- writerows() writes multiple rows of data to a file.
- operator.itemgetter(col_ no) can sort by more than one column from a csv file.
- os.system() executes a system command; in a Python program it is used to compile a c++ program using g++.
- When skipinitialspace=true, whitespace immediately after the delimiter is ignored. The default is false.
Useful built-in Python functions
- abs() returns the absolute value of a number.
- all() returns true when all elements in an iterable are true; any() checks whether any element is true.
- len() returns the length of an object.
- max() returns the largest element; min() returns the smallest element.
- print() prints the given object; input() reads and returns a line of string.
- range() returns a sequence of integers between start and stop.
- sorted() returns a sorted list from an iterable; reversed() returns a reversed iterator of a sequence.
- sum() adds the items of an iterable.
- type() returns the type of an object; isinstance() checks whether an object is an instance of a class.
- open() returns a file object; next() retrieves the next element from an iterator.
Useful string functions
- capitalize() converts the first character to a capital letter; title() returns a title-cased string.
- lower() returns a lowercased string; upper() returns an uppercased string; swapcase() changes uppercase characters to lowercase and vice versa.
- find() returns the index of the first occurrence of a substring; count() returns the number of its occurrences.
- split() splits a string from the left; rsplit() splits it from the right; join() returns a concatenated string.
- strip() removes leading and trailing characters; lstrip() removes leading characters; rstrip() removes trailing characters.
- replace() replaces a substring inside a string; startswith() and endswith() check the start and end of a string.
Remember: Remember the difference between a stack's LIFO order and a queue's First-In-First-Out order.
Python list functions
Lists can be changed using functions such as append(), insert(), remove() and pop(). Other functions help copy, search, count, sort or reverse list contents.
Common list functions
- append() adds one element to a list; extend() adds elements from another list.
- insert() places an element in the list. remove() removes an element, while pop() removes an element at a given index.
- clear() removes all items. copy() returns a shallow copy.
- count() returns how many times an element occurs. index() returns its smallest index.
- reverse() reverses a list. sort() sorts its elements.
- list() creates a list. slice() creates a slice object specified by range().
Remember: Use remove() to remove an element, and pop() to remove an element at a given index.
Python tuple functions
Tuple functions include ways to count or find elements. Functions are also available to create tuples, make slice objects and return an iterator of tuples.
Tuple functions
- count() returns the number of occurrences of an element in a tuple.
- index() returns the smallest index of an element in a tuple.
- slice() creates a slice object specified by range().
- tuple() creates a tuple.
- zip() returns an iterator of tuples.
Python set functions
Set functions can add or remove elements and compare sets. They can also return or update sets using operations such as union, intersection and difference.
Common set functions
- add() adds an element. update() adds elements to the set.
- clear() removes all elements. discard() removes an element. remove() also removes an element, while pop() removes an arbitrary element.
- copy() returns a shallow copy. set() returns a Python set. frozenset() returns an immutable frozenset object.
- union() returns the union of sets. intersection() returns the intersection of two or more sets.
- difference() returns the difference of two sets. symmetric_difference() returns the symmetric difference.
- intersection_update() updates the calling set with the intersection of sets. difference_update() updates the calling set with the intersection of sets. symmetric_difference_update() updates a set with the symmetric difference.
- isdisjoint() checks disjoint sets. issubset() checks whether a set is a subset of another set. issuperset() checks whether a set is a superset of another set.
Worked example
Find the union, intersection, difference and symmetric difference of the odd-number set and prime-number set shown in the program.
Try it first, then show the solutionSolution
- Odd Numbers: {1, 3, 5, 7, 9}
- Prime Numbers: {2, 3, 5, 7}
- Apply union(), intersection(), difference() and symmetric_difference() to the sets.
Answer: Union: {1, 2, 3, 5, 7, 9}; Intersection: {3, 5, 7}; Difference: {1, 9}; Symmetric Difference: {1, 2, 9}
Python dictionary functions
Dictionary functions can create and update dictionaries. Other functions provide views of keys, values or key-value pairs, or remove entries.
Common dictionary functions
- dict() creates a dictionary. fromkeys() creates a dictionary from a given sequence.
- clear() removes all items. copy() returns a shallow copy.
- get() returns the value of a key. setdefault() inserts a key with a value if the key is not present. update() updates the dictionary.
- items() returns a view of the dictionary's (key, value) pairs. keys() returns a view object of all keys. values() returns a view of all values.
- pop() removes and returns the element with a given key. popitem() returns and removes an element from the dictionary.
Dictionary views
| Function | What it returns |
|---|---|
| keys() | A view object of all keys |
| values() | A view of all values |
| items() | A view of (key, value) pairs |
Adding and updating employee records in MySQL
Insert employee records with INSERT INTO and give values in the order of the table fields. Use SELECT * to display all records. ALTER TABLE adds a field, and UPDATE assigns a value to selected records.
Insert into employee values(...);
The values must match the employee table fields in order.
Alter table employee add(doj date);
Adds the date field doj to the employee table.
update employee set doj = '21-03-2010' where empno=1221;
Sets the doj value for the employee whose empno is 1221.
Employee table operations
- Seven employee records are shown after two more records are inserted.
- The new doj field stores each employee’s date of joining.
- The dates appear in the displayed results as year-month-day.
- The query select * from emp where empno is null; returns Empty set.
Worked example
List employees who joined after 01-01-2018.
Try it first, then show the solutionSolution
- Use SELECT * to display the employee records.
- Use WHERE doj > '01-01-2018' to choose dates after the given date.
Answer: The displayed result contains Abinaya, whose doj is 2018-06-17, and Rahul, whose doj is 2018-01-02.
Remember: Use WHERE to select records that match a condition, and UPDATE with WHERE to change only the intended records.
Creating and querying the Student table
The Student table stores register number, name, age, department and class. Insert each student's values in that field order. SELECT queries can filter records, group by department, order by name, or display distinct register numbers.
Select * from Student where Dept='CSE';
Displays records whose Dept value is CSE.
Select * from Student where Age >=20 and Dept='ME';
Displays students aged 20 or more whose department is ME.
Select * from Student Group by Dept Order by Sname;
Groups records by department and orders the result by Sname.
Select Distinct Reg_No from Student;
Displays each distinct Reg_No value.
Student queries and results
| Query | Result shown |
|---|---|
| Dept='CSE' | Sneha and Lithya |
| Age >=20 and Dept='ME' | Akash |
| Group by Dept Order by Sname | Four rows are shown |
| Distinct Reg_No | Seven register numbers are shown |
Update Student set Class='ME1' where Class='ME2';
Changes Class to ME1 for records whose current Class is ME2.
Remember: The query shown changes ME2 to ME1. The following displayed table still shows ME2, so the output does not match the update.
Writing and searching a CSV file with Python
The program uses Python's csv module to write player names and scores to a CSV file. It accepts a player name, reads the file and checks each row. If the name is not found, it prints an appropriate message.
Program flow
- Open player.csv in write mode and create a csv.writer.
- Accept 10 player names and scores, then write each pair as a row.
- Open the CSV file in read mode and read its rows.
- Print matching rows, or print string not found if there is no match.
Worked example
Search the player file for Sachin Tendulkar.
Try it first, then show the solutionSolution
- The program checks the rows read from the CSV file.
- It prints every row containing the search name.
Answer: ['Sachin Tendulkar', '200'] and ['Sachin Tendulkar', '250']
Using Python with SQL and displaying a pie chart
The Python with SQL program connects to info.db and creates a student table with name and age fields. It accepts 10 names and ages, inserts them, and selects the records in descending order of age. The displayed output starts with Ramaa, age 70, and ends with Annamalai, age 17.
SQL program steps
- Connect to info.db and create a cursor.
- Create the student table with name and age fields.
- Accept and insert 10 name-and-age pairs.
- Select all records using order by age desc and display them.
The graphics exercise asks for five marks using a list and asks for those marks to be displayed in a pie chart using matplot.
Questions students ask
Short, direct answers to what students search for in this chapter.
What is Data Visualization?
Data Visualization is the graphical representation of information and data. It communicates information visually. Numerical data can be shown using dots, lines, or bars, helping users analyze and interpret data more easily.
What are the uses of Data Visualization?
Data Visualization helps users analyze and interpret data easily. It can make complex data understandable and usable. Charts can also show relationships in data involving one or more variables.
How do I display a plot using Matplotlib?
Import Matplotlib with import matplotlib.pyplot as plt. Create the plot using Matplotlib commands, then add plt.show() inside the Python script. This displays the plot in a Matplotlib window.
What is the difference between a histogram and a bar graph?
A histogram displays the frequency distribution of continuous numerical data, with no gaps between bars. A bar graph compares categories using bars with spaces between them. Histogram items represent ranges; bar graph items are individual entities.
What is a Pie Chart?
A Pie Chart is a circular chart divided into slices. Each slice represents part of a whole, so the chart shows how the parts relate to the total.
How do you make a Pie Chart in Matplotlib?
Use the plt.pie() function. Give it the data values and, if needed, labels. The autopct parameter can display percentage values using Python string formatting.
Show 15 more questions
What is the difference between a bar graph and a histogram?
A bar graph’s bars can commonly be rearranged from highest to lowest, and their widths are always the same. A histogram’s blocks stay in the sequence of classes, and their widths may or may not be the same.
What is the difference between a pure function and an impure function in Python?
A pure function always returns the same result when it receives the same arguments. The supplied definition gives no further description of impure functions, so it does not state how their results behave.
What is the LEGB rule in Python?
LEGB gives the scope order as Local, Enclosed, Global and Built-in. These are the scope names in the rule for understanding where variables can be found.
What is the difference between a stack and a queue?
A stack adds and removes items at the same end, called the top, and follows LIFO: last-in, first-out. A queue inserts at one end and removes at the other, following First-In-First-Out, so the first stored item is accessed first.
What do the relational operations intersection, union and set difference do?
Intersection gives tuples found in both A and B. Union includes tuples from table A or table B. Set difference A-B gives tuples that are in A but not in B.
What is the difference between Interactive Mode and Script Mode in Python?
In Interactive Mode, commands and expressions are typed at the Python interpreter prompt. Script Mode uses a Python program stored in a file.
What is the difference between remove() and pop() in a list?
remove() removes an element from the list. pop() removes an element at a given index. Use remove() when you want to remove an element, and pop() when you want to remove an element by its position.
What does zip() do with tuples?
The tuple function list includes zip(). It returns an iterator of tuples. The listed description does not give further details about how the iterator is formed.
What is the difference between union and intersection of sets?
union() returns the union of sets, while intersection() returns the elements in the intersection of two or more sets. For the shown sets, the union is {1, 2, 3, 5, 7, 9}, and the intersection is {3, 5, 7}.
Which dictionary function returns key-value pairs?
items() returns a view of a dictionary's (key, value) pairs. keys() returns a view object of all keys, and values() returns a view of all values.
How do I add a date of joining field to an employee table in MySQL?
Use ALTER TABLE to add the field. The query shown is Alter table employee add(doj date);. This adds a date field named doj to the employee table. The employee records can then be updated to store their joining dates.
How do I find employees who joined after 01-01-2018?
Use a SELECT query with a WHERE condition on doj: Select * from emp where doj > '01-01-2018';. The displayed result contains Abinaya, with doj 2018-06-17, and Rahul, with doj 2018-01-02.
How do I find students aged 20 or more in the ME department?
Use Select * from Student where Age >=20 and Dept='ME';. The condition selects records where the age is 20 or more and the department is ME. The displayed result is M1002, Akash, age 20.
How does the Python CSV program search for a player's score?
The program reads the CSV file into rows, then checks whether the entered search name appears in each row. It prints matching rows with the player's name and score. If no row matches, it prints string not found.
How does the Python with SQL program sort students by age?
After inserting the names and ages into the student table, the program runs select * from student order by age desc. This displays the records in descending order of age, from the greatest age to the smallest age.
Book back answers
14 textbook exercises, solved and checked against the book. Questions we could not prove are left out.
Choose the best answer (1 Mark)
Identify the package manager for installing Python packages, or modules.
- a. Matplotlib
- b. PIP
- c. plt.show()
- d. python package
Try it, then show the answerAnswer
b. PIP
The chapter identifies Pip as the package manager for installing Python packages.
From the book: “Pip is a Package manager software for installing python packages.”
Which of the following feature is used to represent data and information graphically?
- a. Data List
- b. Data Tuple
- c. Classes and Objects
- d. Data Visualization
Try it, then show the answerAnswer
d. Data Visualization
Data Visualization is the graphical representation of information and data.
From the book: “Data Visualization is the graphical representation of information and data.”
.......... is a collection of resources assembled to create a single unified visual display.
- a. Interface
- b. Dashboard
- c. Objects
- d. Graphics
Try it, then show the answerAnswer
b. Dashboard
The chapter defines a dashboard as a collection of resources creating a unified visual display.
From the book: “A dashboard is a collection of resources assembled to create a single unified visual display.”
Which of the following module should be imported to visualize data and information in Python?
- a. csv
- b. getopt
- c. mysql
- d. matplotlib
Try it, then show the answerAnswer
d. matplotlib
Matplotlib is the data visualization library in Python described in the chapter.
From the book: “Matplotlib is the most popular data visualization library in Python.”
Practice
What is the main objective of Data Visualization?
Exam questions
Practice questions with model answers. These are not from an official paper.
What is Data Visualization, and what is its objective?2 marks
Data Visualization is the graphical representation of information and data. Its objective is to communicate information visually to users.
What does Matplotlib do, and how is it imported for plotting?2 marks
Matplotlib is a Python data visualization library that can create two-dimensional charts. It is imported using import matplotlib.pyplot as plt.
Give one use each for a line chart, a bar chart and a pie chart.2 marks
A line chart can show trends over time intervals. A bar chart compares numerical values across categories. A pie chart shows how parts relate to a whole.
Explain the difference between a histogram and a bar graph in terms of the data they display and the spacing between bars.2 marks
A histogram represents the frequency distribution of continuous numerical data and has no gaps between bars. A bar graph compares discrete or categorical data and has spacing between its bars.
Watch out
- Do not confuse a histogram with a bar graph: histograms show frequency distributions of continuous variables and have no gaps, while bar graphs compare categories and have spacing.
- Do not assume a single list passed to plot() supplies x-values; it is treated as y-values, with x-values generated from zero.
Still stuck on this lesson?
Get an AI answer grounded in your actual textbook — with the exact page reference.
Ask AI about this topic →