org.hl7.fhir.core/.azure/i18n-coverage-table/generate-i18n-coverage-tabl...

34 lines
661 B
Python
Raw Normal View History

2024-04-22 15:50:16 -04:00
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
#define figure and axes
2024-04-23 11:46:41 -04:00
fig, ax = plt.subplots(1,1)
2024-04-22 15:50:16 -04:00
#hide the axes
fig.patch.set_visible(False)
ax.axis('off')
ax.axis('tight')
#read data
df = pd.read_csv('i18n-coverage.csv')
#create table
table = ax.table(cellText=df.values, colLabels=df.columns, loc='center')
2024-04-23 11:46:41 -04:00
table.scale(1, 4)
table.auto_set_font_size(False)
table.set_fontsize(14)
2024-04-22 15:50:16 -04:00
fig.tight_layout()
2024-04-23 11:46:41 -04:00
fig.set_figheight(2)
fig.set_figwidth(4)
2024-04-22 15:50:16 -04:00
2024-04-23 11:46:41 -04:00
ax.set_title('Internationalization Phrase Coverage by Locale')
2024-04-22 15:50:16 -04:00
2024-04-23 11:46:41 -04:00
fig = plt.gcf()
2024-04-22 15:50:16 -04:00
2024-04-22 16:29:07 -04:00
plt.savefig('i18n-coverage-table.png',
2024-04-22 15:50:16 -04:00
bbox_inches='tight',
dpi=150
)