# How to set the size of images display in Plots window

**URL:** <https://discourse.julialang.org/t/how-to-set-the-size-of-images-display-in-plots-window/57049>\
**Category:** VS Code\
**Tags:** plots\
**Created:** [March 12, 2021, 11:39pm UTC](https://discourse.julialang.org/t/how-to-set-the-size-of-images-display-in-plots-window/57049 "2021-03-12T23:39:41Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![joeynelson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/joeynelson/32/16684_2.png) [@joeynelson](https://discourse.julialang.org/u/joeynelson)\
**Post date:** [March 12, 2021, 11:39pm UTC](https://discourse.julialang.org/t/how-to-set-the-size-of-images-display-in-plots-window/57049/1 "2021-03-12T23:39:41Z")

</div>

I’m doing some working with images using the Images package, and when larger images are displayed they are scaled smaller than the actual size. How do I change this?

```julia
img = Gray.(rand(1200,1200))

```

---

<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:** [March 13, 2021, 10:30pm UTC](https://discourse.julialang.org/t/how-to-set-the-size-of-images-display-in-plots-window/57049/4 "2021-03-13T22:30:13Z")

</div>

The following code using Plots’ `gr()` backend displays images that are proportionally scaled in subplots.

```julia
using Images, Plots; gr(titlefontsize=16)

plt = Array{Plots.Plot{Plots.GRBackend}}(undef,3)
img1 = Gray.(rand(600,600))
img2 = Gray.(rand(150,300))
img3 = Gray.(rand(300,1200))
plt[1] = plot(img1, title="600x600");
plt[2] = plot(img2, title="150x300");
plt[3] = plot(img3, title="300x1200");
h1, w1 = size(img1); h2, w2 = size(img2); h3, w3 = size(img3)
h = [h1,h2,h3]; w = [w1,w2,w3]
hs, ws = sum(h), sum(w)
hn = h/hs; wn = w/ws # to use with grid heights and/or widths
Plots.plot(plt..., layout = grid(1, 3, widths=wn), axis=nothing) # images scaled in subplots
Plots.plot!(size=(ws,maximum(h)))

```

 ![Subplot_images_relative_size](https://global.discourse-cdn.com/julialang/original/3X/2/b/2b2383a1fb2dc013bf5d2ceb7dae715dc0227ed3.png)

For plotting individual images with correct relative sizes:

```julia
Plots.plot(img1, size=(w1,h1))
Plots.plot(img2, size=(w2,h2))
Plots.plot(img3, size=(w3,h3))

```

Or use [ImageView.jl](https://github.com/JuliaImages/ImageView.jl/blob/master/README.md):

```julia
using Images, ImageView
imshow(img1)
imshow(img2)
imshow(img3)

```
