(X-Post from Zulip)Hi all! I have a list of Polygons and would like to plot all

(X-Post from Zulip)

Hi all! I have a list of Polygons and would like to plot all the shapes on the same plot where each shape has a different color. What I have been doing is something like this:


using Plots

....

for (num, shape) in enumerate(list_of_shapes)
    plot!(shape, fillcolor = list_of_colors[num])
end

Is there a faster way of doing this? Thanks!

Note that the original poster on Slack cannot see your response here on Discourse. Consider transcribing the appropriate answer back to Slack, or pinging the poster here on Discourse so they can follow this thread.
(Original message :slack:) (More Info)

1 Like

Thanks to @BioTurboNick we have a solution for this!

“Oh sorry, forgot the other trick: Has to be a 1-row matrix, not a vector. I believe Plots matches columns with series. So, [this should work]:”

plot(list_of_shapes, fillcolor=permutedims(list_of_colors))