# Unable to save plot to pdf

**URL:** <https://community.plotly.com/t/unable-to-save-plot-to-pdf/72360>\
**Category:** 📊 Plotly Python\
**Created:** [February 6, 2023, 9:32pm UTC](https://community.plotly.com/t/unable-to-save-plot-to-pdf/72360 "2023-02-06T21:32:21Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![monitorcasalab](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/monitorcasalab/32/8866_2.png) [@monitorcasalab](https://community.plotly.com/u/monitorcasalab)\
**Post date:** [February 6, 2023, 9:32pm UTC](https://community.plotly.com/t/unable-to-save-plot-to-pdf/72360/1 "2023-02-06T21:32:21Z")

</div>

Hi all

anyone else unable to save to pdf with the latest version and settings of plotly?

> **[Static](https://plotly.com/python/static-image-export/#vector-formats-svg-and-pdf)**
>
> Detailed examples of Static Image Export including changing color, size, log axes, and more in Python.

```auto
import plotly.graph_objects as go
import numpy as np
np.random.seed(1)

N = 100
x = np.random.rand(N)
y = np.random.rand(N)
colors = np.random.rand(N)
sz = np.random.rand(N) * 30

fig = go.Figure()
fig.add_trace(go.Scatter(
    x=x,
    y=y,
    mode="markers",
    marker=go.scatter.Marker(
        size=sz,
        color=colors,
        opacity=0.6,
        colorscale="Viridis"
    )
))

fig.show()
fig.write_image("images/fig1.pdf")

```

This does create the plot, but keeps running without saving the plot, any clues why?

---

<div class="post-metadata">

**Author:** ![AIMPED](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/aimped/32/21758_2.png) [@AIMPED](https://community.plotly.com/u/AIMPED)\
**Post date:** [February 6, 2023, 10:05pm UTC](https://community.plotly.com/t/unable-to-save-plot-to-pdf/72360/2 "2023-02-06T22:05:23Z")

</div>

Maybe related to this?

> [@Writing an image taking too long](https://community.plotly.com/t/writing-an-image-taking-too-long/72351):
>
> I am creating an app that takes in information, makes multiple graphs, and then prints them on a pdf. But when I go to write an image it doesn’t seem to respond. I have logging incorporated to track and it always stops at the write\_image() part. I know the graph is working because when I’ve put fig.show() before the saving part, it graphs it. It also gives no error. Here is my function: def make\_graphs\_bulk(region: str, report: str): # Cycle through engine names in engine\_names\_regions ta…

---

<div class="post-metadata">

**Author:** ![monitorcasalab](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/monitorcasalab/32/8866_2.png) [@monitorcasalab](https://community.plotly.com/u/monitorcasalab)\
**Post date:** [February 7, 2023, 7:34am UTC](https://community.plotly.com/t/unable-to-save-plot-to-pdf/72360/3 "2023-02-07T07:34:18Z")

</div>

Fantastic, thanks Aimped

---

<div class="post-metadata">

**Author:** ![adamschroeder](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/adamschroeder/32/17280_2.png) [@adamschroeder](https://community.plotly.com/u/adamschroeder)\
**Post date:** [February 7, 2023, 1:31pm UTC](https://community.plotly.com/t/unable-to-save-plot-to-pdf/72360/4 "2023-02-07T13:31:02Z")

</div>

hi @monitorcasalab

I copied your code and successfully saved the graph to pdf. I used dash==2.8.1 and I did `pip install -U kaleido`.

Can you try that and let me know if it works?

---

<div class="post-metadata">

**Author:** ![bpolasek](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/bpolasek/32/22137_2.png) [@bpolasek](https://community.plotly.com/u/bpolasek)\
**Post date:** [February 7, 2023, 3:57pm UTC](https://community.plotly.com/t/unable-to-save-plot-to-pdf/72360/5 "2023-02-07T15:57:02Z")

</div>

When I was looking at the Kaleido github, there were comments that the issue is mainly on windows machines, but otherwise works. Out of curiosity, are you on windows?

---

<div class="post-metadata">

**Author:** ![adamschroeder](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/adamschroeder/32/17280_2.png) [@adamschroeder](https://community.plotly.com/u/adamschroeder)\
**Post date:** [February 7, 2023, 4:02pm UTC](https://community.plotly.com/t/unable-to-save-plot-to-pdf/72360/6 "2023-02-07T16:02:54Z")

</div>

yes, I’m on windows machine.

---

<div class="post-metadata">

**Author:** ![monitorcasalab](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/monitorcasalab/32/8866_2.png) [@monitorcasalab](https://community.plotly.com/u/monitorcasalab)\
**Post date:** [February 8, 2023, 9:54am UTC](https://community.plotly.com/t/unable-to-save-plot-to-pdf/72360/7 "2023-02-08T09:54:41Z")

</div>

Thanks Adam, it works now  
was curious as I was coding on a new machine with the latest plotly library
