From 2ada0de86128a8d58878f88b05894ee5842a939b Mon Sep 17 00:00:00 2001 From: Kolja Glogowski Date: Mon, 12 Aug 2019 23:58:06 +0200 Subject: [PATCH] Fixed an issue with JOSS plot example and pandas<0.24 There is an issue with pandas < v0.24 when using a pandas.Series() of pandas.Timestamps() in Matplotlib's plt.errorbar(). To avoid this, we use the series values for the plt.errorbar() call as a workaround. This fixes #34. --- examples/create_joss_figure.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/examples/create_joss_figure.py b/examples/create_joss_figure.py index 6d35056..51dfaab 100644 --- a/examples/create_joss_figure.py +++ b/examples/create_joss_figure.py @@ -133,8 +133,9 @@ def read_fits_data(fname): ax_meta, ax_img = ax[:, 0], ax[:, 1] # Create metadata line plots in the left column +# Note: t.values is used for errorbar() because of an issue with pandas < 0.24 axi = ax_meta[0] -axi.errorbar(t, kw.USFLUX/1e22, yerr=kw.ERRVF/1e22, fmt='.', ms=2, +axi.errorbar(t.values, kw.USFLUX/1e22, yerr=kw.ERRVF/1e22, fmt='.', ms=2, capsize=0, label='USFLUX') axi.set_title('Total unsigned flux') axi.set_ylabel(r'Mx $\times 10^{\minus 22}$')