Сохраните график Matplotlib в формате html. ⇐ Python
Сохраните график Matplotlib в формате html.
I have a plot written in matplotlib.
Currently I saved that plot in pdf ,but i also want to save it in .html format for better visualization.
I am not aware of any html stuff , so need inputs here
Below is my code:
output_file = config["output_dir"] / "report.pdf" with PdfPages(output_file) as pdf: fig, ax = plt.subplots(2, constrained_layout = True) for x in new_hpg_groupdf: ax[0].plot(x[1]['iTOW'] , x[1]['ionoEst'] , label=f"{satellite} {x[0][1]}") ax[0].set_ylabel("Iono Estimation (TECU)") ax[0].set_xlabel("Itows (mSec)") ax[0].grid(True) ax[0].legend(fontsize=4 , loc='upper left' , bbox_to_anchor=[1.01, 1.02]) ax[0].set_title('Iono Estimation Output') ax[1].plot(x[1]['iTOW'] , x[1]['ionoEstAcc'] , label=f"{satellite} {x[0][1]}") ax[1].set_ylabel("Iono Accuracy (TECU)") ax[1].set_xlabel("Itows (mSec)") ax[1].grid(True) ax[1].legend(fontsize=4 , loc='upper left' , bbox_to_anchor=[1.01, 1.02]) ax[1].set_title('Iono Estimation Accuracy Output') pdf.savefig() plt.close()
Источник: https://stackoverflow.com/questions/780 ... tml-format
I have a plot written in matplotlib.
Currently I saved that plot in pdf ,but i also want to save it in .html format for better visualization.
I am not aware of any html stuff , so need inputs here
Below is my code:
output_file = config["output_dir"] / "report.pdf" with PdfPages(output_file) as pdf: fig, ax = plt.subplots(2, constrained_layout = True) for x in new_hpg_groupdf: ax[0].plot(x[1]['iTOW'] , x[1]['ionoEst'] , label=f"{satellite} {x[0][1]}") ax[0].set_ylabel("Iono Estimation (TECU)") ax[0].set_xlabel("Itows (mSec)") ax[0].grid(True) ax[0].legend(fontsize=4 , loc='upper left' , bbox_to_anchor=[1.01, 1.02]) ax[0].set_title('Iono Estimation Output') ax[1].plot(x[1]['iTOW'] , x[1]['ionoEstAcc'] , label=f"{satellite} {x[0][1]}") ax[1].set_ylabel("Iono Accuracy (TECU)") ax[1].set_xlabel("Itows (mSec)") ax[1].grid(True) ax[1].legend(fontsize=4 , loc='upper left' , bbox_to_anchor=[1.01, 1.02]) ax[1].set_title('Iono Estimation Accuracy Output') pdf.savefig() plt.close()
Источник: https://stackoverflow.com/questions/780 ... tml-format
-
- Похожие темы
- Ответы
- Просмотры
- Последнее сообщение