17. Python to make nice figures. Part III: advanced plots

Sdílet
Vložit
  • čas přidán 4. 07. 2024
  • This is part 3 in a 3-part series on making beautiful scientific figures in python. In this video, I will cover some advanced scientific plots in python.
    Check out part 1 and part 2 if you haven't yet. Part 1: • 15. Python to make nic... Part 2: • 16. Python to make nic... All the files and scripts for these plots are available on the github github.com/sp8rks/MSE2001pyth...
    00:00 Generic advanced plot
    First, we cover the generic python script for making a nice figure.link: github.com/sp8rks/MSE2001pyth...
    6:45 stacked plots with fill between
    Next, we cover stacked plots with fill_between data setslink: github.com/sp8rks/MSE2001pyth...
    11:51 multipanel plots
    Next, we cover multipanel plots link: github.com/sp8rks/MSE2001pyth...
    23:29 heatmaps
    Next, we cover heatmaps using the seaborn library with 2D plots of the end memberslink: github.com/sp8rks/MSE2001pyth...
    37:24 multiple axes plots
    Next, we cover figures with multiple axes link: github.com/sp8rks/MSE2001pyth...
    44:32 Rietveld refinement diffraction plots
    Next, we cover Rietveld refinement diffraction plotslink: github.com/sp8rks/MSE2001pyth...
    51:24 3D plots
    Finally, we cover 3D plots with contour, surface, and scatter plotslink: github.com/sp8rks/MSE2001pyth...
  • Hry

