0% found this document useful (0 votes)
60 views1 page

Matplotlib Cheat Sheet for Class 12 IP

This document is a cheat sheet for Matplotlib, providing essential commands for creating various types of graphs such as line graphs, bar charts, histograms, and pie charts. It includes information on customizing line styles, marker styles, and color codes. The cheat sheet serves as a quick reference for Class 12 IP students using Matplotlib for data visualization.

Uploaded by

sandeepgurusivam
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
60 views1 page

Matplotlib Cheat Sheet for Class 12 IP

This document is a cheat sheet for Matplotlib, providing essential commands for creating various types of graphs such as line graphs, bar charts, histograms, and pie charts. It includes information on customizing line styles, marker styles, and color codes. The cheat sheet serves as a quick reference for Class 12 IP students using Matplotlib for data visualization.

Uploaded by

sandeepgurusivam
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Matplotlib Cheat Sheet (Class 12 IP)

Code Meaning
[Link](x,y) Draws a line graph between x and y
[Link]('Name') Adds a title to the graph
[Link]('X-axis') Labels the X-axis
[Link]('Y-axis') Labels the Y-axis
[Link]([1,2,3],['A','B','C']) Custom ticks/labels on X-axis
[Link]([10,20,30]) Sets Y-axis ticks (scale values)
[Link](x,y) Vertical bar chart
[Link](x,y) Horizontal bar chart
[Link](data,bins=5) Histogram with 5 intervals
[Link](sizes,labels=names) Pie chart with labels
[Link](True) Shows grid lines
[Link]() Displays legend (labels of plots)
[Link](r,c,n) Multiple plots (row, col, number)
[Link]() Displays the final graph

Line Styles Meaning


linestyle='-' Solid line (default)
linestyle='--' Dashed line
linestyle=':' Dotted line
linestyle='-.' Dash-dot line

Marker Styles Meaning


marker='o' Circle marker
marker='s' Square marker
marker='^' Triangle marker
marker='*' Star marker
marker='d' Diamond marker

Color Codes Meaning


color='r' Red
color='g' Green
color='b' Blue
color='k' Black
color='y' Yellow

You might also like