[PYTHON] convertir un graphique basé sur ggplot en html

ggplot based graph can be converted to html using mpld3.fig_to_html. The point is to call draw method to generate matplotlib figure object, though it is not mentioned in ggplot manual now. The html piece can be used in templates.

import matplotlib.pyplot as plt, mpld3
from ggplot import *

ggp = ggplot(aes(x='date', y='beef'), data=meat) +\
      geom_line() +\
      stat_smooth(colour='blue', span=0.2)
fig = ggp.draw()
html = mpld3.fig_to_html(fig)

Recommended Posts

convertir un graphique basé sur ggplot en html
Convertir le HTML en fichier texte
Convertir .ipynb en .html (avec BatchFile)
Convertir de Markdown en HTML en Python
Convertir en HSV
Convertir 202003 en 2020-03 avec les pandas
Convertir les kanji en kana
Convertir jupyter en py
Convertir keras-yolo3 en ONNX
Convertir dict en tableau
Convertir json en Excel
Convertir une chaîne hexadécimale en binaire
[python] Convertir la date en chaîne
Convertir numpy int64 en python int
[Python] Convertir la liste en Pandas [Pandas]
Convertir le projet Scratch en Python
[Python] Convertir Shift_JIS en UTF-8
Convertir l'adresse IP en décimal
Convertissez rapidement SDF en CSV
Convertir le fichier genbank en fichier gff
Convertir le code python 3.x en python 2.x
Télécharger le logo Google → Texte avec OCR → Affichage sur HTML