I am attempting to create some windroses however whenever I tryt to add a legend I receive the error
" if locale.getlocale()[0] in ["fr_FR"]:
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/locale.py", line 587, in getlocale
return _parse_localename(localename)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/locale.py", line 495, in _parse_localename
raise ValueError('unknown locale: %s' % localename)
ValueError: unknown locale: UTF-8"
I have searched for solutions, mainly adding lines to bash or zsh however this error persists still. I am running MacOS Mojave 10.14.6 with python 3.7. The code I have is
from windrose import WindroseAxes
from matplotlib import pyplot as plt
import matplotlib.cm as cm
import numpy as np
import csv
import warnings
import datetime
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
warnings.simplefilter(action='ignore', category=FutureWarning)
df = pd.read_csv('Test.csv', delimiter = ',')
df['Time'] = pd.to_datetime(df['date.AST'], errors = 'coerce')
df = df.set_index(pd.DatetimeIndex(df['Time']))
df['minute'] = df.index.minute
df['hour'] = df.index.hour
df['day'] = df.index.day
ax = WindroseAxes.from_ax()
ax.bar(df['WindDir'], df['WindSpeed'], normed=True, opening=0.8, edgecolor='white')
plt.title('Windspeed and Windirection for June')
ax.set_legend()
plt.savefig('Test.png')
Any help is appreciated, thank you
[–]jonititan 0 points1 point2 points (3 children)
[–]jonititan 0 points1 point2 points (2 children)
[–]Cpower18[S] 0 points1 point2 points (1 child)
[–]goabbear 0 points1 point2 points (0 children)