# Scale axes in heatmap/plot

**URL:** <https://discourse.julialang.org/t/scale-axes-in-heatmap-plot/46375>\
**Category:** General Usage\
**Tags:** plotting\
**Created:** [September 10, 2020, 12:13pm UTC](https://discourse.julialang.org/t/scale-axes-in-heatmap-plot/46375 "2020-09-10T12:13:44Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![marrdoc](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/marrdoc/32/13757_2.png) [@marrdoc](https://discourse.julialang.org/u/marrdoc)\
**Post date:** [September 10, 2020, 12:13pm UTC](https://discourse.julialang.org/t/scale-axes-in-heatmap-plot/46375/1 "2020-09-10T12:13:44Z")

</div>

I want to plot the magnitude of the values of a certain function with complex arguments. Thus, I created two LinRanges (for real and imaginary part) and fed the function with it to obtain a matrix.  
Now I plotted the function with a heatmap.

Problem: the label of the xaxis and yaxis are from `1:size(LinRange,1)` (in my example i.e. 1:100) but I want them to run from the actual values, i.e. e.g.

- x-axis: [0.01,5] (real part of the argument)
- y-axis: [-0.01,-0.3] (imaginary part of the argument)

I guess I somehow had to rescale the axes in a certain manner but I cannot find which command does the trick. Could anyone pls help me out?

---

<div class="post-metadata">

**Author:** ![lmiq](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lmiq/32/18314_2.png) [@lmiq](https://discourse.julialang.org/u/lmiq)\
**Post date:** [September 10, 2020, 12:24pm UTC](https://discourse.julialang.org/t/scale-axes-in-heatmap-plot/46375/2 "2020-09-10T12:24:49Z")

</div>

You can use the xticks keyword, I think, with:

` xticks=(1:1:20, yourlabelslist)`

There is one use this here, although not for heatmaps, where the ticks are changed to arbitrary labels, in this case residue names:

> **[Tips to create beautiful, publication-quality plots in Julia](https://nextjournal.com/leandromartinez98/tips-to-create-beautiful-publication-quality-plots-in-julia)**
>
> I was about to send an e-mail to my students with a series of tips to produce good looking plots with Julia, and decided to post the tips here instead. I hope this is useful for more people, and please let me know of any other tips, nice examples,...

---

<div class="post-metadata">

**Author:** ![Raf](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/raf/32/3383_2.png) [@Raf](https://discourse.julialang.org/u/Raf)\
**Post date:** [September 10, 2020, 12:54pm UTC](https://discourse.julialang.org/t/scale-axes-in-heatmap-plot/46375/3 "2020-09-10T12:54:09Z")

</div>

I think this is what you want:

```julia
heatmap(xaxisvalues, yaxisvalues, matrix)

```
