In [2]:
import matplotlib.pyplot as plt
import numpy as np
x = np.linspace(0, 5, 11)
y = x ** 2
%matplotlib inline
In [29]:
fig = plt.figure()
ax = fig.add_axes([0,0,1,1])
ax.plot(x, y,"r")
ax.plot(y, x,"g")
#ax.legend()
Out[29]:
In [31]:
fig = plt.figure()
ax = fig.add_axes([0,0,1,1])
ax.plot(x, y,"g")
ax.plot(y, x,"r")
ax.legend()
Out[31]:
In [32]:
fig = plt.figure()
ax = fig.add_axes([0,0,1,1])
ax.plot(x, y,"g",label="x,y")
ax.plot(y, x,"r",label="y,x")
ax.legend()
Out[32]:
In [33]:
fig = plt.figure()
ax = fig.add_axes([0,0,1,1])
ax.plot(x, y,label="x,y")
ax.plot(y, x,label="y,x")
ax.legend(loc=4)
Out[33]:
In [34]:
fig = plt.figure()
ax = fig.add_axes([0,0,1,1])
ax.plot(x, y,label="x,y")
ax.plot(y, x,label="y,x")
ax.legend(loc=5)
Out[34]:
In [36]:
fig = plt.figure()
ax = fig.add_axes([0,0,1,1])
ax.plot(x, y,label="x,y")
ax.plot(y, x,label="y,x")
ax.legend(loc=(0.4,0.2))
Out[36]:
In [37]:
fig = plt.figure()
ax = fig.add_axes([0,0,1,1])
ax.plot(x, x**2, label="x**2")
ax.plot(x, x**3, label="x**3")
ax.legend()
Out[37]:
No comments:
Post a Comment