Changeset 3c24ccd in sasmodels for sasmodels/weights.py
- Timestamp:
- Oct 18, 2017 10:03:43 AM (7 years ago)
- Branches:
- master, core_shell_microgels, magnetic_model, ticket-1257-vesicle-product, ticket_1156, ticket_1265_superball, ticket_822_more_unit_tests
- Children:
- ef8e68c
- Parents:
- fbb9397
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sasmodels/weights.py
r8698a0d r3c24ccd 232 232 233 233 234 def plot_weights(model_info, pairs):235 # type: (ModelInfo, List[Tuple[ np.ndarray, np.ndarray]]) -> None234 def plot_weights(model_info, mesh): 235 # type: (ModelInfo, List[Tuple[float, np.ndarray, np.ndarray]]) -> None 236 236 """ 237 237 Plot the weights returned by :func:`get_weights`. 238 238 239 *model_info* is 240 :param model_info: 241 :param pairs: 242 :return: 239 *model_info* defines model parameters, etc. 240 241 *mesh* is a list of tuples containing (*value*, *dispersity*, *weights*) 242 for each parameter, where (*dispersity*, *weights*) pairs are the 243 distributions to be plotted. 243 244 """ 244 245 import pylab 245 246 246 if any(len( values)>1 for values, weights in pairs):247 if any(len(dispersity)>1 for value, dispersity, weights in mesh): 247 248 labels = [p.name for p in model_info.parameters.call_parameters] 248 pylab.interactive(True)249 #pylab.interactive(True) 249 250 pylab.figure() 250 for (v,w), s in zip(pairs, labels): 251 if len(v) > 1: 252 #print("weights for", s, v, w) 253 pylab.plot(v, w, '-o', label=s) 251 for (v,x,w), s in zip(mesh, labels): 252 if len(x) > 1: 253 pylab.plot(x, w, '-o', label=s) 254 254 pylab.grid(True) 255 255 pylab.legend()
Note: See TracChangeset
for help on using the changeset viewer.