Matplotlib Cheat Sheet Python For Data Science: Plotting Cutomize Plot Plotting Routines
Matplotlib Cheat Sheet Python For Data Science: Plotting Cutomize Plot Plotting Routines
Matplotlib Cheat Sheet Python For Data Science: Plotting Cutomize Plot Plotting Routines
>>> ax.scatter(x,y,marker=".")
>>> ax.plot(x,y,marker="o")
>>> y = np.cos(x)
>>> axes[0,1].streamplot(X,Y,U,V) #Plot a 2D field of arrows style='italic')
xy=(8, 0),
textcoords='data',
>>> U = -1 - X**2 + Y
Mathtext
>>> V = 1 + X - Y**2
>>>
>>>
from matplotlib.cbook import get_sample_data
img = np.load(get_sample_data('axes_grid/bivariate_normal.npy')) > Plot Anatomy & Workflow >>> plt.title(r'$sigma_i=15$', fontsize=20)
Legends
>>> fig = plt.figure()
>>> ax.set(title='An Example Axes', #Set a title and x-and y-axis labels
xlabel='X-Axis')
>>> fig.add_axes()
>>> x = [1,2,3,4] #Step 1
direction='inout',
>>> ax.scatter([2,4,6],
>>> fig3.subplots_adjust(wspace=0.5, #Adjust the spacing between subplots
[5,15,25],
hspace=0.3,
left=0.125,
marker='^')
right=0.9,
>>> ax1.spines['top'].set_visible(False) #Make the top axis line for a plot invisible
> Show Plot > Close and Clear >>> ax1.spines['bottom'].set_position(('outward',10)) #Move the bottom axis line outward
>>> plt.show()
>>> plt.clf() #Clear the entire figure