# Makie - SVG saved with CairoMakie not editable (looks like raster)

**URL:** <https://discourse.julialang.org/t/makie-svg-saved-with-cairomakie-not-editable-looks-like-raster/75335>\
**Category:** Visualization\
**Tags:** makie\
**Created:** [January 28, 2022, 2:23am UTC](https://discourse.julialang.org/t/makie-svg-saved-with-cairomakie-not-editable-looks-like-raster/75335 "2022-01-28T02:23:09Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![VMHidalgo](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/vmhidalgo/32/23055_2.png) [@VMHidalgo](https://discourse.julialang.org/u/VMHidalgo)\
**Post date:** [January 28, 2022, 2:23am UTC](https://discourse.julialang.org/t/makie-svg-saved-with-cairomakie-not-editable-looks-like-raster/75335/1 "2022-01-28T02:23:09Z")

</div>

Hi guys,

I am using CairoMakie on Ubuntu and saving plots as SVG.

When I open the SVG file with Inkscape to edit it, the file cannot be edited. It looks like a raster image. What is happening?

At first glance, this may seem like an Inkscape question, but I already checked with other SVG files and I can edit them with Inkscape. I also tried many tricks in Inkscape to make the CairoMakie-saved SVG files editable, without success.

 ![problem](https://global.discourse-cdn.com/julialang/original/3X/0/f/0fdc73238fa18aee71a6397bfacbc73c1126e10f.png)

So the problem is that SVG files saved using CairoMakie cannot be edited because they seem to be raster. I cannot access the different objects and paths. It only allows me to change the center of the SVG file. Do you have any idea?

Thank you.

---

<div class="post-metadata">

**Author:** ![Krastanov](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/krastanov/32/6817_2.png) [@Krastanov](https://discourse.julialang.org/u/Krastanov)\
**Post date:** [January 28, 2022, 3:19am UTC](https://discourse.julialang.org/t/makie-svg-saved-with-cairomakie-not-editable-looks-like-raster/75335/2 "2022-01-28T03:19:41Z")

</div>

I have the same problems when saving as `svg` even if I run `CairoMakie.activate!(type = "svg")`. However, a fine workaround is to save as `pdf` and then open the pdf in Inkscape. That provides you with a vector format.

---

<div class="post-metadata">

**Author:** ![VMHidalgo](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/vmhidalgo/32/23055_2.png) [@VMHidalgo](https://discourse.julialang.org/u/VMHidalgo)\
**Post date:** [January 28, 2022, 3:24am UTC](https://discourse.julialang.org/t/makie-svg-saved-with-cairomakie-not-editable-looks-like-raster/75335/3 "2022-01-28T03:24:13Z")

</div>

Hey, thank you for the suggestion.

Do you know if something can be done in the long-run? It is very sad, to say the least.

---

<div class="post-metadata">

**Author:** ![Krastanov](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/krastanov/32/6817_2.png) [@Krastanov](https://discourse.julialang.org/u/Krastanov)\
**Post date:** [January 28, 2022, 3:31am UTC](https://discourse.julialang.org/t/makie-svg-saved-with-cairomakie-not-editable-looks-like-raster/75335/4 "2022-01-28T03:31:37Z")

</div>

I would suggest reporting a bug. It is probably just some silly omission in the `save` code. I am not particularly worried, as the exact format (pdf or svg) does not matter much to me, as long as it is actually a vector format (which it is in the case of pdf).

---

<div class="post-metadata">

**Author:** ![VMHidalgo](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/vmhidalgo/32/23055_2.png) [@VMHidalgo](https://discourse.julialang.org/u/VMHidalgo)\
**Post date:** [January 28, 2022, 3:52am UTC](https://discourse.julialang.org/t/makie-svg-saved-with-cairomakie-not-editable-looks-like-raster/75335/5 "2022-01-28T03:52:11Z")

</div>

Sure, I think I will do it. Thanks so much for your help.

---

<div class="post-metadata">

**Author:** ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://discourse.julialang.org/u/jules)\
**Post date:** [January 28, 2022, 6:46am UTC](https://discourse.julialang.org/t/makie-svg-saved-with-cairomakie-not-editable-looks-like-raster/75335/6 "2022-01-28T06:46:58Z")

</div>

What plot objects are you using? There are certain operations where cairo just falls back to rasterization and svg supports a different subset than pdf

---

<div class="post-metadata">

**Author:** ![VMHidalgo](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/vmhidalgo/32/23055_2.png) [@VMHidalgo](https://discourse.julialang.org/u/VMHidalgo)\
**Post date:** [January 28, 2022, 2:24pm UTC](https://discourse.julialang.org/t/makie-svg-saved-with-cairomakie-not-editable-looks-like-raster/75335/7 "2022-01-28T14:24:11Z")

</div>

I am using lines and density, at least. They all produce rasters…

BUT, previously the same plots (using lines and density) were properly saved as SVG. Suddenly something happened, and they began to be saved as rasters.

That is why I was so confused. I did not change anything in my code and plots began to be saved as rasters. I think I installed a few packages, and I updated Ubuntu, but that is all. I guess maybe those packages changed something ?

---

<div class="post-metadata">

**Author:** ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://discourse.julialang.org/u/jules)\
**Post date:** [January 28, 2022, 3:07pm UTC](https://discourse.julialang.org/t/makie-svg-saved-with-cairomakie-not-editable-looks-like-raster/75335/8 "2022-01-28T15:07:48Z")

</div>

Hm density drops down to poly, might drop down to mesh. If dispatch in CairoMakie changed again so mesh is hit, that could cause rasterization. Can you leave out density and check if it’s fine?

---

<div class="post-metadata">

**Author:** ![VMHidalgo](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/vmhidalgo/32/23055_2.png) [@VMHidalgo](https://discourse.julialang.org/u/VMHidalgo)\
**Post date:** [January 28, 2022, 3:54pm UTC](https://discourse.julialang.org/t/makie-svg-saved-with-cairomakie-not-editable-looks-like-raster/75335/9 "2022-01-28T15:54:15Z")

</div>

It does not seem to work with `lines` only.

```julia
using CairoMakie

t = collect(0:100)
d = rand(100)

p = lines(t,d)

```

 ![problem2](https://global.discourse-cdn.com/julialang/original/3X/9/8/98efced041965f08f5b20f9162b7375bc09efdc2.png)

---

<div class="post-metadata">

**Author:** ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://discourse.julialang.org/u/jules)\
**Post date:** [January 28, 2022, 4:30pm UTC](https://discourse.julialang.org/t/makie-svg-saved-with-cairomakie-not-editable-looks-like-raster/75335/10 "2022-01-28T16:30:55Z")

</div>

I’ll check it out later, something is fishy then. But just to make sure, this happens with `save("test.svg", fig)` or only with displaying in VSCode or something comparable?

---

<div class="post-metadata">

**Author:** ![VMHidalgo](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/vmhidalgo/32/23055_2.png) [@VMHidalgo](https://discourse.julialang.org/u/VMHidalgo)\
**Post date:** [January 28, 2022, 6:36pm UTC](https://discourse.julialang.org/t/makie-svg-saved-with-cairomakie-not-editable-looks-like-raster/75335/11 "2022-01-28T18:36:59Z")

</div>

When I save it as svg. Here is the whole thing.

```julia
using CairoMakie

t = collect(0:100)
d = rand(101)

p = lines(t,d)

save("/home/vmh/Downloads/example.svg",p)

```

---

<div class="post-metadata">

**Author:** ![StatisticalMouse](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/statisticalmouse/32/43370_2.png) [@StatisticalMouse](https://discourse.julialang.org/u/StatisticalMouse)\
**Post date:** [January 28, 2022, 7:18pm UTC](https://discourse.julialang.org/t/makie-svg-saved-with-cairomakie-not-editable-looks-like-raster/75335/12 "2022-01-28T19:18:50Z")

</div>

That produces png for me. Near the top of the file is

```julia
<image id="image5-bdBTEqB/" width="2500" height="1876" xlink:href="data:image/png;base64,

```

---

<div class="post-metadata">

**Author:** ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://discourse.julialang.org/u/jules)\
**Post date:** [January 28, 2022, 8:29pm UTC](https://discourse.julialang.org/t/makie-svg-saved-with-cairomakie-not-editable-looks-like-raster/75335/13 "2022-01-28T20:29:04Z")

</div>

Ok then something added relatively recently to CairoMakie must be incompatible with svgs, I’ll have to check that out later

---

<div class="post-metadata">

**Author:** ![VMHidalgo](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/vmhidalgo/32/23055_2.png) [@VMHidalgo](https://discourse.julialang.org/u/VMHidalgo)\
**Post date:** [January 28, 2022, 9:59pm UTC](https://discourse.julialang.org/t/makie-svg-saved-with-cairomakie-not-editable-looks-like-raster/75335/14 "2022-01-28T21:59:10Z")

</div>

Appreciate it. I think Makie is a fantastic framework for plotting in Julia. Thank you @jules
