Changeset 044a9c1 in sasmodels for doc/genmodel.py


Ignore:
Timestamp:
Mar 18, 2016 6:27:01 AM (8 years ago)
Author:
gonzalezm
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:
886a89d
Parents:
a146eaa
Message:

Fixed details on images produced for doc

File:
1 edited

Legend:

Unmodified
Added
Removed
  • doc/genmodel.py

    r735507b r044a9c1  
    22import numpy as np 
    33import matplotlib.pyplot as plt 
     4import pylab 
    45sys.path.insert(0, os.path.abspath('..')) 
    56from sasmodels import generate, core 
     
    2829    'q_max'     : 1.0, 
    2930    'nq'        : 1000, 
    30     'nq2d'      : 400, 
     31    'nq2d'      : 100, 
    3132    'vmin'      : 1e-3,  # floor for the 2D data results 
    3233    'qx_max'    : 0.5, 
     
    5960    if opts['zscale'] == 'log': 
    6061        Iq2D = np.log(np.clip(Iq2D, opts['vmin'], np.inf)) 
    61     h = ax.imshow(Iq2D, interpolation='nearest', aspect=1, origin='upper', 
    62            extent=[-qx_max, qx_max, -qx_max, qx_max], cmap=ice_cm()) 
    63     # , vmin=vmin, vmax=vmax) 
     62    ax.imshow(Iq2D, interpolation='nearest', aspect=1, origin='lower', 
     63        extent=[-qx_max, qx_max, -qx_max, qx_max], cmap=pylab.cm.jet)    
    6464    ax.set_xlabel(r'$Q_x \/(\AA^{-1})$') 
    6565    ax.set_ylabel(r'$Q_y \/(\AA^{-1})$') 
     66 
     67#            im = self.subplot.imshow(output, interpolation='nearest', 
     68#                                     origin='lower', 
     69#                                     vmin=zmin_temp, vmax=self.zmax_2D, 
     70#                                     cmap=self.cmap, 
     71#                                     extent=(self.xmin_2D, self.xmax_2D, 
     72#                                             self.ymin_2D, self.ymax_2D)) 
    6673 
    6774def ice_cm(): 
     
    97104    plot_2d(model, opts, ax2d) 
    98105    ax1d = fig.add_axes([ax_left, ax_bottom, ax_width, ax_height]) 
     106    plot_1d(model, opts, ax1d) 
    99107    #ax.set_aspect('square') 
    100108else: 
     
    121129captionstr += '.. figure:: img/' + model_info['id'] + '_autogenfig.png\n' 
    122130captionstr += '\n' 
    123 captionstr += '    1D plot corresponding to the default parameters of the model.\n' 
     131if model_info['has_2d']: 
     132    captionstr += '    1D and 2D plots corresponding to the default parameters of the model.\n' 
     133else: 
     134    captionstr += '    1D plot corresponding to the default parameters of the model.\n' 
    124135captionstr += '\n' 
    125136 
Note: See TracChangeset for help on using the changeset viewer.