delete the line from graph (Multiple plots)
Title
Question
if i draw two or more line on graph i want to delete one of line from graph what function is used to delete the any one of line
Python-3.4.3 Multiple-plots 10-11 min 50-60 sec
Answers:
You need to store the plot command in a variable and use remove method to clear the specific plot.
For e.g.
x = linspace(0, 2*pi, 50)
a = plot(x, sin(x))
b = plot(x, cos(x))
Let's say we want to remove the sine plot stored in the variable a. Just type a[0].remove(). This will remove the sine plot but the cosine plot is still present.
You need to store the plot command in a variable and use the remove method to clear the specific plot.
For e.g.
x = linspace(0, 2*pi, 50)
a = plot(x, sin(x))
b = plot(x, cos(x))
Let's say we want to remove the sine plot stored in the variable a. Just type a[0].remove(). This will remove the sine plot but the cosine plot is still present.
Login to add comment