matplotlib - Python multiple boxplots automatic label -


is possible automatically set labels multiple boxplots? know can done custom annotations or ticklabels, possible automatically?

naively 1 expect following, plt.boxplot doesn't support labels.

import numpy np import matplotlib.pyplot plt  #fake data data = (np.random.random(50), np.random.random(50)) labels = ('random set 1', 'random set 2')  plt.boxplot(data, labels=labels) plt.legend() plt.show() 

any ideas?

i realized shortest , cleanest along lines of:

import numpy np import matplotlib.pyplot plt  #fake data data = (np.random.random(50), np.random.random(50)) labels = ('random set 1', 'random set 2')  plt.boxplot(data) plt.xticks(np.arange(len(labels))+1,labels) plt.show() 

but i'm still open other (automatic) suggestions.


Comments

Popular posts from this blog

python - No exponential form of the z-axis in matplotlib-3D-plots -

php - Best Light server (Linux + Web server + Database) for Raspberry Pi -

c# - "Newtonsoft.Json.JsonSerializationException unable to find constructor to use for types" error when deserializing class -