Plot axis
Title
Question
a=linspace(3,-3,100)
b=sin(a)
plot(b,'r')
Plots a graph considering data of "b" for y axis, what is the default x axis data or value it consider ?
Python Embellishing-a-plot 04-05 min 40-50 sec
Answers:
By default, a range of values is generated for the x-axis, based on the number of points generated by linspace.
For e.g a=linspace(3,-3,100) will generate 100 points between 3 and -3. so the x-axis points are considered from 0-100.
If a=linspace(3,-3, 50) is considered then the x-axis points are considered from 0-50.
For more information on how the plot command works, you can try the plot? inside the ipython terminal.
Login to add comment