We’ve now covered the most important and commonly used concepts that data scientists use in their daily work. However, there are still a ton of options that Matplotlib provides that we don’t use often, but are still helpful to know. And don’t forget that you can always explore the official documentation for more resources!

We’ll have a look at a few of these advanced plotting concepts in this section.

Note: There’s no need to memorize the code. Once you know what type of plot you are looking for to plot your data, you can always refer to this lesson to copy the code and make changes according to your requirements.

Customized ticks and their labels

Ticks are the values that indicate specific points along the coordinate axes. When we plot a graph, default ticks are created. However, we can set custom ticks using set_xticks and set_yticks. Both take a list of values that specify where on the axis we want the ticks to be placed.

The set_xticklabels and set_yticklabels methods can be used to set custom labels for each tick location.

Get hands-on with 1400+ tech skills courses.