Skip to content

remove Loading [MathJax]/extensions/MathMenu.js message #4341

Description

@zhimin-z

I am working with plotly but the output image show the watermark:
My code:

df = pd.read_json(os.path.join(path_rq12, 'macro-topics.json'))

categories = []
frequency_p = []
frequency_k = [] 

for index, group in df.groupby('Challenge_topic_macro'):
    categories.append(macro_topic_indexing[index])
    frequency_p.append(len(group[group['Challenge_type'] == 'problem']))
    frequency_k.append(len(group[group['Challenge_type'] == 'knowledge']))
    
# Create a stacked bar chart
fig = go.Figure(data=[
    go.Bar(name='Problem', x=categories, y=frequency_p, text=frequency_p, textposition='outside'),
    go.Bar(name='Knowledge', x=categories, y=frequency_k, text=frequency_k, textposition='outside')
])

# Change the bar mode
fig.update_layout(
    barmode='group',
    xaxis_title="Macro-topic Name",
    yaxis_title="Post Number",
    xaxis=dict(title_font=dict(size=18)), 
    yaxis=dict(title_font=dict(size=18)),
)
fig.show()
fig.write_image(os.path.join(path_rq12, 'Macro-topics frequency histogram.pdf'))

My output image:
image

OS: Ubuntu 20.04
Python: 3.10.9
Plotly: 5.16.1

Activity

  1. changed the title [-]How to remove [/-] [+]How to remove `Loading [MathJax]/extensions/MathMenu.js`[/+] on Aug 27, 2023
  2. zhimin-z commented on Aug 27, 2023

    @zhimin-z
    Author
  3. Fratorhe commented on Feb 2, 2024

    @Fratorhe

    Do you have any updates on this?

  4. Coding-with-Adam commented on Feb 5, 2024

    @Coding-with-Adam
    Contributor

    Sorry but we don't have updates on this issue as of yet.

  5. jav-ed commented on Mar 14, 2024

    @jav-ed

    I see a similar issue when exporting to pdf. Nearly 2 years ago, the following worked for me:

      # -------------------------- first time -------------------------- #
      import plotly.express as px 
      import time 
      file_Name="some_Figure.pdf"
      fig_Throw_Away = px.scatter(x=[0, 1, 2, 3, 4], y=[0, 1, 4, 9, 16])
      fig_Throw_Away.write_image(file_Name, format="pdf")
      time.sleep(0.1)
      
      # delete the dummy file again
      path_Cwd = Path.cwd()
      file_2_Del = path_Cwd/file_NamendError exceptions will be ignored (same behavior as the POSIX rm -f command).
      file_2_Del.unlink(missing_ok = True)
      
      # ------------------------ end first time ------------------------ #ndError exceptions will be ignored (same behavior as the POSIX rm -f command).
      file_2_Del.unlink(missing_ok = True)
      
      # ------------------------ end first time ------------------------ #
      
      # now run your actual code to generate the plot that you like

    The idea is to create a dummy plot, wait a bit and after the waiting you can plot your actual figure that you like. Again, no guarantees, but it worked for me some time ago

  6. self-assigned this
    on Jul 11, 2024
  7. removed their assignment
    on Aug 2, 2024
  8. changed the title [-]How to remove `Loading [MathJax]/extensions/MathMenu.js`[/-] [+]remove `Loading [MathJax]/extensions/MathMenu.js` message[/+] on Aug 12, 2024
  9. emilykl commented on Aug 31, 2026

    @emilykl
    Contributor

    plotly.py v7.0.0 now bundles MathJax v3 rather than v2 (see #5684), and the message bar is no longer included in v3, so this is resolved.

    Note that Kaleido v1.4.0 or greater must be used for generating images, since that is the first version which uses MathJax v3 by default.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3backlogbugsomething broken

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions