Skip to content
Snippets Groups Projects
Commit 0eb2f852 authored by Julian Lenz's avatar Julian Lenz
Browse files

More LaTeX compatibility of printPar

parent 775b47b5
No related branches found
No related tags found
No related merge requests found
......@@ -183,8 +183,11 @@ def getMask(x,xlim,y,ylim,z,zlim,allDifferent=False):
else:
return xmask*ymask*zmask
def printPar(p,pe,names=None,title='',d=2):
def printPar(p,pe,names=None,title='',d=2,forTex=False):
check=False
pm='+/-'
if forTex:
pm=r'\pm'
if np.shape(pe)==(len(p),len(p)):
pe=np.sqrt(np.diag(pe))
if title!='':
......@@ -195,7 +198,7 @@ def printPar(p,pe,names=None,title='',d=2):
print('Warning: len(names) =',len(names),', but len(p) =',len(p))
else:
for i,par in enumerate(p):
print('{1} = {2}+/-{3} in perc.: {0:.2g}%'.format(np.abs(pe[i]/par)*100,names[i],*uNumStr(par,pe[i],d=d)))
print('{1} = {2}{pm}{3} in perc.: {0:.2g}%'.format(np.abs(pe[i]/par)*100,names[i],*uNumStr(par,pe[i],d=d),pm=pm))
print()
check=True
if not check:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment