0

I am not familiar enough with Vispy. I did adapt this example for my use case, but I don't know how to modify it further to include the missing features.

I am trying to plot in real-time N-channels of data at the same scale. Using pyqtgraph, the interface looks like this:

enter image description here

And with vispy:

enter image description here

My goal is to match both backends, step by step. The difference for now are:

  • The order in Vispy is reversed (plot at the top on Vispy is the plot at the bottom on pyqtgraph)
  • Lack channel names
  • Lack Y-axis label
  • Lack X-Axis and X-Axis label
  • Lack of headroom top/bottom

I do not know how to solve any of those, how to further improve this backend. Any tips, guidance towards the correct, best function to use for this would be very helpful.

I was looking into visual.text, but the positioning seemed difficult. I did not know how to match the label in front of one of the plot.

Mathieu
  • 5,410
  • 6
  • 28
  • 55
  • Side note: I really need to get rid of that example. It is misleading for new users. You should look at switching to the SceneCanvas API and taking advantage of the AxisWidget (or AxisVisual). The realtime_signals example is good for the low-level gloo interface and getting the absolute best performance, but it limits you and makes it difficult to do anything else. – djhoese Aug 12 '21 at 15:00
  • https://vispy.org/gallery/scene/line_update.html#sphx-glr-gallery-scene-line-update-py – djhoese Aug 12 '21 at 15:01
  • @djhoese Thanks, I will have a look. – Mathieu Aug 12 '21 at 15:40
  • I should also note this FAQ which could come up in your work as you move forward: https://vispy.org/faq.html#why-is-my-visualization-slower-when-i-add-more-visual-objects – djhoese Aug 12 '21 at 19:21
  • @djhoese I did have a look at Scene, but I did not find how to pass the entire array of data (channel x samples) at once as I am doing with the gloo. My main reason for making a vispy backend is performance, thus it doesn't make sense to multiply the OpenGL calls. I have adapted the example to my need, removing clipping, changing margins, ... but I don't know how to add additional elements, additional OpenGL calls to add elements to my canvas/program/gloo. If you have time.. https://stackoverflow.com/questions/68773736/combine-plotting-text-lines-on-the-same-canas-in-vispy – Mathieu Aug 13 '21 at 14:10
  • Maybe I am wrong, but using Scene/Visual it would require one call to visuals.LineVisual per channel; instead of one call for all channels. – Mathieu Aug 13 '21 at 14:16
  • > it would require one call to visuals.LineVisual per channel; instead of one call for all channels. It depends. Using the basic LineVisual you can provide a series of line segments all to one line visual and the visual will figure out how to draw them. – djhoese Aug 13 '21 at 15:36

0 Answers0