Python Forum
Where can I find a reference to python 3.7 commands?
Thread Rating:
  • 1 Vote(s) - 2 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Where can I find a reference to python 3.7 commands?
#1
I am using spyder with python 3.7, I am reading a 2015 book that says this:

">>> plot (x,y,'o')

where the string 'o' ensures that a small circle is plotted at each data point".

I have tried several options and I see if I write plot(x,y,'orange') the plot is orange, so this third argument has nothing to do with the shape, it does with the colour.

This is the whole code in Spyder console:

m = array([1.0,2.0,4.0,6.0,9.0,11.0])
V = array([0.13,0.26,0.50,-0.5,1.15,1.36])

plot(m,V,'brown')
My question is, I have not imported any library in this code and when executed it works properly, where can I find a reference to learn about the arguments I can supply to the plot funcion? It is python 3.7.

Where can I learn all about the plot function in python 3.7?

THanks for your time.

I have to add that in this 2015 book xlabel('mass kg') is used but fails in python 3.7. I have to use xlabel("mass kg") instead.

I would like to read about xlabel in python 3.7.
Reply
#2
Neither plot or array are defined in Python 3.7. If you're using Spyder, it claims to offer 'built-in integration' with many scientific packages. My guess is those packages are loading by default, maybe numpy (array) and matplotlib (plot).

I would try help(plot). That should give you some information on the function, perhaps which package they are from.
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures
Reply
#3
(Dec-18-2018, 03:03 AM)ichabod801 Wrote: Neither plot or array are defined in Python 3.7. If you're using Spyder, it claims to offer 'built-in integration' with many scientific packages. My guess is those packages are loading by default, maybe numpy (array) and matplotlib (plot).

I would try help(plot). That should give you some information on the function, perhaps which package they are from.

ok I understand so even if I don't import a library python uses it anyway, interesting.

I apologize for this question but, Where should I type help(plot)?

Thanks for your help!
Reply
#4
(Dec-18-2018, 01:38 PM)newbie2019 Wrote: I apologize for this question but, Where should I type help(plot)?

In the interactive Python prompt. Is there one in Spyder? It's where you can type in a Python expression, and it will immediately return the response.
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures
Reply
#5
You can also get the module with
import inspect
print(inspect.getmodule(plot))
then you can find this module's documentation.
Reply
#6
(Dec-18-2018, 01:47 PM)ichabod801 Wrote:
(Dec-18-2018, 01:38 PM)newbie2019 Wrote: I apologize for this question but, Where should I type help(plot)?

In the interactive Python prompt. Is there one in Spyder? It's where you can type in a Python expression, and it will immediately return the response.

In Spyder I don't know, I can open the "anaconda prompt" and type "python", but after writing help(plot) I get an error. I don't know how to do it in Spyder.

(Dec-18-2018, 01:50 PM)Gribouillis Wrote: You can also get the module with
import inspect
print(inspect.getmodule(plot))
then you can find this module's documentation.

It worked, it is matplotlib and it shows me the folder where it is stored.

Thank you a lot folks.
Reply
#7
Don't hesitate to browse matplotlib's documentation
Reply
#8
(Dec-18-2018, 03:18 PM)Gribouillis Wrote: Don't hesitate to browse matplotlib's documentation

thanks
Reply


Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020