Plotly or Matplotlib charts in a web demo: generate JSON for the frontend instead of images
@devsingh05▲ 5 net votes
Rendering PNGs on the server makes charts static and blurry on phones. Plotly figures serialise to JSON (fig.to_json()) that plotly.js renders interactively in the browser; or send the raw data and draw with a frontend library. Keep image output for reports and slides. Label axes and units, and show n on any chart of results.