Changeset 84db7a5 in sasmodels for sasmodels/data.py
- Timestamp:
- Mar 17, 2016 10:47:47 AM (8 years ago)
- Branches:
- master, core_shell_microgels, costrafo411, magnetic_model, release_v0.94, release_v0.95, ticket-1257-vesicle-product, ticket_1156, ticket_1265_superball, ticket_822_more_unit_tests
- Children:
- 6824af5
- Parents:
- 4373d62
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sasmodels/data.py
r7824276 r84db7a5 440 440 441 441 if use_data or use_theory: 442 is_tof = np.any(data.lam!=data.lam[0]) 442 443 if num_plots > 1: 443 444 plt.subplot(1, num_plots, 1) 444 445 if use_data: 445 plt.errorbar(data.x, data.y, yerr=data.dy) 446 if is_tof: 447 plt.errorbar(data.x, np.log(data.y)/(data.lam*data.lam), yerr=data.dy/data.y/(data.lam*data.lam)) 448 else: 449 plt.errorbar(data.x, data.y, yerr=data.dy) 446 450 if theory is not None: 447 plt.plot(data.x, theory, '-', hold=True) 451 if is_tof: 452 plt.plot(data.x, np.log(theory)/(data.lam*data.lam), '-', hold=True) 453 else: 454 plt.plot(data.x, theory, '-', hold=True) 448 455 if limits is not None: 449 456 plt.ylim(*limits) 450 plt.xlabel('spin echo length (nm)') 451 plt.ylabel('polarization (P/P0)') 457 458 plt.xlabel('spin echo length ({})'.format(data._xunit)) 459 if is_tof: 460 plt.ylabel('(Log (P/P$_0$))/$\lambda^2$') 461 else: 462 plt.ylabel('polarization (P/P0)') 463 452 464 453 465 if resid is not None: … … 455 467 plt.subplot(1, num_plots, (use_data or use_theory) + 1) 456 468 plt.plot(data.x, resid, 'x') 457 plt.xlabel('spin echo length ( nm)')469 plt.xlabel('spin echo length ({})'.format(data._xunit)) 458 470 plt.ylabel('residuals (P/P0)') 459 471
Note: See TracChangeset
for help on using the changeset viewer.