# Plotting to many points with CairoMakie results in empty rendered images

**URL:** <https://discourse.julialang.org/t/plotting-to-many-points-with-cairomakie-results-in-empty-rendered-images/90933>\
**Category:** Visualization\
**Tags:** error, makie\
**Created:** [November 28, 2022, 3:42am UTC](https://discourse.julialang.org/t/plotting-to-many-points-with-cairomakie-results-in-empty-rendered-images/90933 "2022-11-28T03:42:25Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ceboc](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ceboc/32/44696_2.png) [@Ceboc](https://discourse.julialang.org/u/Ceboc)\
**Post date:** [November 28, 2022, 3:42am UTC](https://discourse.julialang.org/t/plotting-to-many-points-with-cairomakie-results-in-empty-rendered-images/90933/1 "2022-11-28T03:42:25Z")

</div>

Hi everybody,  
This is my first post here even when i’m a very “old” Julia user, I learned this language since v.0.3.2, and I’m very grateful with all the developers of Julia and Makie.

My matter is this, I need to plot two matrices of experimental data each one with 512 x 8001 points. I can’t show you the real data because it will be published, but I prepared matrices with dummy data that resembles the real issue. When I plot them with GLMakie the plots are correctly shown in the pop up window.

But, when i tried save the plot using CairoMakie as PDF of PNG, these are my results:

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

I know that is something related with the number of points because, I tried it again with less points, and I got the plots correctly. Is there something that I can do to resolve my problem?

To make things worse, I got no error messages.

Thanks in advance.

---

<div class="post-metadata">

**Author:** ![Ceboc](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ceboc/32/44696_2.png) [@Ceboc](https://discourse.julialang.org/u/Ceboc)\
**Post date:** [November 28, 2022, 3:45am UTC](https://discourse.julialang.org/t/plotting-to-many-points-with-cairomakie-results-in-empty-rendered-images/90933/2 "2022-11-28T03:45:25Z")

</div>

This is how it supposed to look like. (I’m new here so I can’t post more than a single image.)

 ![Makie_1](https://global.discourse-cdn.com/julialang/original/3X/c/5/c5c079c1044b7c6ceee2da4329c0ee560a37ce26.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:** [November 28, 2022, 5:51am UTC](https://discourse.julialang.org/t/plotting-to-many-points-with-cairomakie-results-in-empty-rendered-images/90933/3 "2022-11-28T05:51:19Z")

</div>

> [@Ceboc](#):
>
> PDF of PNG

Do you mean PDF **or** PNG? Meshes in cairomakie are drawn in a less sophisticated way than in GLMakie (painter’s algorithm without z buffer) but I don’t see why a png wouldn’t work. No matter how many times you draw a triangle on a bitmap, you still only have a fixed size bitmap. It’s different for pdf because there you make the resulting file huge if you add tons of mesh triangle primitives.

You could try adding `rasterize = 1` (or 2, 3, etc) to the `surface` call because that will flatten the resulting mesh objects in the pdf into a single bitmap.

---

<div class="post-metadata">

**Author:** ![fatteneder](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/fatteneder/32/33991_2.png) [@fatteneder](https://discourse.julialang.org/u/fatteneder)\
**Post date:** [November 28, 2022, 11:20am UTC](https://discourse.julialang.org/t/plotting-to-many-points-with-cairomakie-results-in-empty-rendered-images/90933/4 "2022-11-28T11:20:37Z")

</div>

I could reproduce the problem locally and I open an issue for it: [`CairoMakie`'s png output empty for large enough surface plot · Issue #2454 · MakieOrg/Makie.jl · GitHub](https://github.com/MakieOrg/Makie.jl/issues/2454)
