, 0.5 ) n = 15 #n is the number of rays drawn in a cycle h = ( float ( arg ( fz )) + pi ) / ( 2 * pi ) #hue h = ( h - 0.5 ) % 1.0 Phc = PerFract ( h, 1.0 / n, 0.6, 1 ) # set brightness between 0.6 and 1, #in order to avoid too dark colors modul = fabs ( fz ) Logm = log ( modul ) s = 0.9 #saturation Modc = PerFract ( Logm, 2 * pi / n, 0.6, 1 ) v = Modc * Phc return hsv_to_rgb ( h, s, v ) plt. Plotting plot and cplot in mpmath can be used to plot functions respectively as x-y graphs and in the complex plane. The following people (among others) have contributed major patches or new features to mpmath: Pearu Peterson z, kwargs) Computes the Kelvin function ker, which for real arguments gives the real part of the (rescaled) Bessel K function of a rotated. Until I've figured out the details, I'll share a couple of test plots. ln, file 'mpmathexample.png', points 1000) Weighted Scatter Plots. bei (n, z, kwargs) Computes the Kelvin function bei, which for real arguments gives the imaginary part of the Bessel J function of a rotated argument. Import matplotlib.pyplot as plt from mpmath import * from colorsys import hsv_to_rgb % matplotlib inline pi = 3.1415926535898 def PerFract ( x, t, m, M ): x = x / t return m + ( M - m ) * ( x - floor ( x )) def color_clines ( fz ): # this is the color function that replaces the #default color function implemented in mpmath.cplot if isinf ( fz ): return ( 0, 0, 1.0 ) #hsv code if isnan ( fz ): return ( 0. Mpmath is free software released under the New BSD License (see the LICENSE file for details) 0. There will probably be a 3D plot function in a future version of mpmath (or two functions for two-variable real, and complex functions), similar in style to the existing matplotlib wrappers plot and cplot.
0 Comments
Leave a Reply. |