Matplotlib Tutorial 15 – styles




[ad_1]

In this Matplotlib tutorial, we’re going to be talking about styles. With Matplotlib, we have styles which serve a very similar purpose to Matplotlib graphs as CSS (cascading style sheet) pages serve for HTML. As you can see up to this point, all of these changes we’re making to our graphs start to add up, and we only have one axis so far! We could use for loops to at least keep the amount of code down, but we can also make use of these styles with Matplotlib.

The idea of a style page is to write your customization to a style file, and then, to use those changes and apply them to your graph, all you do is import style and then use that specific style. This way, let’s say you are finding yourself always changing various elements of your graphs. Instead of having to write 25-200 lines of customization code per chart, you can just write it once to a style, and then load in that style and apply all of those changes in two lines! Let’s get started.

sample code: http://pythonprogramming.net
http://hkinsley.com
https://twitter.com/sentdex
http://sentdex.com
http://seaofbtc.com

Source


[ad_2]

Comment List

  • sentdex
    November 19, 2020

    Good old days before Seaborn….

  • sentdex
    November 19, 2020

    Omg this is gamechanger

  • sentdex
    November 19, 2020

    Sentdex you took my project data presentation from matlab to respectable in a day. When I graduate in a month and have some real money I will taking some swag off ya.

  • sentdex
    November 19, 2020

    This is a GREAT tutorial.

  • sentdex
    November 19, 2020

    Again, this my by wrongheaded hairsplitting. I think this video title should be "Matplotlib Tutorial 15 – Styles".

  • sentdex
    November 19, 2020

    I don't understand what's the use of underscores before and after in Python… !

  • sentdex
    November 19, 2020

    What version of matplotlib are you using?

Write a comment