def plot(*args, **kw):
     new_args = list(args)
     if type(args[0]) in [int, float]:
         new_args[0] = [args[0]]
     elif type(args[0]) == Trajectory:
         try:
             new_args[0] = args[0].sample()
         except:
             raise RuntimeError, "Could not sample trajectory with default options for plotting"
     if len(args) > 1:
         if type(args[1]) in [int, float]:
             new_args[1] = [args[1]]
         elif type(args[1]) == Trajectory:
             try:
                 new_args[1] = args[1].sample()
             except:
                 raise RuntimeError, "Could not sample trajectory with default options for plotting"
     return pylab.plot(*tuple(new_args), **kw)
Example #2
0
 def plot(*args, **kw):
     new_args = list(args)
     if isinstance(args[0], _num_types):
         new_args[0] = [args[0]]
     elif isinstance(args[0], Trajectory):
         try:
             new_args[0] = args[0].sample()
         except:
             raise RuntimeError("Could not sample trajectory with default " "options for plotting")
     if len(args) > 1:
         if isinstance(args[1], _num_types):
             new_args[1] = [args[1]]
         elif isinstance(args[1], Trajectory):
             try:
                 new_args[1] = args[1].sample()
             except:
                 raise RuntimeError("Could not sample trajectory with " "default options for plotting")
     return plt.plot(*tuple(new_args), **kw)
Example #3
0
 def plot(*args, **kw):
     new_args = list(args)
     if isinstance(args[0], _num_types):
         new_args[0] = [args[0]]
     elif isinstance(args[0], Trajectory):
         try:
             new_args[0] = args[0].sample()
         except:
             raise RuntimeError("Could not sample trajectory with default "
                                "options for plotting")
     if len(args) > 1:
         if isinstance(args[1], _num_types):
             new_args[1] = [args[1]]
         elif isinstance(args[1], Trajectory):
             try:
                 new_args[1] = args[1].sample()
             except:
                 raise RuntimeError("Could not sample trajectory with "
                                    "default options for plotting")
     return plt.plot(*tuple(new_args), **kw)
Example #4
0
from psychopy import calib
import matplotlib.matlab as mat

myMonitor = calib.Monitor('iiyama514')

#run a calibration series
lumsPRE = calib.getLumSeriesPR650(1,8)
gamCalc = calib.GammaCalculator(lums=lumsPRE)
print "monitor gamma=%.2f" %(gamCalc.gammaVal)
myMonitor['gamma'] = gamCalc.gammaVal
myMonitor.save()

#set the gamma value and test again
lumsPOST = calib.getLumSeriesPR650(1,8,myMonitor['gamma'])
mat.plot(calib.DACrange(len(lumsPRE)),lumsPRE,'bo-')
mat.plot(calib.DACrange(len(lumsPOST)),lumsPOST,'ro-')
mat.ylabel('cd/m^2')
mat.show()
Example #5
0
from psychopy import calib
import matplotlib.matlab as mat

myMonitor = calib.Monitor('iiyama514')

#run a calibration series
lumsPRE = calib.getLumSeriesPR650(1, 8)
gamCalc = calib.GammaCalculator(lums=lumsPRE)
print "monitor gamma=%.2f" % (gamCalc.gammaVal)
myMonitor['gamma'] = gamCalc.gammaVal
myMonitor.save()

#set the gamma value and test again
lumsPOST = calib.getLumSeriesPR650(1, 8, myMonitor['gamma'])
mat.plot(calib.DACrange(len(lumsPRE)), lumsPRE, 'bo-')
mat.plot(calib.DACrange(len(lumsPOST)), lumsPOST, 'ro-')
mat.ylabel('cd/m^2')
mat.show()