In [1]:
import matplotlib.pyplot as plt
import numpy as np
x = np.linspace(0, 5, 11)
y = x ** 2
%matplotlib inline
In [35]:
fig = plt.figure()
ax = fig.add_axes([0,0,1,1])
ax.plot(x, y,"r")
#ax.plot(y, x,"g")
Out[35]:
In [37]:
fig = plt.figure(figsize=(7,4))
ax = fig.add_axes([0,0,1,1])
ax.plot(x, y,"r")
#ax.plot(y, x,"g")
Out[37]:
In [38]:
fig = plt.figure(figsize=(7,2))
ax = fig.add_axes([0,0,1,1])
ax.plot(x, y,"r")
#ax.plot(y, x,"g")
Out[38]:
In [39]:
fig, axes = plt.subplots()
axes.plot(x, y, 'r')
Out[39]:
In [40]:
fig, axes = plt.subplots(figsize=(12,3))
axes.plot(x, y, 'r')
Out[40]:
In [41]:
fig, axes = plt.subplots(2,1,figsize=(12,3))
axes[0].plot(x, y, 'r')
axes[1].plot(x, y, 'r')
Out[41]:
In [42]:
fig, axes = plt.subplots(2,1,figsize=(12,3))
axes[0].plot(x, y, 'r')
axes[1].plot(x, y, 'r')
plt.tight_layout()
In [47]:
fig, axes = plt.subplots(2,1,figsize=(12,3),dpi=100)
axes[0].plot(x, y, 'r')
axes[1].plot(x, y, 'r')
plt.tight_layout()
In [48]:
fig
Out[48]:
In [49]:
fig.savefig("ram4.png")
In [50]:
fig.savefig("ram5.png",dpi=77)
In [51]:
fig.savefig("rame33a.pdf")
No comments:
Post a Comment