Skip to content

Commit

Permalink
Fixed an issue with JOSS plot example and pandas<0.24
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
kbg committed Aug 12, 2019
1 parent eae7b2b commit 2ada0de
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion examples/create_joss_figure.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}$')
Expand Down

0 comments on commit 2ada0de

Please sign in to comment.