# Error in conversion pipeline. xs and ys should have size ni+1, nj+1

**URL:** <https://discourse.julialang.org/t/error-in-conversion-pipeline-xs-and-ys-should-have-size-ni-1-nj-1/102372>\
**Category:** Visualization\
**Tags:** dsp, cairomakie\
**Created:** [August 1, 2023, 7:59pm UTC](https://discourse.julialang.org/t/error-in-conversion-pipeline-xs-and-ys-should-have-size-ni-1-nj-1/102372 "2023-08-01T19:59:21Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![CosmicSpittle](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/cosmicspittle/32/24028_2.png) [@CosmicSpittle](https://discourse.julialang.org/u/CosmicSpittle)\
**Post date:** [August 1, 2023, 7:59pm UTC](https://discourse.julialang.org/t/error-in-conversion-pipeline-xs-and-ys-should-have-size-ni-1-nj-1/102372/1 "2023-08-01T19:59:21Z")

</div>

Hi - Can someone tell me what this error means?

```julia
Error in conversion pipeline. xs and ys should have size ni+1, nj+1.

```

I am trying to create a spectrogram heatmap in CairoMakie. I’ve created some test data (called test) from a wav file using the spectrogram function in the DSP.jl package.

If I try to create the heatmap using:

```julia
CairoMakie.heatmap(test.time, test.freq, pow2db.(test.power))

```

I get the above error.

I can generate the heatmap using Plots.jl:

```julia
Plots.heatmap(test.time, test.freq, pow2db.(test.power), 
        xlabel="Time (seconds)", 
        ylabel="Frequency (Hz)",
        fillcolor = :jet,
        title="Spectrogram from WAV File")

```

Thank you for any insight!

---

<div class="post-metadata">

**Author:** ![CosmicSpittle](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/cosmicspittle/32/24028_2.png) [@CosmicSpittle](https://discourse.julialang.org/u/CosmicSpittle)\
**Post date:** [August 22, 2023, 5:35pm UTC](https://discourse.julialang.org/t/error-in-conversion-pipeline-xs-and-ys-should-have-size-ni-1-nj-1/102372/2 "2023-08-22T17:35:32Z")

</div>

I can resolve the CairoMakie heatmap issue if I transpose the values for the ‘z’ element:

```julia
CairoMakie.heatmap(test.time, test.freq, transpose(pow2db.(test.power)))

```

I don’t know why it works in the Plots.jl package without the transpose.

---

<div class="post-metadata">

**Author:** ![Luis](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/luis/32/25789_2.png) [@Luis](https://discourse.julialang.org/u/Luis)\
**Post date:** [November 24, 2023, 9:52am UTC](https://discourse.julialang.org/t/error-in-conversion-pipeline-xs-and-ys-should-have-size-ni-1-nj-1/102372/3 "2023-11-24T09:52:38Z")

</div>

I get the same error when I want to save a heatmap as a pdf. Producing the plot works fine, even saving as a png works. But when trying to save it as a pdf i get the same error as described above. I also would be grateful for any insight. Thank you!

---

<div class="post-metadata">

**Author:** ![drandran12](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/drandran12/32/220647_2.png) [@drandran12](https://discourse.julialang.org/u/drandran12)\
**Post date:** [February 3, 2026, 3:36pm UTC](https://discourse.julialang.org/t/error-in-conversion-pipeline-xs-and-ys-should-have-size-ni-1-nj-1/102372/4 "2026-02-03T15:36:44Z")

</div>

You can also add the rasterize=true kwarg to avoid the error
