Compose.jl basic usage

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:

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

Thank you very much for your help

BTW I use Julia 6.2 and 6.4. Surprisingly enough the drawing is a bit different with 6.2 :wink:
toto

An additional question: is compose.jl widely used ?

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

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 (scroll down).

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.

I post an issue on the Compose.jl github

1 Like