File:Takagiglyph.png

From specialfunctionswiki
Jump to: navigation, search
Takagiglyph.png(186 × 192 pixels, file size: 6 KB, MIME type: image/png)
#!/usr/bin/python
import numpy as np
import matplotlib.pyplot as plt
from mpmath import *
from pylab import rcParams
rcParams['figure.figsize'] = 2.4,2.4

def distfnc(x):
        return min(x-floor(x),ceil(x)-x)

def takagi(x):
        return nsum(lambda k: distfnc((2.0**k)*x)/(2**k),[0,inf])

x=np.arange(0,1,0.01)
f=np.vectorize(takagi)
y=f(x)

def g(x):
        return 0
h=np.vectorize(g)
y2=h(x)

fig, ax = plt.subplots()

ax.spines['right'].set_color('none')
ax.spines['top'].set_color('none')
plt.tick_params(axis='x', which='both', bottom='off', top='off', labelbottom='off')
plt.tick_params(axis='y', which='both', left='off', right='off', labelleft='off')

plt.plot(x,y,linewidth=5,color='Black')
plt.plot(x,y2,linewidth=1,color='Black')
plt.plot(y2,x,linewidth=1,color='Black')
plt.xlim(0,1)
plt.ylim(0,0.7)

plt.savefig('takagiglyph.png',bbox_inches='tight',pad_inches=0.0)

File history

Click on a date/time to view the file as it appeared at that time.

Date/TimeThumbnailDimensionsUserComment
current03:07, 6 July 2016Thumbnail for version as of 03:07, 6 July 2016186 × 192 (6 KB)Tom (talk | contribs)Category:takagiglyph <pre>#!/usr/bin/python import numpy as np import matplotlib.pyplot as plt from mpmath import * from pylab import rcParams rcParams['figure.figsize'] = 2.4,2.4 def distfnc(x): return min(x-floor(x),ceil(x)-x) def takag...
  • You cannot overwrite this file.

There are no pages that link to this file.

Metadata