Descargar el Código: patreon.com/pythonmaraton
Join Patreon: patreon.com/pythonmaraton
^Downloadable code & more! This is a Python Matplotlib intro. In this video we plot a basic lambda function and show you how to use plt.title(), plt.xlabel(), plt.ylabel(), plt.plot() and plt.show(). You can customize colors, lines and point markers. Pyplot is an amazing tool in python. I hope you enjoy.
This is a Python anaconda tutorial for help with coding, programming, or computer science. These are short python videos dedicated to troubleshooting python problems and learning Python syntax. For more videos see Python Help playlist by Rylan Fowers.
✅Subscribe: / @pythonmaraton
📺Channel: / @pythonmaraton
▶️Watch Latest Python Content: • Python String Slice and List Slice
▶️Watch Latest Other Content: • Video
Marplot lib intro
This is a quick intro to plotting lambda functions in marplot lib
From marplot lib we import pyplot as plt
Also, for this example we will need some bumpy so, import bumpy as np
So let’s just create a lambdafunction. We will do sin, so we do np.sin()
Now to do a title we type plt.title then enter a string. We’ll be a little boring here and just name it sin
For the x axis you type plt.xlabel and again we will just put x axis for our example
and as you might have guessed you put plt.ylable for the y label
And last, we create a domain for our graph. For simplicity, to do this type np.linspace, in the first spot you put the starting number, then in the second spot you put the ending number, and the last number is how many points you want
Now to graph type plt.plot. then put the domain agains the function with the domain plugged in. So x, then f(x)
Let me show you a few of the parameters of plt.plot
Here we have some colors of the line. it’s just another parameter you put. So here is the color key
You can also change the point markers. Here is a key for those.
Here are some different lines you can make
and lastly here is an example of how you can combine all of those options
So let me show you how to use those. Here we have our plt.plot again, and we type m for magenta and D for dots
Here is the graph wit hate y axis x axis and the 100 dots between -10 and 10 following the sin function
For one last example, say we do the same thing but we add a dash dash. This will add a dashed line between all the points.
There are many things you can do to customize your graph,
Again here are the many options.. You can combine them in any way you desire.
There you have it, that is some of the basics of marplot lib plotting in python
#PythonMarathon #LearnPython #PythonTutorial
Sur cette page du site, vous pouvez voir la vidéo en ligne Matplotlib Python Tutorial for Beginners durée heure minute seconde en bonne qualité , qui a été Téléchargé par l'utilisateur Python Marathon 03 août 2018, Partagez le lien avec vos amis et connaissances, sur youtube cette vidéo a déjà été regardée 776 fois et il a aimé 6 téléspectateurs. Bon visionnage!