Skip to content

Colors lost when using large vectors... #435

@hdavid16

Description

@hdavid16

An issue came up in GraphPlot.jl that turns out to actually be an issue in Compose.jl (JuliaGraphs/GraphPlot.jl#156)

MWE:
Make a plot with many red circles

n = 10
g = compose(
    context(), 
    Compose.circle(rand(n),rand(n),rand(n)/100), 
    fill([colorant"red" for i in 1:n]), 
    Compose.stroke(nothing)
)

image

The saving g (e.g., to PDF) or just displaying it on an IDE, looks the same as snapshot above.

However, if you increase the number of circles to 100:
You get the correct plot on an IDE, but when saving it to PDF or redisplaying g, the color is lost.
Inital plot with 100 circles:
image
Calling g in the REPL again or saving as say PDF, the red color switches over to black:
image
However, if the stroke is replaced with a Vector of the same size as the fill, the color is not lost when saving or redisplaying the figure.

n=100
g=compose(
    context(), 
    Compose.circle(rand(n),rand(n),rand(n)/100), 
    fill([colorant"red" for i in 1:n]), 
    Compose.stroke([nothing for i in 1:n])
)

There seems to be a glich when vectors are used in some functions, but not in others. But this only occurs when the size of the vectors is large. This behavior is observed with other functions such as fontsize and linewidth.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions