0
'linspace' not defined in canopy editor

I can't use the linspace function inside canopy editor and canopy command prompt. although it works inside python console, provided inside the editor.

IT reflects an error of :-
---------------------------------------------------------------------------
NameError Traceback (most recent call last)
C:\Users\kiit1\four_plot.py in <module>()
1 # coding: utf-8
----> 2 x= linspace(-5*pi,5*pi,500)
3 #plot(x,x.'b')
4 plot(x,x,'b')
5 plot(x,-x,'b')
NameError: name 'linspace' is not defined


Python 17-03-18, 1:08 p.m. ankurrj5xe

Answers:

1

Problem solved:

Just run your python script like this.
%run -i your_file_name.py
this will work, without showing any error, also for displaying plots use:
show()

17-03-18, 2:53 p.m. ankurrj5xe

this is not working plz tell the other option . plz give the exact syntax of it


15-09-18, 1:25 p.m. sushma

Login to add comment


Log-in to answer to this question.