nschloe / tikzplotlib

:bar_chart: Save matplotlib figures as TikZ/PGFplots for smooth integration into LaTeX.
MIT License
2.39k stars 212 forks source link

Streaplots with multicoloured lines bug #586

Open strangeflavoured opened 1 year ago

strangeflavoured commented 1 year ago

Streamplots with multicoloured lines arent properly coloured when the tikzplot is created. I solved the issue by adding the following snippet to _line2d.draw_linecollection (has to be before edgecolors = obj.get_edgecolors()):

obj.update_scalarmappable()

I'm not sure if it solves all cases or there are similar issues elsewhere, but this worked for me!