Export labels as latex commands

Hi there,

I’m starting to use plotly. Unfortunately, I’ve encountered a problem. I would very much like to export graphs I generated into format
(svg+tex), so I would get generated plot and the labels to-be-typesetted by LaTeX. My goal is to add the generated image to my LaTeX document in a way so the text of the labels would match the text of the document (family-wise as well as size-wise). All I found is just to export to png / svg / pdf, unfortunatelly all these option export the labels “as image” meaning that the text looks distinctly different than the text of the document.

I’ve found for example this topic: Export PDF/SVG with LaTex texts but in this topic the problem is exact opposite – the autor complains that the export generated LaTeX command rather than the text as vectors. And LaTeX command is exactly what I need (unfortunately, I was not able to find how to export it with LaTeX commands).

For example I need to export plots as simple as:

import plotly.express as px                                                                                                                                                                                                         
x = [0, 1, 12, 13, 14, 21]                                                                                                                                                                                                          
fig = px.histogram(x, nbins=3)

I don’t really care if i should export it directly from the code of the web browser, as I can do both.

Any help is welcomed