Komentáře • 38

  • @maravasthimartinez2380
    @maravasthimartinez2380 Před 3 lety +8

    From zero to be able to perform nice figures on python, thanks to you. Continue like this!!

    • @TaylorSparks
      @TaylorSparks  Před 3 lety +2

      It's my pleasure! What else would be helpful??

    • @PaoloCondo
      @PaoloCondo Před rokem +1

      @@TaylorSparks I think a video going through a complex big data managing task, together with representing it in 3D, would be very very useful for us. Perhaps with some complex numpy and pandas functions in it. I would definitely pay for that! Hehe

  • @electron46
    @electron46 Před 5 měsíci +1

    My sincere compliments on your superb video. Lots of helpful coding tips to move programmers to a higher level, plus no annoying background music.

  • @chengmei2504
    @chengmei2504 Před 2 lety +1

    Excellent work!

  • @kang-chingfan9748
    @kang-chingfan9748 Před rokem +1

    Super helpful tips! Love it

  • @PaoloCondo
    @PaoloCondo Před rokem +1

    Thank you for these very useful videos!

  • @surya-td4dg
    @surya-td4dg Před 3 lety

    So helpful for people who want to switch from R to Python. Awsome.
    It would be really helpful if you have some time someday to make a video for common statistical tests: Two tailed unpaired or paired t test, mann-whitney, wilcoxon test, anova test, repeated measures anova ?

  • @NavidExperiences
    @NavidExperiences Před 3 lety +1

    thank you Taylor! these 3 videos were super useful for me

  • @nachovilla8051
    @nachovilla8051 Před 3 lety +4

    Excellent tutorial. Thank you so much.

  • @WildRover1964
    @WildRover1964 Před 5 měsíci +1

    jeez I'm only a third of the way through and already learnt lots of new meaty goodness. I love that iloc trick about returning every nth value (I can't even find that in the documentation). And the gridspec is new to me as are the text() methods on graphs. And also getting the colours out of SNS palettes.
    I've dipped my toes into seaborn and others but I don't really like over fancy graphs and I feel it's important to get fluent with the basics - matplotlib - before going mad with plotly and dash
    Look forward to watching the rest

    • @TaylorSparks
      @TaylorSparks  Před 5 měsíci +1

      Heck yeah. Start cranking out some beauties!

  • @saranshamohanty3207
    @saranshamohanty3207 Před rokem +1

    You are great !! Many thanks.

  • @gggggggggggg31
    @gggggggggggg31 Před 2 lety +1

    Great video! Fantastic resource

  • @LOL-vt8jh
    @LOL-vt8jh Před 3 lety +1

    Very nice video. Thank you so much!

  • @braydenhalvorson8030
    @braydenhalvorson8030 Před 2 lety

    Could you make a volume plot to add a dimension to the surface plot? For example if you wanted to show how 3 input varibles make an output.

  • @uselessmail531
    @uselessmail531 Před 2 lety +1

    Thanks for the amazing series on plotting!
    The following 2 lines address the issue mentioned at 43:53
    twin1.spines["right"].set_edgecolor(p2.get_color())
    twin2.spines["right"].set_edgecolor(p3.get_color())

    • @TaylorSparks
      @TaylorSparks  Před 2 lety

      oh my gosh. That saved me so much pain!! You are the best. Thanks for the tip and thanks for watching!

    • @TaylorSparks
      @TaylorSparks  Před 2 lety

      one slight fix to make it work with my code
      par1.spines["right"].set_edgecolor(p2.get_color())
      par2.spines["right"].set_edgecolor(p3.get_color())
      I've updated the github files for this code to reflect this helpful change. Thanks again!

  • @Naresh_Patra
    @Naresh_Patra Před 2 lety

    Can you please plot the different range with percentage graph? For eg. You can see tidal deformation plot in neutron star merger

  • @Robert-bw6jk
    @Robert-bw6jk Před 2 lety

    Cool tutorial!
    Though I fail to see any difference in your heatmap with a heat map directly on df.loc[504:4066,'y1':]**(1/1e5)
    I also fail to see any reason to separate the variables. x1, y1 to y21
    but maybe I'm missing something ?
    You can rename the columns by
    pressure[:0] = df.columns[0] # prepends the column name 'Q' to pressure list
    df.columns = pressure
    if one really wanted to fix the data to more tidy format one can
    pd.melt(df, id_vars='Q',var_name='Pressure (GPa)', value_name= 'Intensity')

  • @buckfever15
    @buckfever15 Před 3 lety +3

    Full steam ahead on the python lectures, i may have to cite you on my research paper lol

  • @bencherifmokhtar1429
    @bencherifmokhtar1429 Před 5 měsíci

    Hello Taylor, i would like to know if there is a way to smoothen the aspect of the surface plot instead of getting a mesh like surface ? I am working on a hardness cartography and i dont have a lot of data points so i need the figure to be smoother in a way we can get a nice extrapolated colors between the points. thank you in advance

  • @mohemmedbakhiet8905
    @mohemmedbakhiet8905 Před 2 lety

    Thanks a lot for the nice videos. I wonder about how to merge additional axes in contour plots as in the figure below?

  • @vanessaarangomarin5536
    @vanessaarangomarin5536 Před 2 lety +1

    Great video thank u!!!!! Maybe would be nice to have ternary diagram with heatmapping or contour :)

  • @mandregomes
    @mandregomes Před 2 lety

    Nive video. Do you how to produce similar plots using a vtk file with fem calculix results from freecad as a source? Could you point me in some website with info about this?

  • @ferchofs2110
    @ferchofs2110 Před rokem +1

    I need to admit once more that you are one the greatest people I've ever known (at least virtually) on this earth. Thank God bring so lovely and dedicated people like you to share their knowledge in a way that is so easy and exciting to learn. I really find a role model in you and the way how you teach. In November, I got a position to start my Ph.D. in Germany on a topic related to Ceramics (Mxenes and 3d printing) and two of the reasons why I decided to do it were my passion for teaching ( I wish I could someday teach as nice as you do) and the great world of materials helped by informatics just waiting for us.
    Thank you so much again, amigo Taylor from another human being just following his passion and finding incredible (virtual) mentors like you.
    post data. I just started to see the list of videos about ceramics, unfortunately, some of them are "hidden" on CZcams. It would be more than great if there would be a form to have access to them. I also understand if it is not possible.
    Gracias por todo y mucho éxito en Inglaterra!
    I add my email if it is possible to send me the links for the YT ceramic videos :D! fernando.floressuarez@student.uni-augsburg.de

    • @TaylorSparks
      @TaylorSparks  Před rokem

      Thank you so so much for the kind words! I actually started making CZcams videos when I was teaching my ceramics course. I was pretty new to it and the quality and completeness isnt quite great. I plan on redoing them at some point so they are higher quality