real output
This commit is contained in:
parent
3513754647
commit
b78c809375
|
@ -242,11 +242,16 @@ class Colormap(mpl.colors.ListedColormap):
|
||||||
print(s)
|
print(s)
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def _export_gmsh(colormap,fname=None):
|
def _export_gmsh(colormap,fhandle=None):
|
||||||
colors = colormap.colors
|
colormap = 'View.ColorTable = {\n'\
|
||||||
colormap =('View.ColorTable = {'
|
+'\n'.join([f'{c[0]},{c[1]},{c[2]},' for c in reversed(colormap.colors)])\
|
||||||
',\n'.join(['{%s}'%(','.join([str(x*255.0) for x in color])) for color in colors])+\
|
+'}'
|
||||||
'}')
|
if fhandle is None:
|
||||||
|
with open(colormap.name.replace(' ','_')+'.txt', 'w') as f:
|
||||||
|
t.to_ASCII(f)
|
||||||
|
else:
|
||||||
|
t.to_ASCII(fhandle)
|
||||||
|
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def _interpolate_msh(frac,low,high):
|
def _interpolate_msh(frac,low,high):
|
||||||
|
|
Loading…
Reference in New Issue