# Compose.jl basic usage

**URL:** <https://discourse.julialang.org/t/compose-jl-basic-usage/14185>\
**Category:** Visualization\
**Created:** [August 28, 2018, 12:05pm UTC](https://discourse.julialang.org/t/compose-jl-basic-usage/14185 "2018-08-28T12:05:18Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![LaurentPlagne](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/laurentplagne/32/10103_2.png) [@LaurentPlagne](https://discourse.julialang.org/u/LaurentPlagne)\
**Post date:** [August 28, 2018, 12:05pm UTC](https://discourse.julialang.org/t/compose-jl-basic-usage/14185/1 "2018-08-28T12:05:19Z")

</div>

Hi,  
I try to use compose.jl and I fail to understand the very basic usage of it.

I want to draw a circle and a text, and it works until I try to put a black line around the circle (stroke which is not in the documentation BTW). A black line is drawn between the text and the circle:

how to remove it ?

Here is the MWE:

```julia
using Compose

c=compose(context(),circle(0.5,0.5,0.3),fill("red"),stroke("black"))
t=compose(context(),text(0.2,0.2,"toto"),fill("black"))

img=compose(context(),c,t)
draw(PDF("toto.pdf",6cm,6cm), img)

```

Here is what I obtain:  
 ![toto](https://global.discourse-cdn.com/julialang/original/3X/7/8/78eab06bf011b3792aba26066ae9f7a417a49fc9.jpeg)

Thank you very much for your help

---

<div class="post-metadata">

**Author:** ![LaurentPlagne](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/laurentplagne/32/10103_2.png) [@LaurentPlagne](https://discourse.julialang.org/u/LaurentPlagne)\
**Post date:** [August 28, 2018, 5:12pm UTC](https://discourse.julialang.org/t/compose-jl-basic-usage/14185/2 "2018-08-28T17:12:14Z")

</div>

> [@LaurentPlagne](#):
>
> c=compose(context(),circle(0.5,0.5,0.3),fill(“red”),stroke(“black”)) t=compose(context(),text(0.2,0.2,“toto”),fill(“black”)) img=compose(context(),c,t) draw(PDF(“toto.pdf”,6cm,6cm), img)

BTW I use Julia 6.2 and 6.4. Surprisingly enough the drawing is a bit different with 6.2 😉  
 ![toto](https://global.discourse-cdn.com/julialang/original/3X/5/d/5d7de74dbc3f03e40ac5806bbaba68dbd31e6043.jpeg)

An additional question: is compose.jl widely used ?

---

<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:** [August 28, 2018, 6:00pm UTC](https://discourse.julialang.org/t/compose-jl-basic-usage/14185/3 "2018-08-28T18:00:42Z")

</div>

I don’t know why, but order seems to matter for `text` and `circle`:

```julia
img = compose(context(),
        (context(), rectangle(0.4, 0.7, 0.2, 0.2), stroke("black"), fill("white")),
        (context(), text(0.2,0.2,"toto")),
        (context(), circle(0.5,0.5,0.2), fill("red"), stroke("black"))
    )
 draw(PDF("toto2.pdf",6cm,6cm), img)

```

There is a list of packages that use `Compose` at [Julia Observer](https://juliaobserver.com/packages/Compose) (scroll down).

---

<div class="post-metadata">

**Author:** ![LaurentPlagne](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/laurentplagne/32/10103_2.png) [@LaurentPlagne](https://discourse.julialang.org/u/LaurentPlagne)\
**Post date:** [August 28, 2018, 9:35pm UTC](https://discourse.julialang.org/t/compose-jl-basic-usage/14185/4 "2018-08-28T21:35:03Z")

</div>

Thank you very much !

If some Compose.jl expert (which seems to be widely used despite its laconic documentation) could explain how/why this order matters it could probably save me from future mistakes.

---

<div class="post-metadata">

**Author:** ![LaurentPlagne](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/laurentplagne/32/10103_2.png) [@LaurentPlagne](https://discourse.julialang.org/u/LaurentPlagne)\
**Post date:** [August 29, 2018, 7:03am UTC](https://discourse.julialang.org/t/compose-jl-basic-usage/14185/5 "2018-08-29T07:03:06Z")

</div>

I post an issue on the Compose.jl github
