Write Image as PDF with Box saying "Loading [MathJax]/extensions/MathMenu.js"
See original GitHub issueHi,
I am trying to write plot into PDF format, but I cannot get rid of this box saying “Loading [MathJax]/extensions/MathMenu.js”, will you be able to tell me how should I fix it?
Here is the code I am using to generate the plot.
fig = go.Figure()
fig.add_trace(go.Scatter(x=[0, 1, 2, 3, 4, 5], y=[0.5, 0.6, 0.7, 0.8, 0.9, 0.9], name='A',
line=dict(width=4), marker=dict(size=15, symbol='star')))
fig.add_trace(go.Scatter(x=[0, 1, 2, 3, 4, 5], y=[0.4, 0.4, 0.4, 0.4, 0.4, 0.4], name='B',
line=dict(width=4), marker=dict(size=15, symbol='circle')))
fig.add_trace(
go.Scatter(x=[0, 1, 2, 3, 4, 5], y=[0.51, 0.52, 0.53, 0.54, 0.55, 0.56], name='C',
line=dict(width=4), marker=dict(size=15, symbol='x')))
fig.update_layout(
yaxis_range=[0.2, 1],
legend=dict(
x=0,
y=0,
traceorder="reversed",
title_font_family="Times New Roman",
font=dict(
family="Courier",
size=16,
color="black"
),
bgcolor="LightSteelBlue",
bordercolor="Black",
borderwidth=2
)
)
fig.write_image("1.pdf")
fig.show()
Issue Analytics
- State:
- Created 2 years ago
- Reactions:8
- Comments:19 (3 by maintainers)
Top Results From Across the Web
PDFBox - Inserting Image - Tutorialspoint
Step 1: Loading an Existing PDF Document. Load an existing PDF document using the static method load() of the PDDocument class. This method...
Read more >Convert PDF files to images with PDFBox - Stack Overflow
Solution for the 2.0 version: PDDocument document = PDDocument.load(new File(pdfFilename)); PDFRenderer pdfRenderer ...
Read more >PDF-LIB · Create and modify PDF documents in any ... - JS.ORG
Create PDF documents from scratch, or modify existing PDF documents. Draw text, images, and vector graphics. Embed your own fonts. Even embed and...
Read more >Error: Insufficient data for an image in Acrobat or Acrobat Reader
When you open a PDF file in Acrobat or Acrobat Reader, the following error message is displayed: “Insufficient data for an image.
Read more >Hopding/pdf-lib: Create and modify PDF documents ... - GitHub
Create and modify PDF documents in any JavaScript environment - GitHub ... Load a PDFDocument from the existing PDF bytes const pdfDoc =...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Yes, we know the basic cause, see https://github.com/plotly/Kaleido/issues/122 for details.
Note that if the figure you’re rendering doesn’t actually use MathJax then you can prevent MathJax from being loaded at all by Kaleido with:
Otherwise, if saving a “throwaway” PDF first helps, I would recommend that: basically save your figure twice.
this worked for me:
plotly==5.3.1