# Contour\_labels absent when scale=:log10 in GR

**URL:** <https://discourse.julialang.org/t/contour-labels-absent-when-scale-log10-in-gr/80458>\
**Category:** Visualization\
**Tags:** question, plots, gr\
**Created:** [May 4, 2022, 3:04am UTC](https://discourse.julialang.org/t/contour-labels-absent-when-scale-log10-in-gr/80458 "2022-05-04T03:04:08Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![bcon](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bcon/32/23495_2.png) [@bcon](https://discourse.julialang.org/u/bcon)\
**Post date:** [May 4, 2022, 3:04am UTC](https://discourse.julialang.org/t/contour-labels-absent-when-scale-log10-in-gr/80458/1 "2022-05-04T03:04:08Z")

</div>

I can’t get GR to draw `contour_labels` when axes are log-scaled:

```julia
using Plots
using FileIO

x = 1:0.5:20
y = 1:0.5:10

f(x, y) = (3x + y ^ 2) * abs(sin(x) + cos(y))

pyplot()
p1 = contour(x, y, f, 
  fill=false,
  scale=:identity,
  contour_labels=true, 
  foreground_color=:blue,
  )
p2 = contour(x, y, f, 
  fill=false,
  scale=:log10,
  contour_labels=true, 
  foreground_color=:blue,
  )
p = plot(p1, p2, size=(1200,500), dpi=300,)
savefig(p, "/tmp/contour_pyplot.png")

gr()
p1 = contour(x, y, f, 
  fill=false,
  scale=:identity,
  contour_labels=true, 
  foreground_color=:blue,
  )
p2 = contour(x, y, f, 
  fill=false,
  scale=:log10,
  contour_labels=true, 
  foreground_color=:blue,
  )
p = plot(p1, p2, size=(1200,500), dpi=300,)
savefig(p, "/tmp/contour_gr.png")

p1 = plot(load("/tmp/contour_pyplot.png"), title="pyplot")
p2 = plot(load("/tmp/contour_gr.png"), title="gr")
p = plot(p1,p2, layout=(2,1), size=(1200,1200), dpi=300,)
savefig(p, "/tmp/comparison.png")
return p

```

 ![comparison](https://global.discourse-cdn.com/julialang/original/3X/7/e/7e22c57a2a60254a6c2daaf6eeb597dfa7d88fe8.jpeg)

This is under Julia 1.7, Plots v1.28.0, PyPlot v2.10.0, GR v0.64.2.

Possibly related to [#2430](https://github.com/JuliaPlots/Plots.jl/issues/2430).  
`contour_labels` and `scale` are individually [supported](https://docs.juliaplots.org/latest/generated/supported/).  
It’s possible they are being drawn off-camera, at some non-scaled location; can anyone show me how to inspect the figure properties like you can in Matlab? Any other suggestions or should I file a bug in Plots?

Thanks, Ben

---

<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:** [May 4, 2022, 8:58am UTC](https://discourse.julialang.org/t/contour-labels-absent-when-scale-log10-in-gr/80458/2 "2022-05-04T08:58:16Z")

</div>

If we try to bypass Plots.jl and use GR, the problem seems to be there too:

```julia
using GRUtils
f(x, y) = (3x + y ^ 2) * abs(sin(x) + cos(y))
x, y = 1:0.5:20, 1:0.5:10
contour(x, y, f, colorbar=false, xlog=true, ylog=true)

```

It might be a case for opening an issue in GR.  
Copying @jheinen, to confirm.

---

<div class="post-metadata">

**Author:** ![jheinen](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jheinen/32/2787_2.png) [@jheinen](https://discourse.julialang.org/u/jheinen)\
**Post date:** [May 4, 2022, 10:09am UTC](https://discourse.julialang.org/t/contour-labels-absent-when-scale-log10-in-gr/80458/3 "2022-05-04T10:09:48Z")

</div>

I just fixed the problem in the GR development branch. Will tag a new release in the next days …
