Matplotlib Tutorial 29 - matplotlib 3d intro
Skills:
AI Productivity Tools60%
Key Takeaways
Builds a 3D graph using Matplotlib
Full Transcript
what is going on everybody Welcome To Part 29 of our M plot lib tutorial series here we're going to kind of ran start ranning out this series with three-dimensional plotting with map plot lib so uh let's go ahead and just hop right in so uh 3D plotting with map plot lib is actually already included with map plot lib we don't have to add any extension like base map so all we need to do is from MPL toolkits mplot3d import axis 3D then as we always need import matplot li. pyplot as PLT so now we're ready to rumble uh first We'll add the figure we'll say fig equals PLT do figure and then we'll add an axes we'll say ax1 equals fig. addore subplot we'll just make it a 1 by one by one and then or 1ex one chart number one and then we add this other uh keyword here and this is projection equals and 3D so this is our way of notifying python that hey we're about to throw three dimensions at you if you forget that it's just not going to work but uh with that it's pretty much all you need now what we're going to do is we need some x's some y's and some z's so we're going to say x equals a list y equals a list and Z equals a list and now let's give some numbers here so 1 2 3 4 5 six 7 8 nine and 10 now uh you can copy me if you want but I'm just putting random numbers in here so just put some random numbers try not to make them giant like that uh just so we have enough numbers uh then we'll do like this not 32 okay so that's a good decent we got some x's some y's and some z's so now what we can do is we can just do ax1 do plot wireframe and then we'll plot the X the Y and the Z in our wire frame now we can give labels like we've always given them so a x1. setor x label and we'll give this the label of x axis a x1. setor y label ya axis and then finally x1. set uncore z label Z axis whoops Z axis can't type anyway now finally we round it all out with the traditional PLT doow and save and run there we go quite an interesting uh little graph that is uh come upon us anyway there it is uh so it's a threedimensional graph you should be able to click and drag it probably looks a little better on your screen when you click and drag than mine I believe I record in like five frames a second or something so it probably looks pretty jittery but should be pretty smooth uh for you until you add a lot of points uh the other thing to note is the axis labels they're like no matter like where you put it it's like always nice so if you'll notice that x axis flips a little bit once it starts getting a little absurd uh also the side of the axes will flip around too um so it's it's really nice and intuitive kind of nature that this three-dimensional plotting gives you but regardless it's a 3D plot labels still work and all that you can't really Zoom what you can do is you can hold your right right m and like zoom in and out like that and that's kind of an interesting thing you can do as far as zooming is concerned you can really get absurd with it if you wanted but anyway so you can do that but for the most part everything else kind of stays the same you can't really use the other buttons like you would you used to be able to anyway that's just a really quick example of a 3D plot obviously this is a pretty boring wireframe at the end we'll do a more interesting wireframe uh the next tutorial what we're going to do is we're going to cover thre dimensional Scatter Plots so uh that's what you have to look forward to if you have any questions comments something go wrong or whatever up to this point uh let me know otherwise as always thanks for watching thanks for all the support and subscriptions and until next time
Original Description
Hello and welcome to a 3D graphing in Matplotlib tutorial. Three dimensional graphing in Matplotlib is already built in, so we do not need to download anything more.
sample code: http://pythonprogramming.net
http://hkinsley.com
https://twitter.com/sentdex
http://sentdex.com
http://seaofbtc.com
Watch on YouTube ↗
(saves to browser)
Sign in to unlock AI tutor explanation · ⚡30
Playlist
Uploads from sentdex · sentdex · 0 of 60
← Previous
Next →
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
Matplotlib Python Tutorial Part 1: Basics and your first Graph!
sentdex
Python Encryption Tutorial with PyCrypto
sentdex
Python's Logging Function
sentdex
wxPython Tutorials 1: Making Windows GUIs with Python : Installing + 1st window!
sentdex
wxPython Tutorials 2: Making Windows GUIs with Python: Customizing Window Parameters
sentdex
wxPython Programming Tutorial 3: Menu Bar and Menu Button
sentdex
wxPython Programming Tutorial 4: Panels
sentdex
wxPython Programming Tutorial 5: User Input Saved To Variables
sentdex
wxPython Programming Tutorial 6: Multiple Choice Input
sentdex
wxPython Programming Tutorial 7: Adding Static Text and Colors
sentdex
wxPython Programming Tutorial 8: Custom Button Images
sentdex
wxPython Programming Tutorial 9: Tool Bar Items and Sub Menus!
sentdex
Basic PHP Tutorial 13: Multi-dimensional Array
sentdex
Basic PHP Tutorial 15: Functions and Global Variables
sentdex
Basic PHP Tutorial 12: Associative Array
sentdex
Basic PHP Tutorial 14: Foreach loop
sentdex
Basic PHP Tutorial 16: Include and Require
sentdex
Basic PHP Tutorial 7: Assignment, comparison and Logical operators
sentdex
Basic PHP Tutorial 4: Variables and Comments
sentdex
Basic PHP Tutorial 11: Arrays part 1, basic array
sentdex
Basic PHP Tutorial 6: If else and else if conditionals cont'd
sentdex
Basic PHP Tutorial 1: Intro to PHP
sentdex
Basic PHP Tutorial 3: HTML with PHP
sentdex
Basic PHP Tutorial 9: While Loop
sentdex
Basic PHP Tutorial 10: Switch Statement
sentdex
Basic PHP Tutorial 2: Print and Echo
sentdex
Basic PHP Tutorial 5: If else and else if conditional statements
sentdex
Basic PHP Tutorial 8: Arithmatic Operators: Doing math with php
sentdex
Basic PHP Tutorial 17: User Input Form Example / String Manipulation
sentdex
Basic PHP Tutorial 18: HTML Entities and forms cont'd
sentdex
Basic PHP Tutorial 19: Finding words in strings
sentdex
Basic PHP Programming Tutorial 20: Saving to a File / writing and appending
sentdex
Basic PHP Programming Tutorial 22: Hashing part 2: salting
sentdex
Basic PHP Programming Tutorial 23: Variables in Strings and tokenizing
sentdex
Basic PHP Programming Tutorial 21: MD5 Hashing For Security
sentdex
Basic PHP Programming Tutorial 24: String similarity
sentdex
Basic PHP Programming Tutorial 25: Time and Time stamps
sentdex
Basic PHP Programming Tutorial 26: Die and Exit
sentdex
Basic PHP Programming Tutorial 27: MySQL Databases Part 1
sentdex
Basic PHP Programming Tutorial 28: MySQL Database Part 2: Reading From Database
sentdex
Basic PHP Programming Tutorial 29: MySQL Database Part 3: Inputting Data
sentdex
Basic PHP Programming Tutorial 30: MySQL database in Use
sentdex
Django Tutorial Web Development with Python Part 1: Installing Django
sentdex
Python Tutorial: File Deletion and Folder Deletion / directory deletion
sentdex
Python Tutorial: How to Rename Files and Move Files with Python
sentdex
3D Graphs in Matplotlib for Python: Basic 3D Line
sentdex
3D Plotting in Matplotlib for Python: 3D Scatter Plot
sentdex
3D Charts in Matplotlib for Python: Multiple datasets scatter plot
sentdex
Sikuli Tutorial 1: Visually programming in python!
sentdex
Sikuli Tutorial 2: Program visually in python!
sentdex
Sikuli Tutorial 3: Program visually in python!
sentdex
3D Bar Charts in Python and Matplotlib
sentdex
3D Plane wire frame Graph Chart in Python
sentdex
Raspberry Pi Part 1 Introduction
sentdex
Raspberry Pi Part 8: First Download and Update! (Firmware)
sentdex
Raspberry Pi Part 10: How to set up a Linux Web Server on your Pi
sentdex
Raspberry Pi Part 11: Remote Desktop
sentdex
Twitter Analysis: How to rank a user's influence
sentdex
GPIO Tutorial for Pi Part 2 - Programming the GPIO
sentdex
GPIO Tutorial for Raspberry Pi Part 1 - Setting up
sentdex
More on: AI Productivity Tools
View skill →
🎓
Tutor Explanation
DeepCamp AI