
Hi,
If I have an app that allows the user to specify plot annotatiaons in a YAML format, which becomes a python nested dict, for example, here might be some user-provided annotations:
annot = {
'title': {
'text': 'perplexity',
'font_size': '24px',
},
'xaxis': {
'axis_label': 'sgd steps',
'font_size': '16px',
}
....
}
I wondered, what is the most ergonomic way of assigning these to a given figure?
In the annotations docs, I see some examples of setting various annotations directly as python properties or sub-properties. For example:
p.title.text = 'perplexity'
p.title.font_size = '24px'
p.xaxis.axis_label = 'sgd steps'
p.xaxis.font_size = '16px'
...
I would like to avoid writing the code like:
p.__dict__[key].__dict__[key2] = val
Wondering if there was a better way to do this generically. Thanks in advance for any help!
Best,
Henry
