Use strings as parameters for Matplotlib
I want to generate parameters for figures dynamically, pass as arguments to Matplotlib.
Example to illustrate, this works:
dict = {'x_tick_fontsize':12 ,'x_tick_weight':'normal','x_tick_rotation':15}
plt.xticks(fontsize = dict['x_tick_fontsize']
,weight = dict['x_tick_weight']
,rotation = dict['x_tick_rotation'])
This doesn't, but I want it to:
my_params_string = "fontsize = 12, weight ='normal', rotation = 15"
plt.xticks(my_params_string)
What can I try next?
Comments
Post a Comment