Matplotlib Python Tutorial for Beginners

Published: 03 August 2018
on channel: Python Marathon
776
6

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


On this page of the site you can watch the video online Matplotlib Python Tutorial for Beginners with a duration of hours minute second in good quality, which was uploaded by the user Python Marathon 03 August 2018, share the link with friends and acquaintances, this video has already been watched 776 times on youtube and it was liked by 6 viewers. Enjoy your viewing!