Changeset 6fd4e36 in sasview for src/sas/qtgui/PlotUtilities.py
- Timestamp:
- Mar 28, 2017 6:53:29 AM (7 years ago)
- Branches:
- ESS_GUI, ESS_GUI_Docs, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_iss959, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc
- Children:
- 0268aed
- Parents:
- a9b568c
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/qtgui/PlotUtilities.py
r239214f r6fd4e36 1 1 import sys 2 2 import numpy 3 import string 4 3 5 from collections import OrderedDict 4 6 … … 75 77 # get histogram of data, all points into a bin in a way of summing 76 78 image, xedges, yedges = numpy.histogram2d(x=qy_data, 77 78 79 79 y=qx_data, 80 bins=[y_bins, x_bins], 81 weights=data) 80 82 # Now, normalize the image by weights only for weights>1: 81 83 # If weight == 1, there is only one data point in the bin so … … 264 266 ''' 265 267 266 if color is not None: 267 # Check if it's an int 268 if isinstance(color, int): 269 # Check if it's within the range 270 if 0 <= color <=6: 271 color = COLORS.values()[color] 272 # Check if it's an RGB string 273 elif isinstance(color, str): 274 # Assure the correctnes of the string 275 assert(color[0]=="#" and len(color) == 7) 276 import string 277 assert(all(c in string.hexdigits for c in color[1:])) 278 else: 279 raise AttributeError 268 if color is None: 269 return color 270 271 # Check if it's an int 272 if isinstance(color, int): 273 # Check if it's within the range 274 if 0 <= color <=6: 275 color = COLORS.values()[color] 276 # Check if it's an RGB string 277 elif isinstance(color, str): 278 # Assure the correctnes of the string 279 assert(color[0]=="#" and len(color) == 7) 280 assert(all(c in string.hexdigits for c in color[1:])) 281 else: 282 raise AttributeError 280 283 281 284 return color
Note: See TracChangeset
for help on using the changeset viewer.