Matplotlib

matplot_hist_scatter_box_plot

Examples

# choosing line with & color & label
plt.plot(X, Y, color="red", linewidth=2.5, linestyle="-", label="sine")

# choosing color and intensity
plt.plot (X, Y, color='blue', alpha=1.00)

# set legend loction & remove outer frame
plt.legend(loc='upper left', frameon=False)

# setting tics for an axis
plt.yticks([-1, 0, +1])

# intutive ticks for a axis
# note: we are setting limits not ticks**
plt.xlim(X.min()*1.1, X.max()*1.1)

# setting plot size and back-ground color
fig = plt.figure(figsize=(6,6), facecolor='white')

plt.figure attributes

Argument Default Description
num 1 number of figure
figsize figure.figsize figure size in in inches (width, height)
dpi figure.dpi resolution in dots per inch
facecolor figure.facecolor color of the drawing background
edgecolor figure.edgecolor color of edge around the drawing background
frameon True draw figure frame or not

Reference for

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s