# Make a Compose.jl composition square

**URL:** <https://discourse.julialang.org/t/make-a-compose-jl-composition-square/78585>\
**Category:** Visualization\
**Created:** [March 28, 2022, 4:02am UTC](https://discourse.julialang.org/t/make-a-compose-jl-composition-square/78585 "2022-03-28T04:02:09Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![theta](https://avatars.discourse-cdn.com/v4/letter/t/54ee81/32.png) [@theta](https://discourse.julialang.org/u/theta)\
**Post date:** [March 28, 2022, 4:02am UTC](https://discourse.julialang.org/t/make-a-compose-jl-composition-square/78585/1 "2022-03-28T04:02:09Z")

</div>

I’m messing with Compose.jl, and I noticed that the “canvas” isn’t square like I would expect. Does anyone know how to create an explicitly square canvas? I’m using ElectronDisplay to view the SVG output from Compose, but when I save a composition as an SVG and view it in Inkscape, the problem persists.

Example:  
This is the output from `composition = compose(context(), circle(0.25,0.25,0.1), circle(0.25,0.75,0.1), circle(0.75,0.25,0.1), circle(0.75,0.75,0.1))`

 ![compose-problem](https://global.discourse-cdn.com/julialang/original/3X/1/a/1a57427df6c7305cdb193c6d17c8b711c2e9f165.png)

---

<div class="post-metadata">

**Author:** ![gustaphe](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gustaphe/32/18174_2.png) [@gustaphe](https://discourse.julialang.org/u/gustaphe)\
**Post date:** [March 28, 2022, 4:18am UTC](https://discourse.julialang.org/t/make-a-compose-jl-composition-square/78585/2 "2022-03-28T04:18:29Z")

</div>

The first example in [the Compose tutorial](https://giovineitalia.github.io/Compose.jl/latest/tutorial/) uses

```julia
draw(SVG("tomato.svg", 4cm, 4cm), composition)

```

. Do you want something like that?

---

<div class="post-metadata">

**Author:** ![theta](https://avatars.discourse-cdn.com/v4/letter/t/54ee81/32.png) [@theta](https://discourse.julialang.org/u/theta)\
**Post date:** [March 28, 2022, 4:30am UTC](https://discourse.julialang.org/t/make-a-compose-jl-composition-square/78585/3 "2022-03-28T04:30:42Z")

</div>

Is there a way to specify size without saving to a file? To get a proportional tomato-bisque example, I tried `composition = compose(context(1cm, 1cm), (context(), circle(), fill("bisque")), (context(), rectangle(), fill("tomato")))` and `composition = compose(context(1cm, 1cm), (context(1cm, 1cm), circle(), fill("bisque")), (context(1cm, 1cm), rectangle(), fill("tomato")))`, but both yielded strange and unwanted results. I’d rather not save to a file every time I want a proportionate image.

---

<div class="post-metadata">

**Author:** ![gustaphe](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gustaphe/32/18174_2.png) [@gustaphe](https://discourse.julialang.org/u/gustaphe)\
**Post date:** [March 28, 2022, 5:06am UTC](https://discourse.julialang.org/t/make-a-compose-jl-composition-square/78585/4 "2022-03-28T05:06:59Z")

</div>

Try

```julia
set_default_graphic_size(4cm, 4cm)

```

---

<div class="post-metadata">

**Author:** ![Mattriks](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mattriks/32/351_2.png) [@Mattriks](https://discourse.julialang.org/u/Mattriks)\
**Post date:** [March 28, 2022, 5:14am UTC](https://discourse.julialang.org/t/make-a-compose-jl-composition-square/78585/5 "2022-03-28T05:14:37Z")

</div>

or e.g. `draw(PNG(4cm, 4cm), composition)` works in jupyter, to set individual composition size.
