Here is my code.
from pyqtgraph.Qt import QtGui
import numpy as np
import pyqtgraph.opengl as gl
from netCDF4 import Dataset
import sys
def main():
app = QtGui.QApplication(sys.argv)
w=gl.GLViewWidget()
w.show()
w.setCameraPosition(distance=150)
#just my data
data=Dataset('200707.nc')
prec=data.variables['Prec'][5,:59,:59]
p = gl.GLSurfacePlotItem(z=prec[:] ,shader='heightColor')
p.shader()['colorMap'] = np.array([0.2, 2, 0.5, 0.2, 1, 1, 0.2, 0, 2])
w.addItem(p)
sys.exit(app.exec_())
if __name__ == '__main__':
main()
I think the issue could be in the library's interaction with my Mac's pixel layout. Really not sure what it could be or how to resolve it. Should I looking into using a different program?