I’d like to plot a stream of data in a separate thread. Using Makie works up to a point, but the axis labels seem to come out wrong and it occasionally crashes. I don’t know if I’m doing something wrong or if it’s a limitation of Makie. I’ve had several problems with Makie recently (colorlegend() seems to have disappeared and lines!() and xlabel!() seem to break) so I’m wondering if there’s something wrong with my installation. Reinstalling Julia entirely didn’t help. I’m using VSCode on Windows 10. Any help would be gratefully received.
For example
Threads.@spawn begin
h = Makie.lines(1:10:100, rand(10))
display(h)
end
Thanks for the replies. I thought it might be thread safe enough if I only used it in a single thread but there’s probably a lot going on I don’t understand. At least it updates plots fast enough to keep up with my data stream so I’ll carry on using it and hope full thread safety comes eventually.
I’ll try out Colorbar and take another look at the docs - thanks.
I guess one can get lucky, but it’s definitely not designed with thread-safety in mind. FreeType for example is generally not threadsafe if I remember correctly.
Sorry, it’s a while since I wrote that bit of our system and I misremembered what I’d done. I think GLMakie does indeed cause Julia to crash if you call it from more than one thread but it seems to be OK in a multi-threaded situation if all the calls are in only one of the threads. In my case I put all the GLMakie calls in thread 2 and feed it with data from thread 3 via a Channel.
As described in my original post that used to cause problems with the axis labels but it seems OK now.