The 365 Data Science team is proud to invite you to our own community forum. A very well built system to support your queries, questions and give the chance to show your knowledge and help others in their path of becoming Data Science specialists.
Ask
Anybody can ask a question
Answer
Anybody can answer
Vote
The best answers are voted up and moderated by our team

Problem in python’s mathplotlib module

Problem in python’s mathplotlib module

1
Vote
1
Answer

https://365datascience.teachable.com/courses/python-bootcamp/lectures/14134528
In this lesson around 5:15 , we are been informed to print dotted line.
How can I do same in Spyder?
i tried :-
plt.plot(x_axis,l,’ko–‘) as shown in lesson
Error i got:-
plt.plot(x_axis,l,’ko–‘)
NameError: name ‘x_axis’ is not defined
 
can you please explain.
thank you

1 Answer

365 Team
2
Votes

Hi Prafful, 
you get the error because the x_axis variable has not been defined. In the video, the x_axis is a list of coordinates to be plotted with matplotlib.
You can try the following line of code(same as in the video) for an x_axis and it must be defined and run before you start plotting:
x_axis = [0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0]
 
Best, 
Eli
 

×
LAST CHANCE
Ready to Learn Data Science?
50% OFF