In a plot I would like to display different data. This results in having some problems with performance some times. For example, I must generate a grid, that has a custom X spacing and Y spacing. To achieve that, I do the following:
# Plot the lines in a 10x10 world
for a in range( int(5/xSpacing) ):
p1.plot([a*xSpacing, a*xSpacing], [-5, 5], pen=(150, 150, 150))
p1.plot([-a*xSpacing, -a*xSpacing], [-5, 5], pen=(150, 150, 150))
for b in range( int(5/ySpacing) ):
p1.plot([-5, 5], [b*ySpacing, b*ySpacing], pen=(150, 150, 150))
p1.plot([-5, 5], [-b*ySpacing, -b*ySpacing], pen=(150, 150, 150))
This approach works. But if the lines that have to be displayed became a lot, than I experience lag.
Is there a way to plot these segments by using only one plot?
Thank you in advance.