def __init__(self, ndec=None, useOffset=True, useMathText=False, strict=False): ScalarFormatter.__init__(self, useOffset, useMathText) self._powerlimits = (-3, 3) if ndec is None or ndec < 0: self.format = None elif ndec == 0: self.format = "%d" else: self.format = "%%1.%if" % ndec self.strict = strict
def _set_orderOfMagnitude(self, mrange): """Sets the order of magnitude.""" ScalarFormatter._set_orderOfMagnitude(self, mrange) self.orderOfMagnitude = 3 * (self.orderOfMagnitude // 3)
import pandas as pa import numpy as np import matplotlib.pyplot as plt from matplotlib.pyplot import ScalarFormatter fmt=ScalarFormatter(useOffset=False) fmt.set_scientific(False) import os,sys sys.path.append('/bin/other_scripts/') from error_cosmetic_def import check_err #json=[k for k in os.listdir(os.getcwd()) if k.endswith('json')][0] df=pa.read_json('ref_res_2016_8_2_0_30.json') dff=pa.read_json('ref_res_2016_8_3_8_1.json') plt.figure('unit cell a') plt.plot(df['vol'],df['cell_a'],'ro') plt.plot(df.filter(regex='Ekto',axis=0)['vol'],df.filter(regex='Ekto',axis=0)['cell_a'],'o',mfc='None',ms=15,mew='1') plt.plot(df.filter(regex='Endo',axis=0)['vol'],df.filter(regex='Endo',axis=0)['cell_a'],'o',mfc='None',ms=15,mew='2') plt.plot(df.filter(regex='Eching',axis=0)['vol'],df.filter(regex='Eching',axis=0)['cell_a'],'d',mfc='None',ms=15,mew='2') plt.plot(df.filter(regex='10_Ech',axis=0)['vol'],df.filter(regex='10_Ech',axis=0)['cell_a'],'x',mfc='None',ms=15,mew='2') txt1=plt.text(529.2,9.445-0.002,r'$\circ\/-\/Ekot-Endo\/samples$',fontsize=16) txt2=plt.text(529.2,9.445-0.004,r'$\diamond\/-\/Eching\/samples$',fontsize=16) txt3=plt.text(529.2,9.445-0.006,r'$X\/-\/Eching\/"10"\/sample$',fontsize=16)