Matplotlib Tutorial 30 - 3d scatter plot
Key Takeaways
Graphs a 3D scatter plot in Matplotlib
Full Transcript
everybody what is going on welcome to part three of our matplotlib tutorial series in this part we're gonna be talking about is 3ds scatter plots so with this code we can actually use quite a bit of the previous code the only thing we're gonna get rid of is plotting for the wireframe so what we'll do is we'll just lose comment this out for now and the next thing that I want us to do is we need some more variables so I'm gonna well yeah I guess we'll just do X let's copy this line at least copy paste and in fact let's copy this whole thing copy paste and then the X we'll just make these all whoops make these all negatives negative negative negative negative negative just make all these negatives so they're kind of like in their own little place basically negative negative negative negative negative negative and negative and one more negative okay good enough so with scatter plots it's really quite simple you can basically will use the first set first and then we'll come on use the second set last you can do something like this X 1 dot scatter and then you pass the X the Y the Z that's really all you have to do so first we can bring that one up and so now we've got these scatters and another little cool thing I mean you can you can kind of tell but the plots that are like further away from being the closest I guess the closest ones are totally filled right they have a solid alpha and the ones that are further back have a lesser alpha and so and then as you move it that starts changing so it kind of gives you a little more feeling of depth to the to the charts and we can kind of do the same thing that we've done before with the zooms and all that to kind of look at these plots and all of that kind of stuff otherwise everything pretty much remains the same so let's close out to this and what we can do though is we can scatter another bit here so like we can do a X 1 dot scatter and then do X 2 y 2 Z 2 and on that and we can do that and we can see there's kind of two bodies here but we don't see any difference but what we can do just like we can do with any of the scatter plots we can change the color so we could say C equals R and then C equals K and then we can even we can change some stuff so you can say like marker so right now the marker is an O like that so a comma marker oh but you can like we were talking about before you can make them whatever you want so we can make them stars for all that matters so now they're stars some are black the others are red that was a bad idea on my part my bad guys so let's do blue and red something a little more let's do green in red just something that's obvious difference sorry for the colorblind folks out there still can't really see much of a difference here we might want to make the marker size a little bigger but the other thing we new stars are just hard to see let's do like Oh again and Oh try it one more time there we go so those are easier to see so we'll stick with us anyway so this is kind of our way of being able to compare three dimensions and maybe see the difference between three dimensions of data here so anyways those are three dimensional scatter plots for you not really too much more to it it's a lot like a scatter plot only with another dimension so that's it for this tutorial if you have questions or comments please feel free to leave them below otherwise as oh it seems for watching thanks for all the support and subscriptions and until next tutorial
Original Description
Welcome to another 3D Matplotlib tutorial, covering how to graph a 3D scatter plot.
Graphing a 3D scatter plot is very similar to the typical scatter plot as well as the 3D wire_frame.
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: Python for Data
View skill →
🎓
Tutor Explanation
DeepCamp AI