Changeset 5134b2c in sasmodels for compare.py


Ignore:
Timestamp:
Feb 24, 2015 4:04:29 PM (10 years ago)
Author:
Paul Kienzle <pkienzle@…>
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:
8b81801
Parents:
02dfcab
Message:

fix compare plots so they show both positive and negative error

File:
1 edited

Legend:

Unmodified
Added
Removed
  • compare.py

    r29f5536 r5134b2c  
    234234        plt.subplot(133) 
    235235        if '-abs' in opts: 
    236             err,errstr = resid, "abs err" 
     236            err,errstr,scale = resid, "abs err", "linear" 
    237237        else: 
    238             err,errstr = relerr, "rel err" 
     238            err,errstr,scale = abs(relerr), "rel err", "log" 
    239239        #err,errstr = ocl/cpu,"ratio" 
    240         plot_data(data, err, scale='log') #'linear') 
     240        plot_data(data, err, scale=scale) 
    241241        plt.title("max %s = %.3g"%(errstr, max(abs(err[index])))) 
    242         cbar_title = "log "+errstr 
     242        cbar_title = errstr if scale=="linear" else "log "+errstr 
    243243    if is2D: 
    244244        h = plt.colorbar() 
Note: See TracChangeset for help on using the changeset viewer.