# Multiple 2D plots with both axes logarithmically scaled

**URL:** <https://discourse.julialang.org/t/multiple-2d-plots-with-both-axes-logarithmically-scaled/42333>\
**Category:** General Usage\
**Tags:** question, plotting\
**Created:** [July 1, 2020, 2:13am UTC](https://discourse.julialang.org/t/multiple-2d-plots-with-both-axes-logarithmically-scaled/42333 "2020-07-01T02:13:13Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![fusion809](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/fusion809/32/6080_2.png) [@fusion809](https://discourse.julialang.org/u/fusion809)\
**Post date:** [July 1, 2020, 2:13am UTC](https://discourse.julialang.org/t/multiple-2d-plots-with-both-axes-logarithmically-scaled/42333/1 "2020-07-01T02:13:13Z")

</div>

I’m doing some error analysis and it would be handy if I could display errors with both axes scaled logarithmically in multiple separate plot windows. See, I have four vectors (`diffc1`, `diffc2`, `diffc3`, `diffc4`) containing errors that I’d like to plot in separate windows with each plot window having logarithmically scaled axes. I know how to do this if only the y-axis has a logarithmic scale, namely using:

```julia
using PyPlot
PyPlot.figure(1)
# nc has my x-axis values
PyPlot.semilogy(nc, diffc1)
PyPlot.figure(2)
PyPlot.semilogy(nc, diffc2)
PyPlot.figure(3)
PyPlot.semilogy(nc, diffc3)
PyPlot.figure(4)
PyPlot.semilogy(nc, diffc4)

```

and I know how to scale both axes logarithmically and produce just one plot window at a time, namely using:

```julia
using Plots
plot(nc, diffc1, xaxis=:log, yaxis=:log)

```

but I don’t know how to produce multiple plots at a time with both axes scaled logarithmically. I’ve looked for an equivalent option for Plots to PyPlot’s `figure()`, but I cannot find one.

---

<div class="post-metadata">

**Author:** ![fusion809](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/fusion809/32/6080_2.png) [@fusion809](https://discourse.julialang.org/u/fusion809)\
**Post date:** [July 1, 2020, 4:44am UTC](https://discourse.julialang.org/t/multiple-2d-plots-with-both-axes-logarithmically-scaled/42333/2 "2020-07-01T04:44:42Z")

</div>

I solved my own problem. I did some research, but that actually didn’t solve the problem (as the results pertained to using PyPlot in Python), but I just typed `xscale` into a Julia prompt and lucked out that it was a defined function and I looked at its docs and figured out how to use it and its y-counterpart `yscale`.

This is the code required for my particular problem:

```julia
using PyPlot
PyPlot.figure(1)
PyPlot.plot(nc, diffc1); 
xscale("log")
yscale("log")
PyPlot.figure(2)
PyPlot.plot(nc, diffc2); 
xscale("log")
yscale("log")
PyPlot.figure(3)
PyPlot.plot(nc, diffc3); 
xscale("log")
yscale("log")
PyPlot.figure(4)
PyPlot.plot(nc, diffc4)
xscale("log")
yscale("log")

```
