[go: up one dir, main page]

0% found this document useful (0 votes)
13 views3 pages

All Func Matplotlib

Matplotlib's pyplot module (plt) provides a wide range of functions for data visualization in Python, categorized into core plotting, figure management, customization, drawing shapes, display, and additional functionalities. Key functions include plot types like line, scatter, and bar charts, as well as tools for managing figures and axes, customizing labels and titles, and saving figures. This overview serves as a reference for commonly used plt functions to facilitate interactive data visualization.

Uploaded by

isha
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)
13 views3 pages

All Func Matplotlib

Matplotlib's pyplot module (plt) provides a wide range of functions for data visualization in Python, categorized into core plotting, figure management, customization, drawing shapes, display, and additional functionalities. Key functions include plot types like line, scatter, and bar charts, as well as tools for managing figures and axes, customizing labels and titles, and saving figures. This overview serves as a reference for commonly used plt functions to facilitate interactive data visualization.

Uploaded by

isha
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
You are on page 1/ 3

All plt.

Functions in Matplotlib

matplotlib.pyplot (commonly imported as plt) offers a comprehensive set of plotting and utility
functions for interactive data visualization in Python. Below is an organized overview of the most
commonly used plt. functions grouped by category. This covers core plotting, figure management,
labels, and customization methods.

CORE PLOTTING FUNCTIONS


FUNCTION DESCRIPTION
plot() Line plot

scatter() Scatter plot (x, y points)

bar() Vertical bar chart

barh() Horizontal bar chart

hist() Histogram

boxplot() Box and whisker plot

pie() Pie chart

stem() Stem plot

fill() Filled polygons

fill_between() Fill area between curves

errorbar() Plot data with error bars

stackplot() Stacked area plots

step() Step plot

imshow() Display image data

contour() Contour plot

contourf() Filled contour plot

pcolormesh() Pseudocolor plot of 2D array

quiver() Field of arrows

barbs() Barbed arrows for vector fields

hexbin() Hexagonal binning plot


FIGURE AND AXES MANAGEMENT
Function Description
figure() Create new figure

subplots() Create figure and subplots (axes)

subplot() Add subplot to current figure

subplots_adjust()Adjust subplot parameters

clf() Clear current figure

cla() Clear current axes

close() Close a window

axes() Add or get axes from current figure

gcf() Get current figure

gca() Get current axes

CUSTOMIZATION & DECORATIONS


Function Description
title() Set plot title

xlabel() Set x-axis label

ylabel() Set y-axis label

legend() Display legend

xlim() Set x-axis limits

ylim() Set y-axis limits

xticks() Set x-axis tick locations/labels

yticks() Set y-axis tick locations/labels

grid() Show/Hide grid lines

text() Add text annotation

annotate() Annotate points with text/arrows

colorbar() Add colorbar to certain plots


DRAWING SHAPES AND LINES
Function Description
axhline() Add horizontal line across axes

axvline() Add vertical line across axes

axhspan() Add horizontal span (rectangle)

axvspan() Add vertical span (rectangle)

arrow() Add arrow to axes

DISPLAY, SAVE, OUTPUT


Function Description
show() Display the current figure

savefig() Save the current figure to a file

ADDITIONAL FUNCTIONALITIES
Function Description
subplot2grid() More flexible subplot layout

tight_layout() Automatically adjust subplot parameters

suptitle() Set centered title for figure with subplots

You might also like