mirror of
https://github.com/fjosw/pyerrors.git
synced 2025-05-15 03:53:41 +02:00
fix: plot_tauint and plot_rho now generate separate figures for
different ensembles again, saving the figures now also works for multiple ensembles.
This commit is contained in:
parent
b0e98de083
commit
de6ea7902b
1 changed files with 13 additions and 4 deletions
|
@ -470,8 +470,8 @@ class Obs:
|
||||||
if not hasattr(self, 'e_dvalue'):
|
if not hasattr(self, 'e_dvalue'):
|
||||||
raise Exception('Run the gamma method first.')
|
raise Exception('Run the gamma method first.')
|
||||||
|
|
||||||
fig = plt.figure()
|
|
||||||
for e, e_name in enumerate(self.mc_names):
|
for e, e_name in enumerate(self.mc_names):
|
||||||
|
fig = plt.figure()
|
||||||
plt.xlabel(r'$W$')
|
plt.xlabel(r'$W$')
|
||||||
plt.ylabel(r'$\tau_\mathrm{int}$')
|
plt.ylabel(r'$\tau_\mathrm{int}$')
|
||||||
length = int(len(self.e_n_tauint[e_name]))
|
length = int(len(self.e_n_tauint[e_name]))
|
||||||
|
@ -496,13 +496,20 @@ class Obs:
|
||||||
plt.ylim(bottom=0.0)
|
plt.ylim(bottom=0.0)
|
||||||
plt.draw()
|
plt.draw()
|
||||||
if save:
|
if save:
|
||||||
fig.savefig(save)
|
fig.savefig(save + "_" + str(e))
|
||||||
|
|
||||||
def plot_rho(self):
|
def plot_rho(self, save=None):
|
||||||
"""Plot normalized autocorrelation function time for each ensemble."""
|
"""Plot normalized autocorrelation function time for each ensemble.
|
||||||
|
|
||||||
|
Parameters
|
||||||
|
----------
|
||||||
|
save : str
|
||||||
|
saves the figure to a file named 'save' if.
|
||||||
|
"""
|
||||||
if not hasattr(self, 'e_dvalue'):
|
if not hasattr(self, 'e_dvalue'):
|
||||||
raise Exception('Run the gamma method first.')
|
raise Exception('Run the gamma method first.')
|
||||||
for e, e_name in enumerate(self.mc_names):
|
for e, e_name in enumerate(self.mc_names):
|
||||||
|
fig = plt.figure()
|
||||||
plt.xlabel('W')
|
plt.xlabel('W')
|
||||||
plt.ylabel('rho')
|
plt.ylabel('rho')
|
||||||
length = int(len(self.e_drho[e_name]))
|
length = int(len(self.e_drho[e_name]))
|
||||||
|
@ -519,6 +526,8 @@ class Obs:
|
||||||
plt.plot([-0.5, xmax], [0, 0], 'k--', lw=1)
|
plt.plot([-0.5, xmax], [0, 0], 'k--', lw=1)
|
||||||
plt.xlim(-0.5, xmax)
|
plt.xlim(-0.5, xmax)
|
||||||
plt.draw()
|
plt.draw()
|
||||||
|
if save:
|
||||||
|
fig.savefig(save + "_" + str(e))
|
||||||
|
|
||||||
def plot_rep_dist(self):
|
def plot_rep_dist(self):
|
||||||
"""Plot replica distribution for each ensemble with more than one replicum."""
|
"""Plot replica distribution for each ensemble with more than one replicum."""
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue