import matplotlib,pylab, numpy as np from matplotlib.patches import FancyArrowPatch def circle(x,y,r): """ This function makes lines for a circle given center and radius""" t=np.linspace(0,2*np.pi) xv=x+r*np.cos(t) yv=y+r*np.sin(t) return xv,yv fig=pylab.figure() ## Actually make the set of tubes nR=2 nC=3 offset = 0.5 r=0.25 for i in range(nR): for j in range(nC): if j%2==0: x=j y=i else: x=j y=i+offset xv,yv=circle(x,y,r) pylab.plot(xv,yv,'b') pylab.gca().axis('equal') pylab.gca().axis('off') ##Dimension lines pylab.plot(np.r_[0,0],np.r_[1,2],'k') pylab.plot(np.r_[1,1],np.r_[1+offset,2],'k') pylab.text(0.5,2,'Longitudinal\nSpacing\n$p_l$',ha='center',va='center') pylab.plot(np.r_[-0.5,0],np.r_[1,1],'k') pylab.plot(np.r_[-0.5,0],np.r_[0,0],'k') pylab.text(-0.5,0.5,'Transverse\nSpacing\n$p_t$',ha='center',va='center') pylab.show()