render_plotly_figure_as_image_file#

API documentation for tradeexecutor.visual.image_output.render_plotly_figure_as_image_file Python function.

render_plotly_figure_as_image_file(figure, format='png', width=512, height=512)[source]#

“Render Plotly figure as a static PNG image.

  • Uses Kaleido to render the Plotly figure as a PNG or SVG image

  • Plotly’s Figure.to_image uses Kaleido when it’s installed/available

Parameters:
  • format (str) – See ``kaleido._fig_tools` module for supported formats. Supporting only png and svg for now.

  • width (int) – Width in pixels

  • height (int) – Height in pixels

  • figure (Figure) –

Returns:

Image data encoded as byttes blob.

Return type:

bytes