Skip to main content
Brave Programmer Logo

BraveProgrammer

BraveProgrammer

HomeProjectsBlogsCoursesLessonsAbout

Site footer

BraveProgrammer

Free coding courses, practical tutorials, and real projects from BraveProgrammer. Learn web development with React, Next.js, and TypeScript.

Navigation

  • Home
  • Projects
  • Blogs
  • Courses

Resources

  • About
  • Lessons
  • Teach on BraveProgrammer

© 2026 BraveProgrammer. All rights reserved.

Customizing Plots: S | Master Data Science with Python lesso | BraveProgrammer
  1. Courses
  2. /
  3. Master Data Science with Python

Lesson 33 of 60

·python

Customizing Plots: Styles, Labels, Legends, and Themes

20 minutes

Course progress55%

Customizing Your Visuals

A polished plot conveys information more effectively.

Changing style globally

plt.style.use('seaborn-darkgrid')   # or 'ggplot', 'fivethirtyeight'

Adding titles and axis labels

plt.plot(x, y)
plt.title('My Fancy Plot', fontsize=14, fontweight=)
plt.xlabel(, fontsize=)
plt.ylabel(, fontsize=)
'bold'
'X‑axis label'
12
'Y‑axis label'
12

Adding a legend

plt.plot(x, y, label='Series 1')
plt.plot(x, y2, label='Series 2')
plt.legend(loc='upper left', fontsize=10, frameon=True)

Customizing ticks

plt.xticks(ticks=[0, 0.5, 1.0], labels=['Zero', 'Half', 'One'])
plt.yticks(rotation=45)

Adding annotations

plt.annotate('Peak', xy=(2, 9), xytext=(3, 12),
             arrowprops=dict(facecolor='black', shrink=0.05))

Using a color map for continuous data

plt.scatter(x, y, c=y, cmap='viridis')
plt.colorbar(label='Intensity')

Exporting at high resolution

plt.savefig('my_plot.pdf', format='pdf', dpi=300)

Info

Consistency matters – pick a style and stick with it across all figures for a professional look.
Make it stickPractice what you've learned1 quiz · 4 practical tests · Optional activities from Master Data Science with PythonBrowse activities
Previous lessonLine, Scatter, and Bar ChartsContinue to lesson 34Subplots, Grids, and LayoutsBack to Master Data Science with Python curriculum