First, I tried plotting histogram using visuals.HistogramVisual, I am getting some weird window. Here is the code :
from vispy import app, visuals
import numpy as np
import sys
import time
from PyQt5.QtWidgets import *
class snrHistogram(app.Canvas):
def __init__(self, *args, **kwargs):
app.Canvas.__init__(self, title='histogram fail',
keys="interactive", size=(300, 300))
self.snr_hist = visuals.HistogramVisual(
np.repeat([0, 1, 1, 20, 20, 40, 40, 80, 80, 90], 400), bins=1, color='r', orientation='h')
self.label = visuals.TextVisual("hi", color='blue', pos=[50, 50, 0])
self.configure_transforms()
#self.show()
def configure_transforms(self):
vp = (0, 0, self.physical_size[0], self.physical_size[1])
self.context.set_viewport(*vp)
self.label.transforms.configure(canvas=self, viewport=vp)
self.snr_hist.transforms.configure(canvas=self, viewport=vp)
def on_resize(self, event):
self.configure_transforms()
def on_mouse_wheel(self, event):
self.update()
def on_draw(self, event):
self.snr_hist.draw()
self.label.draw()
self.update()
def on_close(self, event):
self.close()
class Window(QWidget):
def __init__(self):
super().__init__()
self.layout = QHBoxLayout(self)
start_time= time.time()
s = snrHistogram()
self.layout.addWidget(s.native)
self.setLayout(self.layout)
end_time = time.time()
elapsed_time = end_time-start_time
print("Elapsed time to plot hist is: ", elapsed_time)
#self.setCentralWidget(self)
self.show()
App= QApplication(sys.argv)
window = Window()
sys.exit(App.exec_())
here is the output of it, Why I am getting like this? Where am I wrong?, 
Further, I have 1D data which was computed in GPU and stored in GPU memory and I want to plot histogram using the same data(which stored in GPU memory). since vispy has access to GPU, is it directly take data or should I download data to GPU and plot again? How exactly it will work?
Any leads will be appreciated.
UPDATE
I want to plot something like this, two histogram plots in single figure. I can do it in matplot and also in pyqtgraph. Here is the sample of it, 
