# How to specify the DPI while saving a Makie figure?

**URL:** <https://discourse.julialang.org/t/how-to-specify-the-dpi-while-saving-a-makie-figure/66588>\
**Category:** General Usage\
**Tags:** makie\
**Created:** [August 18, 2021, 7:56am UTC](https://discourse.julialang.org/t/how-to-specify-the-dpi-while-saving-a-makie-figure/66588 "2021-08-18T07:56:14Z")\
**Posts on this page:** 1\
**Showing post:** 2

<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:** [August 18, 2021, 9:31am UTC](https://discourse.julialang.org/t/how-to-specify-the-dpi-while-saving-a-makie-figure/66588/2 "2021-08-18T09:31:00Z")

</div>

If you save as a bitmap, multiply your size in inches by your desired dpi to get the resolution in pixels. Then save with `px_per_unit = 1` (that is the default anyway but can be changed).

If you save as a pdf or svg using CairoMakie, calculate how many pt correspond to the width in inches you want and set that, then save with the keyword argument `pt_per_unit = 1` (the default is 0.75 to match bitmap sizes in web contexts because 1px == 0.75pt).

1in == 72pt, so for your desired size do:

```julia
f = Figure(resolution = (3.25, 2.4) .* 72)
save("figure.pdf", pt_per_unit = 1)

```

(Maybe you need to round the resolution to Int)

---

_[View the full topic](https://discourse.julialang.org/t/how-to-specify-the-dpi-while-saving-a-makie-figure/66588)._
