Changeset fbb9397 in sasmodels
- Timestamp:
- Oct 18, 2017 8:11:37 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:
- 3c24ccd
- Parents:
- 32f87a5
- Location:
- sasmodels
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
sasmodels/compare.py
r8698a0d rfbb9397 827 827 parameters. 828 828 """ 829 limits = np.Inf, -np.Inf830 829 for k in range(opts['sets']): 831 830 opts['pars'] = parse_pars(opts) … … 838 837 import matplotlib.pyplot as plt 839 838 plt.show() 839 return limits 840 840 841 841 def run_models(opts, verbose=False): … … 912 912 913 913 914 def plot_models(opts, result, limits= (np.Inf, -np.Inf), setnum=0):914 def plot_models(opts, result, limits=None, setnum=0): 915 915 # type: (Dict[str, Any], Dict[str, Any], Optional[Tuple[float, float]]) -> Tuple[float, float] 916 import matplotlib.pyplot as plt 917 916 918 base_value, comp_value = result['base_value'], result['comp_value'] 917 919 base_time, comp_time = result['base_time'], result['comp_time'] … … 925 927 # Plot if requested 926 928 view = opts['view'] 927 i mport matplotlib.pyplot as plt928 vmin, vmax = limits929 if have_base:930 vmin = min(vmin, base_value.min())931 vmax = max(vmax, base_value.max())932 if have_comp:933 vmin = min(vmin, comp_value.min())934 vmax = max(vmax, comp_value.max())935 limits = vmin, vmax929 if limits is None: 930 vmin, vmax = np.inf, -np.inf 931 if have_base: 932 vmin = min(vmin, base_value.min()) 933 vmax = max(vmax, base_value.max()) 934 if have_comp: 935 vmin = min(vmin, comp_value.min()) 936 vmax = max(vmax, comp_value.max()) 937 limits = vmin, vmax 936 938 937 939 if have_base: … … 1423 1425 self.starting_values = dict((k, v.value) for k, v in pars.items()) 1424 1426 self.pd_types = pd_types 1425 self.limits = np.Inf, -np.Inf1427 self.limits = None 1426 1428 1427 1429 def revert_values(self): -
sasmodels/data.py
r09141ff rfbb9397 646 646 ymin, ymax = min(data.qy_data), max(data.qy_data) 647 647 if view == 'log': 648 vmin, vmax = np.log10(vmin), np.log10(vmax) 648 vmin_scaled, vmax_scaled= np.log10(vmin), np.log10(vmax) 649 else: 650 vmin_scaled, vmax_scaled = vmin, vmax 649 651 plt.imshow(plottable.reshape(len(data.x_bins), len(data.y_bins)), 650 652 interpolation='nearest', aspect=1, origin='lower', 651 extent=[xmin, xmax, ymin, ymax], vmin=vmin, vmax=vmax) 653 extent=[xmin, xmax, ymin, ymax], 654 vmin=vmin_scaled, vmax=vmax_scaled) 652 655 plt.xlabel("$q_x$/A$^{-1}$") 653 656 plt.ylabel("$q_y$/A$^{-1}$")
Note: See TracChangeset
for help on using the changeset viewer.