# Plot lines disappear when savefig to svg

**URL:** <https://discourse.julialang.org/t/plot-lines-disappear-when-savefig-to-svg/59173>\
**Category:** General Usage\
**Tags:** plotting, gr\
**Created:** [April 13, 2021, 9:32am UTC](https://discourse.julialang.org/t/plot-lines-disappear-when-savefig-to-svg/59173 "2021-04-13T09:32:05Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![BaronvonderHeyden](https://avatars.discourse-cdn.com/v4/letter/b/df788c/32.png) [@BaronvonderHeyden](https://discourse.julialang.org/u/BaronvonderHeyden)\
**Post date:** [April 13, 2021, 9:32am UTC](https://discourse.julialang.org/t/plot-lines-disappear-when-savefig-to-svg/59173/1 "2021-04-13T09:32:05Z")

</div>

When using the gr backend and saving a plot with savefig() as SVG some lines simply disappear.  
However, when saving the same figures as PNG or PDF they are present.

This is what the SVG looks like:

 ![image](https://global.discourse-cdn.com/julialang/original/3X/6/1/6113068f25d210c14a82e3f518247f247ab781e0.png)

This is the PNG and what it should look like:

 ![newfig2b](https://global.discourse-cdn.com/julialang/original/3X/3/8/3891dc9e26d85268ba071f37852b305c524cda72.png)

Has anyone an idea how to fix this or even just what might be the problem?

---

<div class="post-metadata">

**Author:** ![jheinen](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jheinen/32/2787_2.png) [@jheinen](https://discourse.julialang.org/u/jheinen)\
**Post date:** [April 13, 2021, 10:06am UTC](https://discourse.julialang.org/t/plot-lines-disappear-when-savefig-to-svg/59173/2 "2021-04-13T10:06:10Z")

</div>

Could you please provide the script/code?

---

<div class="post-metadata">

**Author:** ![BaronvonderHeyden](https://avatars.discourse-cdn.com/v4/letter/b/df788c/32.png) [@BaronvonderHeyden](https://discourse.julialang.org/u/BaronvonderHeyden)\
**Post date:** [July 2, 2021, 8:42am UTC](https://discourse.julialang.org/t/plot-lines-disappear-when-savefig-to-svg/59173/3 "2021-07-02T08:42:03Z")

</div>

hey, sorry for the late response!  
unfortunately providing the code is a bit tricky because it involves different data formats and does a bunch of things.

however, i have tracked the issue down!

It is caused by the first value the lines have in the SVG file: “[…],4.64225e+041”  
If one replaces the y value “4.64225e+041” with a proper value that is located within the borders of the frame, the lines become visible again.

The easiest way to reproduce the issue is this:

```julia
g = [0, 1e-4, 1e-3, 1e-2]
plot(g)
plot!(yaxis=:log, ylims = (1e-8,1))
savefig("test123.svg")

```

Somehow the problem seems to be that the “0” value can be handled by plot() if setting appropriate ylims but then when saving this as SVG this becomes a problem again…
