3D Charts in Matplotlib for Python: Multiple datasets scatter plot
Skills:
AI Pair Programming60%
Key Takeaways
Creates 3D charts in Matplotlib for Python to compare multiple datasets
Full Transcript
what is up everybody welcome back to another map plot lib tutorial in the three dimensions um in this one we're just going to add a one more layer on top of this scatter plot just to show a little something cool that you can do with Scatter Plots and then also you'll see with like bar charts and stuff but Scatter Plots it's really fun because it's kind of um in addition to um machine learning um three three-dimensional plot definitely help machine learning because if you think about it um like I've said before in some of my other videos machine learning is really just machine classification and it also starts machine learning does with really machine teaching right you have to teach the machine how it ought to learn kind of like you know when you were in school you had to um be taught someone taught you study techniques right and so it's the same thing like we have to eventually teach the computer study tactics in order for it to actually do some machine learning so anyway um anyone who is interested in machine learning should definitely check out some other tutorials of mine there's also some really cool machine learning tutorials on YouTube um anyway continuing on um and I'll probably actually have some machine learning tutorials in the near future because the idea of it is very intriguing anyway continuing on um three-dimensional Scatter Plots are really useful for machine learning because some people will do it on a two-dimensional plane but the problem with a two dimensional plane is you have you know let's say you have a 20x 20 graph um you only have 400 positions that you can consider for example when you add another dimension well you're you're adding another freaking Dimension all right so if you were 20 by 20 and you added by 20 you're literally multiplying your um position possibilities by 20 otherwise known as basically moving from 400 optional positions to now 8,000 optional positions that you can consider for your categorization so it makes a huge difference when you can look at um maybe um a multi-dimensional array worth of data uh so it is beneficial but sometimes you know once you get a good algorithm down you can start doing that but sometimes it's useful for you to be able to visualize it so anyways enough chitchat let's do the 3D plotting of um well the addition to what we had so let's say we're going to do XS Ys Zs and now you might want to change um or you might want to add them right to what you're plotting but now you want to plot anything under this variable so like the way this would work though is you say you were doing machine learning it would be classifying stuff in the real time so anything that was classified under these specific parameters would be thrown into this array and then later you would you know publish it for yourself so you can see the results and see if your machine learning algorithm is doing a good job or not and so for this one we'll make these Scatter Plots blue and they're going to be Carrot Top denoted for little triangles basically so now let's just save that that's really the only change we needed to make and let's plot that and in fact it looks horrible what did we do wrong let's see oh I know what we did I meant to add uh negative signs to all this data so let me do that really quick really need to just add a negative sign to one of the pieces of data but that's okay we're this we've gone this far oops actually let's finish it off just like this there we go save let me make sure I closed it I just don't want to get in trouble with mat plot lib there we go all right let's do it again dang it's like still giving me this 3D what did we do wrong this time ah man okay XS Ys Zs man amateur anyways this is my first rodeo okay now that we've got him in fact it looks like it ought to be so for example actually this would be the an example of a failed machine learning algorithm that needs more work right because clearly if you look at this there are three groups this group this group and this group and only there's only one dividing line which would be here but anyway this just gives you the idea that you can have different groups and group Types on the same scatter plot and use that for classification it doesn't have to be for machine learning of course um but it can be hint hint anyway um just wanted to add that to the Arsenal of uh 3D plotting tutorials and that's going to conclude this uh pretty quick and short video it' be really short if I didn't Yak for so long anyway as always thanks for watching stay tuned to the next video and thank you for your support your subscriptions
Original Description
Link to the full playlist:
Sometimes people want to plot a scatter plot and compare different datasets to see if there is any similarities. Here, you are shown how to chart two sets of data and how to specifically mark them and color them differently.
The following sample code utilizes the Axes3D function of matplot3d in Matplotlib. We use two sample sets, each with their own X Y and Z data. From here, we use .scatter to plot them up, 'c' to reference color and 'marker' to reference the shape of the plot marker.
Sample code: http://pythonprogramming.net/3d-scatter-plot-customizing/
http://www.youtube.com/playlist?list=PLQVvvaa0QuDfpEcGUM6ogsbrlWtqpS5-1
Sentdex.com
Facebook.com/sentdex
Twitter.com/sentdex
How to generate interactive 3d scatterplots in Matplotlib and Python with multiple datasets.
Watch on YouTube ↗
(saves to browser)
Sign in to unlock AI tutor explanation · ⚡30
Playlist
Uploads from sentdex · sentdex · 48 of 60
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
▶
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 Pair Programming
View skill →Related AI Lessons
⚡
⚡
⚡
⚡
How to Maximize Codex Exec Command
Towards Data Science
AI Can Write Code. So Why Are People Still Learning It?
Medium · Python
Rethinking Developer Productivity In The Age Of AI-Native Engineering
Forbes Innovation
Lovable.dev Pricing Plans 2026: The Real Cost of Building AI Apps
Medium · AI
🎓
Tutor Explanation
DeepCamp AI