# Plots.heatmap negative axis bug

**URL:** <https://discourse.julialang.org/t/plots-heatmap-negative-axis-bug/86268>\
**Category:** Visualization\
**Tags:** plots\
**Created:** [August 24, 2022, 3:15pm UTC](https://discourse.julialang.org/t/plots-heatmap-negative-axis-bug/86268 "2022-08-24T15:15:24Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Allan\_Baker](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/allan_baker/32/42645_2.png) [@Allan\_Baker](https://discourse.julialang.org/u/Allan_Baker)\
**Post date:** [August 24, 2022, 3:15pm UTC](https://discourse.julialang.org/t/plots-heatmap-negative-axis-bug/86268/1 "2022-08-24T15:15:24Z")

</div>

Ever notice how if you put values for the x-axis or y-axis that start positive and go negative, the heatmap can’t make the plot.

```julia
FF=rand(10,20)
 Plots.heatmap(1:20,1:10,FF) # What it should look like
Plots.heatmap(1:20,-1:-1:-10,FF) # I'd like a different Y axis representation -- does not look correct
Plots.heatmap(-1:-1:-20,1:10,FF) # Also does not look correct
#I have to do something like this:
values=[string(Int(round(i))) for i in -1:-1:-20]
Plots.heatmap(values,1:10,FF)
# This messes up the plotlyjs smart highlighter.

```

Seems like a bug

---

<div class="post-metadata">

**Author:** ![rafael.guerra](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rafael.guerra/32/216610_2.png) [@rafael.guerra](https://discourse.julialang.org/u/rafael.guerra)\
**Post date:** [August 24, 2022, 3:49pm UTC](https://discourse.julialang.org/t/plots-heatmap-negative-axis-bug/86268/2 "2022-08-24T15:49:04Z")

</div>

> [@Allan\_Baker](#):
>
> ```julia
> values=[string(Int(round(i))) for i in -1:-1:-20]
> Plots.heatmap(values,1:10,FF)
> 
> ```

I would recommend using built-in Julia tools instead:

```julia
heatmap(-20:-1, 1:10, reverse(FF,dims=2), xflip=true)

```

**NB:**  
Not sure it is a bug as Plots.jl warns that: _points are not sorted in ascending order_
