Matplotlib Scatter Plots | Creating Scatter Plots with Python for Data Science and Geoscience

Поделиться
HTML-код
  • Опубликовано: 30 июл 2024
  • In this short video, we will see how to make a scatter plot of well log data using the python library called matplotlib.
    Scatter plots are excellent data visualization tools and can be used to identify relationships and correlations between variables.
    If you haven't already, make sure you subscribe to the channel: / @andymcdonald42
    If you have enjoyed this video and want to say thanks, feel free to buy me a coffee at the following link: buymeacoffee.com/andymcdonaldgeo
    Chapters:
    0:00 Introduction
    1:14 Jupyter Notebook Section
    1:23 Importing Libraries and Data
    3:34 Creating a Basic Scatter Plot
    4:41 Setting X-Axis and Y-Axis Limits
    5:37 Adding Labels to the Axes
    6:31 Adding a Third Variable for Colour
    7:06 Adding a Colorbar and Changing the Colormap
    9:01 Summary
    ----
    The notebook for this video can be found on my GitHub repository at: github.com/andymcdgeo/Andys_Y...
    Libraries used in this video:
    LASIO: lasio.readthedocs.io/en/latest/
    pandas: pandas.pydata.org
    matplotlib: matplotlib.org
    Equinor Volve Dataset: www.equinor.com/en/what-we-do...
    -----
    Thanks for watching, if you want to connect you can find me at the links below:
    / andymcdonaldgeo
    / geoandymcd
    / andymcdonaldgeo
    www.andymcdonald.scot/
    #welllogs #petrophysics #python #matplotlib #geoscience
  • НаукаНаука

Комментарии • 24

  • @kuldipdhokiya7733
    @kuldipdhokiya7733 2 года назад +2

    one of the best yt channel for petroleum students

  • @azwanone2669
    @azwanone2669 Год назад

    absolutely enjoy these videos! thanks for sharing!

  • @SweetPeachannel
    @SweetPeachannel Год назад +2

    Please share the video about the explanation reading the scatter plot and pairplot, because I still confuse how to read the plot, the correlation and relationships for each dot!

  • @faizalimuhammadzoda4731
    @faizalimuhammadzoda4731 2 года назад

    Thanks for such a clear exaplanation. Keep up the good work.

  • @davidlimamorales1153
    @davidlimamorales1153 2 года назад

    I really appreciate what you are doing, i was thinking how to aproach oil engineering to data visualization and also ML models, you make it easier, and interesting. Thank you!!!

  • @hichemsevran
    @hichemsevran 3 года назад +1

    Thank you so much for makinf this videos available, Can't wait for the fourth Tutorial for displaying Core data, there's codes that i didn't understand much especially the polyfit code line, I think it's M.L.

    • @AndyMcDonald42
      @AndyMcDonald42  3 года назад +2

      You are welcome! I will be covering that one in a future video.

    • @hichemsevran
      @hichemsevran 3 года назад

      @@AndyMcDonald42 and I will stay tuned for it, Have a nice day, sir. 😊

  • @petroali6412
    @petroali6412 3 года назад +1

    Hi sir,
    I know you , you are working in Lloyd's Register. I really enjoyed your papers. you are best sir . keep it up ... sir

    • @AndyMcDonald42
      @AndyMcDonald42  3 года назад +1

      Thank you petro Ali, I am glad you enjoyed the video and the papers.

  • @kamimassi706
    @kamimassi706 3 месяца назад

    thanks for the video
    please how can I get the Scatter Plots for two (y) axes
    Thank you for your time

  • @karendiaz5540
    @karendiaz5540 2 года назад

    Thanks for this video. It’s possible to built the Gamma Ray bar custom colours instead of picking the rainbow? For example make low GR values in yellow and high brown?

    • @AndyMcDonald42
      @AndyMcDonald42  2 года назад +1

      Hi Karen, you certainly can make your own colourmaps. I can cover that in a future video if it is of interest? But in the meantime, I would recommend using the existing "YlOrBr" colour map, which is one I have used numerous times for the GR shading. You can find a full list here: matplotlib.org/2.0.2/examples/color/colormaps_reference.html
      For a custom map, you could use:
      import matplotlib
      cmap = matplotlib.colors.LinearSegmentedColormap.from_list("", ["yellow","orange","brown"])

  • @sebastianmartinez2751
    @sebastianmartinez2751 2 года назад

    great!!

  • @boi_ratie
    @boi_ratie 2 года назад +1

    Good Day Sir, I have a csv file and am wondering how do I save it as a LAS file, since i see you read a LAS file as your data input.

    • @AndyMcDonald42
      @AndyMcDonald42  2 года назад

      This should be possible, but it will require a little bit of manual work. I would recommend having a look at the documentation on building a LAS file from scratch at the link below. It may be possible to do it from a pandas dataframe, but you should be able to do it from a numpy array as per the example.
      I will add this onto my list of videos to make as this would be a good topic to cover.
      lasio.readthedocs.io/en/latest/building.html

  • @sadockjosephat1896
    @sadockjosephat1896 2 года назад

    Thanks for this. I was wondering how to change the shapes if you have many symbols.

    • @sadockjosephat1896
      @sadockjosephat1896 2 года назад

      If anyone knows kindly assist

    • @AndyMcDonald42
      @AndyMcDonald42  2 года назад

      Symbols can be changed using the marker argument in plt.scatter
      If you want to change the marker based on a category, you could follow the suggestion here: stackoverflow.com/questions/44802561/python-plot-scatter-plot-with-category-and-markersize
      It involves a bit more code and looping through the categories after you have applied groupby to the dataframe.