Can you draw one continuous line with many points, and a different pen for each segment? So instead of having n pairs of points you have 2n points, and have the pen be alternatingly the color/width you want (between endpoints of a segment) and None (going to the next segment).
I know that pg.PlotDataItem() takes a connect= argument. If you can get by with a smaller number of line widths and colors (because 2.3 pixels wide in color #f37492 is visually indistinguishable from 2.1 pixels wide #f76f93) you can group the line segments into a few dozen classes and draw each group separately. On Wednesday, December 28, 2016 at 1:56:31 AM UTC-7, Edmon Silva wrote: > > For a network visualization algorithm, I need to draw thousands of lines > in 3D space, each in *different color and width*. Currently I'm > using gl.GLLinePlotItem create these lines and add them within a for-loop. > As expected, it's extremely slow. Any suggestions to improve the > performances? > (I checked another topic > <https://groups.google.com/forum/#!msg/pyqtgraph/x5ROUR6MEMY/HE-fLvF2oNAJ;context-place=forum/pyqtgraph>on > > the similar problem, but unable to adapt that solution to my problem.) > > Also, I need to draw curved lines in 3D space? Do I have to use small > segments of straight lines that are created using gl.GLLinePlotItem? Is > there any other technique? > -- You received this message because you are subscribed to the Google Groups "pyqtgraph" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/pyqtgraph/166475f5-3ae7-498c-bba7-12ef546c7899%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
