-
Notifications
You must be signed in to change notification settings - Fork 616
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How can i draw real time data with optional Markers? #2514
Comments
If you can make your example code any smaller that might help identify the issue faster. If this seems like a bug then I'll definitely need a minimal example that doesn't have any extra dependencies or external data files so I can run it myself. |
What i mean by optional Markers is to be able to have not only lines but also marker points in the graph. I am using pyqtgraph as there is a big menu functionality i need to replicate that i think it d take too much work time in vispy. The provided code is working as the lines are displayed. But i cant get any scatter points (markers) when i try to display them. I ll try to make an example without any dependencies, but i based this development in the example of real time data: In this case how could i add , appart from the lines, some scatter points in the same view? Thanks in advance and sorry for the lack of clear information! |
You have this code: #scatter = visuals.markers.MarkersVisual(data_matrix, face_color=vispy_color, size=4.0)
scatter = scene.visuals.create_visual_node(visuals.MarkersVisual)
scatter.set_gl_state("translucent", blend=True, depth_test=True)
self.view.add(scatter)
#scatter = scene.visuals.Markers(data_matrix, color=vispy_color, width=3.0)
#scatter.set_gl_state(depth_test=False)
#self.view.add(scatter) The last section of commented out code is what you want. Unless you are creating a custom Visual class you should never need to use |
I have tried that before, but appending the same data matrix that i append to Line module (data_matrix) i get this error: error:unhashable type: 'numpy.ndarray' apparently they dont have the same interface, i guess it expects the position to be passed in a different way. I am still trying to figure out why it is correctly received in Line module but not in Markers one. |
Does the original visualization work before the append? Could you please provide the full traceback for that unhashable type error? It is hard to tell what is going wrong without the full context. |
sure:
|
The problem was that i cant directly set the position as it was with Line module, i need to explicitly call pos=position.
|
Sorry, there was a misunderstanding. I want the full traceback of the error. That should tell me what series of calls are causing the error you were getting. |
Now there is no error showing in the terminal, its just that whenever i change color (set_scatter_color) the lines change but markers stay the same as they were initialized. |
The MarkersVisual has the unfortunate design that the other properties (ex. face colors) only get updated in |
thanks, i ll try that approach now! |
Hi, i recetly started using vispy library and i am struggling to update real time data with optional Markers in the same view. I am trying to use Markersvisual for the markers but for some reason is not working. I ve also tried generating the lines with LinePlotVisual that have markers included but couldnt achieve it. Which module d be the best one for this case? Thanks in advance!!
The text was updated successfully, but these errors were encountered: