Giter Site home page Giter Site logo

Latex is not Rendered in Plotly about aim HOT 2 OPEN

mauricekraus avatar mauricekraus commented on September 27, 2024
Latex is not Rendered in Plotly

from aim.

Comments (2)

mauricekraus avatar mauricekraus commented on September 27, 2024 1

@gorarakelyan Thank you for your answer. The problem is that the default Ploty "html" does not include mathjax. When we make the conversion our self it works. What do you think? (WandB suffers from the same problem)

# Import modules
import numpy as np
import matplotlib.pyplot as plt
from plotly.tools import mpl_to_plotly

# Create some data arrays
x = np.linspace(-2.0 * np.pi, 2.0 * np.pi, 51)
y = np.sin(x)

# Make a plot
mpl_fig = plt.figure()
plt.plot(x, y, 'ko--')
plt.title('$\\alpha$ sin(x) from -2*pi to 2*pi')
plt.xlabel('x')
plt.ylabel('sin(x)')
# plt.show()

# Export plot to plotly
a = mpl_to_plotly(mpl_fig)
a.write_html("test.html", full_html=False, include_plotlyjs='cdn', include_mathjax='cdn')

If you give me some guidance, I could try to come up with an PR.

from aim.

gorarakelyan avatar gorarakelyan commented on September 27, 2024

@mauricekraus this might be a plotly matplotlib conversion limitation, when trying to display it interactively on the browser. A workaround could be tracking matplotlib figures as Aim images.

from aim.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.