Changeset 2598 in lmdz_wrf for trunk/tools


Ignore:
Timestamp:
Jun 10, 2019, 1:47:03 PM (6 years ago)
Author:
lfita
Message:

Adding:

  • 'pdf-png' output kind in `output_kind'
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/drawing_tools.py

    r2596 r2598  
    28082808    fname = 'output_kind'
    28092809
     2810    availkindf = ['eps', 'gif', 'jpg', 'png', 'pdf-png', 'ps']
     2811
    28102812    if kindf == 'h':
    28112813        print fname + '_____________________________________________________________'
     
    28312833        elif kindf == 'png':
    28322834            plt.savefig(namef + ".png")
    2833 #            plt.savefig(namef + ".pdf")
    2834 #            sub.call('convert -trim -density 300 ' + namef + '.pdf -quality 90 '+   \
    2835 #              namef+'.png', shell=True)
    2836 #            sub.call('rm ' + namef + '.pdf', shell=True)
     2835            if close: print "Successfully generation of figure '" + namef + ".png' !!!"
     2836        elif kindf == 'pdf-png':
     2837            plt.savefig(namef + ".pdf")
     2838            sub.call('convert -trim -density 300 ' + namef + '.pdf -quality 90 '+   \
     2839              namef+'.png', shell=True)
     2840            sub.call('rm ' + namef + '.pdf', shell=True)
    28372841            if close: print "Successfully generation of figure '" + namef + ".png' !!!"
    28382842        elif kindf == 'ps':
     
    28422846            print errormsg
    28432847            print '  ' + fname + ' output format: "' + kindf + '" not ready !!'
    2844             print errormsg
     2848            print '    available ones:', availkindf
    28452849            quit(-1)
    28462850
Note: See TracChangeset for help on using the changeset viewer.