Matplotlib Tutorial (2022): For Physicists, Engineers, and Mathematicians

Поділитися
Вставка
  • Опубліковано 27 вер 2024
  • Check out my course on UDEMY: learn the skills you need for coding in STEM:
    www.udemy.com/...
    This from-scratch tutorial on Matplotlib is designed specifically for those studying physics, mathematics, and engineering. Before watching this, you may want to brush up on numpy:
    • NumPy Tutorial (2022):...
    All code can be found here:
    github.com/luk...
    Join the discord server!
    / discord

КОМЕНТАРІ • 108

  • @raviroy7882
    @raviroy7882 2 роки тому +58

    This is quite possibly one of the best channels I have come across to learn Python from Physics POV. I only regret why I didn't find it sooner. Please continue your good work. A lot of thanks to you. (Never have I subscribed to a channel this quickly)

    • @ApteraEV2024
      @ApteraEV2024 11 місяців тому

      Is there a Dark Mode??❤

  • @abhishekjoshi8413
    @abhishekjoshi8413 3 роки тому +42

    man i really appreciate you doing this, i can cannot overemphasize like how the right the timing of me finding the channel and you uploading the video, great work keep them coming

  • @viniciuscerqueirasilva9396
    @viniciuscerqueirasilva9396 2 роки тому +68

    Timestamps:
    00:00 Introduction
    00:50 Making Plots Actually Look Nice
    01:17 Quick Plotting: Line Plots
    09:10 Quick Plotting: Histograms
    12:27 A More Advanced API: Single Axes in one Figure
    14:15 A More Advanced API: Multiple axes in 1 figure
    18:41 Example
    27:00 2D Plots: Filled-in contour plots
    30:33 2D Plots: Contour Plot
    32:12 2D Plots: 3D Surface Plot
    33:40 2D Plots: StreamPlots
    37:55 Image Reading
    38:23 Animations

  • @matthewkinahan3945
    @matthewkinahan3945 3 роки тому +11

    Dedication! my mans is uploading while biking

    • @jhawar-ji
      @jhawar-ji 3 роки тому +1

      You were biking along with him?👀

    • @matthewkinahan3945
      @matthewkinahan3945 3 роки тому +2

      @@jhawar-ji nah I bailed on the biking part of the trip

  • @Dofoos
    @Dofoos 3 роки тому +10

    THANK YOU! I’ve been trying to quickly learn matplotlib these past few days to finish up a lab report for my internship you have no idea how beautiful your timing is

  • @unmeshduttachowdhury
    @unmeshduttachowdhury 3 роки тому +3

    The science style really overcomes a lot of pain in matplotplib. Thank you again

  • @BijouBakson
    @BijouBakson 6 місяців тому

    He's put so much in such a small amount of time it took me around 6 hours to do every single exercise. He is going very fast, but you can pause, slow it down, etc. Helped me a lot.

  • @ameerbux78666
    @ameerbux78666 2 роки тому +2

    You're a life saver. The way you explain things is incredible, out of every single person I've watched, you're the best. Thank you for all the content!

  • @jhawar-ji
    @jhawar-ji 3 роки тому +9

    Tight layout for subplots should also have been included. That's always a plus one

  • @TheDavddd
    @TheDavddd 2 роки тому +1

    Sadly I've spent years of mindless copy pasting from stack overflow and then tweaking the parameters. this video finally made me understand what the hell I was doing :D

  • @Jack-hk6kl
    @Jack-hk6kl 2 роки тому

    Clear, concise, straight to the point and efficiently fast. You’re godsend bro

  • @Crilic3
    @Crilic3 Рік тому

    ANIMATION! YES!
    I can't believe it took me til end of semester to find a Numpy/Matplotlib animator!!

  • @niceday2015
    @niceday2015 3 роки тому +1

    Enjoy it very much, not only how to do it, but also how to think before plotting step by step.Thank you very much!

  • @AJ-et3vf
    @AJ-et3vf 3 роки тому +2

    Awesome man! This is highly useful. Your tutorials are really lucid and informative and makes learning Python enjoyable and fulfilling. I just finished watching this video, but I'll definitely reference this when I need to do things in Matplotlib that I haven't done before like histograms and animations. Highly appreciate the animation part here. You explain it well and make it simple and understandable. Big thanks!

  • @AAFX-OM
    @AAFX-OM 2 роки тому +3

    These are amazing lectures/tutorials. Really appreciating your time and great work!

  • @walkingphilosopher
    @walkingphilosopher 2 роки тому

    I wish I have more than 1 account to like this video at least 5 times. Its very useful. Thanks.

  • @akshaygiram
    @akshaygiram Рік тому

    Happy to find you! Hope to see you more!

  • @promas5911
    @promas5911 Місяць тому

    Absolutely beautiful work

  • @scienceaj2907
    @scienceaj2907 2 роки тому

    Simple, clear and concise. You are an amazing teacher!

  • @Icingde4th
    @Icingde4th 3 роки тому +4

    You're the GOAT

  • @zhoumin6927
    @zhoumin6927 2 роки тому

    Excellent and fluent! I can learn a lot from your channel, thanks!

  • @benhaenraets4369
    @benhaenraets4369 Рік тому

    One of the best vids out there. Subscribed and liked!

  • @sandeepmandrawadkar9133
    @sandeepmandrawadkar9133 2 роки тому

    That's great help to beginners as well as the expertise. Thanks for super simplifying the concepts.

  • @DeAngeloYouKnow
    @DeAngeloYouKnow 3 роки тому +1

    Wonderful video my man keep up the good work.

  • @jacksondienes7710
    @jacksondienes7710 Рік тому

    u seriously have the best vids mr.p

  • @Nooreazy
    @Nooreazy 2 роки тому

    This man is doing gods work.

  • @renegaed
    @renegaed 3 роки тому

    Your videos are the best on UA-cam on this topic. Please do more basics videos. I find it difficult to translate engineering problems to python without getting lost in the maths with multiple variables that can change. More info on standardising such problems to see how each variable will effect the result would be extremely useful.

  • @WalterUnglaub
    @WalterUnglaub Рік тому

    Thank you for doing all of this, it's incredibly insightful! Awesome tutorials!

  • @Slyracoon666
    @Slyracoon666 2 роки тому +9

    Just began my physics major and I’ve never used python before but your videos are really informative

  • @diegoalgo1296
    @diegoalgo1296 2 роки тому

    You're a legend my guy, thank you!

  • @doruk5493
    @doruk5493 2 роки тому

    Thank you for this vid bro. Please make a Seaborn or Plotly version of this.

  • @mayazhussain
    @mayazhussain 4 місяці тому +5

    I came to UA-cam to waste time not to learn something useful 😢

  • @dedperded
    @dedperded 4 місяці тому

    thats a gem!

  • @nikossioulas2067
    @nikossioulas2067 3 роки тому

    Awesome tutorial! Thank you!

  • @markkennedy9767
    @markkennedy9767 10 місяців тому

    Why is the method set_title() and set_label() for axes/subplots, yet title() and xlabel() etc for plots.
    You're doing the exact same thing (seemingly) yet the syntax has different words for these operations.
    It suggest to me that axes/subplots and plots are fundamentally different structures.

  • @hsh7677
    @hsh7677 3 роки тому +1

    Thank you
    Your content is awesome!!!

  • @Excalibur32
    @Excalibur32 3 роки тому

    Great crash course, thank you!

  • @frankrobert9199
    @frankrobert9199 Рік тому

    great. when you recotd to make it size bigger, it would be better. it is a little small to look.

  • @tlmoller
    @tlmoller 2 роки тому

    This is really good! Thanks a lot.

  • @madhavsirohi2225
    @madhavsirohi2225 Рік тому

    Thanks a lot needed this!

  • @danielarisamoraesesilva8485

    Great job man!

  • @Mateusz-rg4cd
    @Mateusz-rg4cd 2 місяці тому

    "science" style doesn't work acctually. What shoud I do? And how to install Latex package?

  • @imamkusnendar
    @imamkusnendar 2 роки тому

    Your channel Sir, absolutley worth million subscriber or even more. Many thanks.How can I contact you if any questions i wan to ask? any website or else? btw i have major in physics too. hehe

  • @nobody2937
    @nobody2937 2 роки тому

    Very impressive... Thank you so much...

  • @subhabratamondal1896
    @subhabratamondal1896 Рік тому

    Nice video.....please provide a code of how get the co ordinate values (x,y) of intersection points of two non linear curves in python. Plot visualization is also required in matplotlib. A lot of time it is needed in engineering calculation. Thank you.

  • @sergiolucas38
    @sergiolucas38 2 роки тому

    Great video, man, thank you :)

  • @walaceelias
    @walaceelias 4 місяці тому

    Can you make a video explain how to install scienceplots on jupyter notebook on this new version.

  • @Penguin-x4o
    @Penguin-x4o Рік тому

    Mr. P, may I ask how to install the Science Plots:?

  • @diegofernandez8881
    @diegofernandez8881 3 роки тому +1

    So much thanks

  • @archniki_
    @archniki_ Рік тому

    I'd there guide for artists musicians and so on?

  • @AnatolVZ
    @AnatolVZ 2 роки тому

    Superb content!!

  • @naftab526
    @naftab526 2 роки тому

    Thanks a lot BRO, the tutorial is very helpful to get an overall idea. Can anyone plz let me know how to get a MULTI-PANEL plot using data from a FILE? Thanks in advance.

  • @kanuchakraborty9190
    @kanuchakraborty9190 2 роки тому

    Please I request you to do a tutorial on Electromagnetic wave animation in 3d in matplotlib

  • @baghdadiabdellatif1581
    @baghdadiabdellatif1581 9 місяців тому

    Thank you

  • @hectorg.m.3350
    @hectorg.m.3350 Рік тому

    Hats off mate!!!

  • @1970mza
    @1970mza 29 днів тому

    I have a question regarding plotting on an image which has log log scale. As I apply log scale to x and y axes, the image gets distorted. Do you know how to keep the aspect ratio.

  • @mohammedbaraka2591
    @mohammedbaraka2591 2 роки тому

    Bro, thank you very much!
    I really enjoyed this tutorial!
    I want ask you about plotting high quality plots using this library for NASA cdf data!
    I use Pyspedas to analyse MMS spacecraft data but the plots is not that good!
    Many thanks!

  • @simawpalmer7721
    @simawpalmer7721 2 роки тому

    Thanks, but how to change the interpolation from linear to something like cubic or something else...

  • @fatemehlangari4921
    @fatemehlangari4921 2 роки тому

    Thank youuu. Do you have any idea about creating a semantic graph? (an unweighted undirected graph)

  • @CKPSchoolOfPhysics
    @CKPSchoolOfPhysics 2 роки тому

    How to get different view of 3D projected graphs? like side view , top view with and without animation?

  • @shivpratapsingh5766
    @shivpratapsingh5766 3 роки тому

    Thank you Good sir, thanks a lot

  • @adryanblack13
    @adryanblack13 2 роки тому

    Can you please tell me your educational background. You are quite intelligent

  • @pavankumarkv4920
    @pavankumarkv4920 3 роки тому

    Thanks man !.

  • @saidteacher3331
    @saidteacher3331 11 місяців тому

    Which college did you go to P.Solver? any recommendations -college choice- for some one who loves Physics and coding ?

  • @alonalon8794
    @alonalon8794 2 роки тому

    7:15
    x2 and x are of different dimensions. somehow it works for you..I got en error

  • @ravikumargariradhika7706
    @ravikumargariradhika7706 2 роки тому

    how to plot y=x|x| in python

  • @abdusalomxudoyberdiev7606
    @abdusalomxudoyberdiev7606 2 роки тому

    Hello. I‘m from Uzbekistan. I‘m student.
    Can you help me by in pyton

  • @noelzinn6801
    @noelzinn6801 2 роки тому +1

    How do I get your animation code (too fast to follow). Tks, Noel

    • @MrPSolver
      @MrPSolver  2 роки тому +1

      All code is in the description!

    • @noelzinn6801
      @noelzinn6801 2 роки тому

      @@MrPSolver Excellent. You're a remarkable find.

  • @aramisbirkhimer2506
    @aramisbirkhimer2506 Рік тому

    Does anyone know how you would modify the animation code to track the motion of the second mass with a solid line? I think it would show the chaos of the motion very well

  • @web3tel
    @web3tel 2 роки тому

    How one install SciencePlots, please? Is it "pip install SciencePlots" ?

  • @jorgeluismedina1548
    @jorgeluismedina1548 3 роки тому

    why does my plots look blurry in my notebook compared to yours? :(

    • @waqqiali2960
      @waqqiali2960 2 роки тому

      I think increasing dpi might help e.g. plt.figure(dpi=100)

  • @حيدرالعبيدي-ج4د
    @حيدرالعبيدي-ج4د 3 роки тому

    Hello..I am a PhD student in physics from Iraq..I hope you can help me find codes in the Python program to study the Fe(II)particle (ising model 2D)to determine the spin crossover of the electrons and find the energy..with many thanks to you.

  • @igorbrenno1459
    @igorbrenno1459 3 роки тому

    I love youuuu....

  • @borisandfef
    @borisandfef 3 роки тому

    What's the best way to import data from a csv file and manipulate it for plotting?

    • @joseftrojan7664
      @joseftrojan7664 3 роки тому +1

      Try using Pandas!

    • @borisandfef
      @borisandfef 3 роки тому

      @@joseftrojan7664 thank you so much! Worked perfectly.

  • @aliexpress.official
    @aliexpress.official 3 роки тому +1

    Fantastic video as always.
    The fact that python plotting doesnt have a GUI like in MATLAB is SO tiring.

    • @MrPSolver
      @MrPSolver  3 роки тому

      Absolutely. That being said, you kind of get used to it.

  • @sparshghimire2426
    @sparshghimire2426 3 роки тому

    First :)

  • @SubhodeepSarkar
    @SubhodeepSarkar 3 роки тому +5

    Great stuff as always, especially liked how you indexed the axes in the subplots. It's a really cool trick and I will be using it from now on!

  • @poxipollepi1
    @poxipollepi1 2 роки тому +1

    How can I use the same text font/style as in the fig.text() at 26:43? The \Delta E gets compiled in italic dejaVu Sans by default and when I try to wrap it in \mathrm{} it just removes the italic and it still doesn't look roman like in the video.

  • @JasleenKaur-hw2tf
    @JasleenKaur-hw2tf Рік тому +1

    The best tutorial videos! thank you!

  • @revathyn5468
    @revathyn5468 3 місяці тому

    If possible pls post videos for family of Curves and for fluid mechanics pls

  • @learnmore_today
    @learnmore_today 3 роки тому +1

    Could you please make a video on Petsc solver, how to install it and use it from A to Z showing a couple of matrix inversion examples. I will be very grateful. Thanks

    • @MrPSolver
      @MrPSolver  3 роки тому

      I'll take a look at it!

  • @rogerwilcoshirley2270
    @rogerwilcoshirley2270 2 роки тому +1

    Nicely done, i went thru set by step with you (lots of stop and go) programming and studying all your examples as yet another review of MatPlotLib, really very good practice. Only issues for me: could not access those additional styles you mention at beginning, perhaps you could offer more exact details on how to get them loaded/accessible. Also on my ipad can't zoom the video so your code was really tiny, i could read it but if you ever reduce the font it would no longer be legible.

  • @Achirona16
    @Achirona16 2 роки тому +1

    Great tutorial! I learnt a lot Thanks

  • @lukamodric5499
    @lukamodric5499 3 роки тому +1

    Men, thx for doing this

  • @alonsorodriguez5613
    @alonsorodriguez5613 2 роки тому

    Thank you for making this video. Terrific job.
    Is it possible to save the figures while keeping the Science Plots Format you declared at the beginning of your Jupyter notebook?

  • @uorabhishek
    @uorabhishek Рік тому

    Nice explanation. Needed exactly what you explained.Thanks for the informative video.

  • @AnatolVZ
    @AnatolVZ 2 роки тому

    Thank you for this tutorial!!!!! Very very usefull and simple for undersatanding!!!

  • @philippe6724
    @philippe6724 5 місяців тому

    Luke is such a great instructor: one can learn numerous concepts in no time!
    Thank you-)

  • @hadjkouidermohammed1958
    @hadjkouidermohammed1958 3 роки тому

    Thank you for the great video....can you help me to make appear some data values on the curve. thank you..

  • @samersalama
    @samersalama 2 роки тому

    Why this video in your python play list, it is not python !

  • @Demolin7
    @Demolin7 2 роки тому

    Your channel is amazing, it is incredibly hard to find this level of content even in paid courses. Thanks so much!

  • @rhliarng
    @rhliarng 2 роки тому

    Great tutorial!!

  • @rubayetalam8759
    @rubayetalam8759 3 роки тому

    hey! you need to work on your playlist. Everything is a mess! thanks tho.