From 4c5160e309a6ea20eb7c44210e3e64cb10148837 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Afr=C3=A2nio=20Melo?= Date: Thu, 13 Apr 2023 14:06:57 -0300 Subject: [PATCH] Bug correction. --- kydlib/kydlib.py | 20 ++++++++++---------- setup.py | 2 +- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/kydlib/kydlib.py b/kydlib/kydlib.py index 7c3fa90..b6ef2ec 100755 --- a/kydlib/kydlib.py +++ b/kydlib/kydlib.py @@ -387,31 +387,31 @@ def autocorrelation_plot (self, plot_acf = False, plot_bar = True, if ax_bar is None: fig_bar, ax_bar = plt.subplots() - - else: - - fig_bar= None self.critic_auto_x = [np.searchsorted(-self.lags_y[i], - -critic_auto) - for i in range(len(self.lags_y))] + -critic_auto) + for i in range(len(self.lags_y))] ax_bar.bar(range(1,len(self.critic_auto_x)+1), - np.array(self.critic_auto_x), color='k'); + np.array(self.critic_auto_x), color='k'); ax_bar.set_xlabel('Variable') ax_bar.set_ylabel('Number of lags') ax_bar.set_xlim([0,self.m+1]); ax_bar.set_xticks(np.arange(1,self.m+1)); ax_bar.xaxis.set_tick_params(labelsize=12) ax_bar.axhline(np.mean(self.critic_auto_x), - ls='-',c='k',label='mean') + ls='-',c='k',label='mean') ax_bar.axhline(np.median(self.critic_auto_x),ls='-.', - c='k',label='median') + c='k',label='median') ax_bar.legend(); if title_bar: ax_bar.set_title(f'Number of lags necessary to achieve' - f' {critic_auto} autocorrelation') + f' {critic_auto} autocorrelation') + + else: + fig_bar= None + if return_fig: return fig_acf, fig_bar diff --git a/setup.py b/setup.py index 6dfacbd..d549998 100755 --- a/setup.py +++ b/setup.py @@ -24,7 +24,7 @@ name='kydlib', description='Routines for exploratory data analysis.', license="MIT", - version='0.3.0', + version='0.3.1', long_description=README, long_description_content_type='text/markdown', url='https://github.com/afraniomelo/kydlib',