Issue
I am using text2d() to write some information on the bar3d-Diagram. The piece of code is this one:
textstr = '\n'.join((
'{}'.format(langbezeichnung),
'Beprobung {} - {}'.format(datum_start, datum_end),
'{} Messstellen'.format(anzahl_mst_para),
"BG = {} µg/L".format(bestimmungsgrenze),
"75% SW = {} µg/L".format(warnwert),
"SW = {} µg/L".format(grenzwert)))
ax.text2D(0.645, 0.74, s=textstr, transform=ax.transAxes, fontsize=12, ha='left', va='top', bbox=dict(facecolor='white', alpha=1, edgecolor='black', linewidth=0.2, boxstyle='square'))
but i would like to have the equal signs ("=") at the same line. Could anybody help me?
Thank you Rabea
Solution
Use Monospace font and set the space. The spaces will align in this case. Example...
ax = plt.axes(projection='3d')
textstr = '\n'.join((
'{}'.format('langbezeichnung'),
'Beprobung {} - {}'.format('datum_start', 'datum_end'),
'{} Messstellen'.format('anzahl_mst_para'),
"BG = {} µg/L".format('bestimmungsgrenze'),
"75% SW = {} µg/L".format('warnwert'),
"SW = {} µg/L".format('grenzwert')))
ax.text2D(0.645, 0.74, s=textstr, family='monospace', transform=ax.transAxes, fontsize=12, ha='left', va='top', bbox=dict(facecolor='white', alpha=1, edgecolor='black', linewidth=0.2, boxstyle='square'))
Answered By - Redox
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.