In [1]:
%matplotlib inline
from pylab import *
In [34]:
xv = [1,2,3,4]; yv = [5,1,4,0]
In [3]:
plot(xv,yv)
Out[3]:
In [4]:
plot(xv,yv,'ro')
Out[4]:
In [7]:
myplot = plot(xv,yv,'k--')
setp(myplot, linewidth = 3.0, marker = '+', markersize = 30)
Out[7]:
In [8]:
axis ([0.5,4.5,-0.5,5.5])
Out[8]:
In [9]:
ti = title('my own title')
xl = xlabel('time'); yl = ylabel ('values')
setp(xl, fontweight='bold')
Out[9]:
In [10]:
savefig('foo.ps', dpi=600, format='ps', orientation='landscape')
In [11]:
savefig('foo.ps', dpi=600, format='pdf', orientation='landscape')
In [31]:
myfig = gcf()
close(myfig)
In [32]:
close('all')
In [35]:
fig2 = figure()
subplot(2,1,1)
plot(xv, yv, 'b-')
subplot(2,1,2)
plot(yv, xv, 'ro')
Out[35]:
In [24]:
close(fig2)
In [36]:
fig2= figure(figsize=(10,10))
subplot(2,1,1)
plot(xv, yv, 'b-')
subplot(2,1,2)
plot(yv, xv, 'ro')
Out[36]:
In [18]:
xv = np.arange(-10,10.5,0.5); xv
Out[18]:
In [21]:
plot(xv, 2*xv**3-5*xv**2+7*xv)
plot(xv, 2000*cos(xv), 'r--')
text(-9.5,-2800,'curve A')
text(3,1500,'curve B')
Out[21]:
In [27]:
close('all'); xv_lin=np.arange(-3,3.01,0.02)
xv = 10**xv_lin
semilogx(xv, exp(-xv/0.01)+0.5*exp(-xv/10)+0.2*exp(-xv/200))
Out[27]:
In [28]:
semilogx(xv, exp(-xv/0.01)+0.5*exp(-xv/10)+0.2*exp(-xv/200))
grid(color='k')
In [29]:
semilogy(xv, exp(-xv/0.01)+0.5*exp(-xv/10)+0.2*exp(-xv/200))
Out[29]:
In [41]:
close('all')
xv = [0.5,1.5,2.5,3.5]; yv=[2,5,1,6]
mybar = bar(xv, yv, width=1, yerr=0.5, color='y')
In [43]:
xv = [0.5,1.5,2.5,3.5]; yv=[2,5,1,6]
mybar = bar(range(4), yv, width=1, yerr=0.5, color='g')
In [45]:
mybar = bar(xv, yv, width=1, yerr=0.5)
xticks(range(1,5), ['A', 'B', 'C', 'D'])
setp(mybar, color='r', edgecolor='k')
Out[45]:
In [46]:
close('all')
In [51]:
close('all')
figure(figsize=(5,5))
handles = pie([1,2,3,4], explode=[0.2,0,0,0], shadow=True, labels = ['A', 'B', 'C', 'D'])
handles
# handles[0] [2] --> 3. Text
Out[51]:
In [54]:
figure(figsize=(5,5))
handles = pie([1,2,3,4], explode=[0.2,0,0,0], shadow=True, labels = ['A', 'B', 'C', 'D'])
setp(handles[0] [0], color='y')
setp(handles[1] [0], text='lila Stueck')
Out[54]:
In [57]:
from mpl_toolkits.mplot3d import Axes3D
In [58]:
%matplotlib
In [61]:
close('all')
fig=figure(); ax=Axes3D(fig)
In [ ]: