I have this code that produces a histogram, identifying three types of fields; \"Low\", \"medium\" , and \"high\":
import pylab as plt import pandas as pd
According to me you just need to pass the required label as an argument in the hist function, e.g.
hist
plt.hist(x, bins=20, alpha=0.5, label='my label')
See example also here https://matplotlib.org/examples/statistics/histogram_demo_multihist.html