I plotted my wind data (direction and speed) with the windrose module https://windrose.readthedocs.io/en/latest/index.html. The results look nice but I cannot export them as a figure (png, eps, or anything to start with) because the result is a special object type that does not have a 'savefig' attribute, or I don't find it.
I have two pandas.core.series.Series: ff, dd
print(ff)
result:
TIMESTAMP
2016-08-01 00:00:00 1.643
2016-08-01 01:00:00 2.702
2016-08-01 02:00:00 1.681
2016-08-01 03:00:00 2.208
....
print(dd)
result:
TIMESTAMP
2016-08-01 00:00:00 328.80
2016-08-01 01:00:00 299.60
2016-08-01 02:00:00 306.90
2016-08-01 03:00:00 288.60
...
My code looks like:
from windrose import WindroseAxes
ax2 = WindroseAxes.from_ax()
ax2.bar(dd, ff, normed=True, opening=0.8, edgecolor='white', bins = [0,4,11,17])
ax2.set_legend()
ax2.tick_params(labelsize=18)
ax2.set_legend(loc='center', bbox_to_anchor=(0.05, 0.005), fontsize = 18)
ax2.savefig('./figures/windrose.eps')
ax2.savefig('./figures/windrose.png')
But the result is:
AttributeError: 'WindroseAxes' object has no attribute 'savefig'
Do you know how to create a figure out of the result so I can use it in my work?
assuming that you are using box type of windrose module. Then the following code converts your wind rose into an image: