# How to properly set log axis scale with a 2d color plot?

**URL:** https://discourse.julialang.org/t/how-to-properly-set-log-axis-scale-with-a-2d-color-plot/46481
**Category:** Visualization
**Tags:** plotting, plots
**Created:** [September 11, 2020, 10:13pm UTC](https://discourse.julialang.org/t/how-to-properly-set-log-axis-scale-with-a-2d-color-plot/46481 "2020-09-11T22:13:51Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Torkel](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/torkel/32/5030_2.png) [@Torkel](https://discourse.julialang.org/u/Torkel)
#### Post date: [September 11, 2020, 10:13pm UTC](https://discourse.julialang.org/t/how-to-properly-set-log-axis-scale-with-a-2d-color-plot/46481/1 "2020-09-11T22:13:51Z")

</div>

I have a program which scans a 2d parameter space. For each point in the parameter space, it generates a colour (corresponding to system behaviours). The grid points are log10-log10 distributed. I wish to plot this, but cannot get the axis ticks to display properly, see attached code an image:

```julia
using Plots

x_grid = 10 .^(range(-0,stop=2,length=100))
y_grid = 10 .^(range(-0,stop=2,length=100))
color_grid = get_color_grid(x_grid,y_grid)

p1 = plot(y_grid,x_grid,color_grid,yflip=false,aspect_ratio=:none)
p2 = plot(y_grid,x_grid,color_grid, xscale=:log10,yscale=:log10,yflip=false,aspect_ratio=:none)
plot(p1,p2,size=(800,350))

```

this results in:

 ![log_2d_plot](https://global.discourse-cdn.com/julialang/original/3X/1/b/1bc8075c594f82b587663d70762cff4ef3d3a124.png)

Now, I basically want axis values like in the right plot, but on the plot to the left. I want a normal square grid of all my grid colors, like in the rightnost plot. But in the rightmost plot the axis values are all wrong (where it displays the value of 40, it should instead be 10 .^(range(-0,stop=2,length=100)[40])

Any ideas of how I achive this?

---

<div class="post-metadata">

### Author: ![daschw](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/daschw/32/2926_2.png) [@daschw](https://discourse.julialang.org/u/daschw)
#### Post date: [October 21, 2020, 12:33pm UTC](https://discourse.julialang.org/t/how-to-properly-set-log-axis-scale-with-a-2d-color-plot/46481/2 "2020-10-21T12:33:41Z")

</div>

Crosspost of my answer in the GitHub issue ([https://github.com/JuliaPlots/Plots.jl/issues/3013](https://github.com/JuliaPlots/Plots.jl/issues/3013)):

You can provide the ticks and labels manually by passing a tuple of tick positions (vector of reals) and tick labels (vector of strings) to the `ticks` attribute:

```julia
plot(
    y_grid,
    x_grid,
    color_grid,
    yflip = false,
    ticks = (range(1, 100, length = 5), ticklabels),
)

```
