Changeset 745b7bb in sasmodels for doc/genmodel.py
- Timestamp:
- Aug 4, 2016 11:32:17 PM (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:
- 4e0968b
- Parents:
- 54bcd4a
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
doc/genmodel.py
ra5b8477 r745b7bb 6 6 sys.path.insert(0, os.path.abspath('..')) 7 7 from sasmodels import generate, core 8 from sasmodels.direct_model import DirectModel 8 from sasmodels.direct_model import DirectModel, call_profile 9 9 from sasmodels.data import empty_data1D, empty_data2D 10 10 … … 17 17 from sasmodels.kernel import KernelModel 18 18 from sasmodels.modelinfo import ModelInfo 19 19 20 20 21 def plot_1d(model, opts, ax): … … 55 56 ax.set_xlabel(r'$Q_x \/(\AA^{-1})$') 56 57 ax.set_ylabel(r'$Q_y \/(\AA^{-1})$') 58 59 def plot_profile_inset(model_info, ax): 60 p = ax.get_position() 61 width, height = 0.4*(p.x1-p.x0), 0.4*(p.y1-p.y0) 62 left, bottom = p.x1-width, p.y1-height 63 inset = plt.gcf().add_axes([left, bottom, width, height]) 64 x, y, labels = call_profile(model_info) 65 inset.plot(x, y, '-') 66 inset.locator_params(nbins=4) 67 #inset.set_xlabel(labels[0]) 68 #inset.set_ylabel(labels[1]) 69 inset.text(0.99, 0.99, "profile", 70 horizontalalignment="right", 71 verticalalignment="top", 72 transform=inset.transAxes) 57 73 58 74 def figfile(model_info): … … 100 116 ax1d = fig.add_axes([ax_left, ax_bottom, ax_width, ax_height]) 101 117 plot_1d(model, opts, ax1d) 118 119 if model_info.profile: 120 plot_profile_inset(model_info, ax1d) 102 121 103 122 # Save image in model/img
Note: See TracChangeset
for help on using the changeset viewer.