[21726] | 1 | Index: ../trunk-jpl/src/m/plot/plotmodel.py
|
---|
| 2 | ===================================================================
|
---|
| 3 | --- ../trunk-jpl/src/m/plot/plotmodel.py (revision 21425)
|
---|
| 4 | +++ ../trunk-jpl/src/m/plot/plotmodel.py (revision 21426)
|
---|
| 5 | @@ -5,7 +5,7 @@
|
---|
| 6 | try:
|
---|
| 7 | import pylab as p
|
---|
| 8 | import matplotlib.pyplot as plt
|
---|
| 9 | - from mpl_toolkits.axes_grid1 import ImageGrid, AxesGrid
|
---|
| 10 | + from mpl_toolkits.axes_grid1 import ImageGrid, AxesGrid
|
---|
| 11 | except ImportError:
|
---|
| 12 | print "could not import pylab, matplotlib has not been installed, no plotting capabilities enabled"
|
---|
| 13 |
|
---|
| 14 | @@ -16,7 +16,7 @@
|
---|
| 15 | ''' at command prompt, type 'plotdoc()' for additional documentation
|
---|
| 16 | '''
|
---|
| 17 |
|
---|
| 18 | - #First process options
|
---|
| 19 | + #First process options
|
---|
| 20 | options=plotoptions(*args)
|
---|
| 21 |
|
---|
| 22 | #get number of subplots
|
---|
| 23 | @@ -35,7 +35,7 @@
|
---|
| 24 | else:
|
---|
| 25 | nrows=np.ceil(numberofplots/subplotwidth)
|
---|
| 26 | nr=False
|
---|
| 27 | -
|
---|
| 28 | +
|
---|
| 29 | if options.list[0].exist('ncols'):
|
---|
| 30 | ncols=options.list[0].getfieldvalue('ncols')
|
---|
| 31 | nc=True
|
---|
| 32 | @@ -44,11 +44,11 @@
|
---|
| 33 | nc=False
|
---|
| 34 | ncols=int(ncols)
|
---|
| 35 | nrows=int(nrows)
|
---|
| 36 | -
|
---|
| 37 | +
|
---|
| 38 | #check that nrows and ncols were given at the same time!
|
---|
| 39 | if not nr==nc:
|
---|
| 40 | raise StandardError('error: nrows and ncols need to be specified together, or not at all')
|
---|
| 41 | -
|
---|
| 42 | +
|
---|
| 43 | #Go through plots
|
---|
| 44 | if numberofplots:
|
---|
| 45 | #if plt.fignum_exists(figurenumber):
|
---|
| 46 | @@ -81,7 +81,7 @@
|
---|
| 47 | cbar_location=options.list[0].getfieldvalue('colorbarpos','right') # right,top
|
---|
| 48 | cbar_size=options.list[0].getfieldvalue('colorbarsize','5%')
|
---|
| 49 | cbar_pad=options.list[0].getfieldvalue('colorbarpad','2.5%') # None or %
|
---|
| 50 | -
|
---|
| 51 | +
|
---|
| 52 | axgrid=ImageGrid(fig, 111,
|
---|
| 53 | nrows_ncols=(nrows,ncols),
|
---|
| 54 | ngrids=plotnum,
|
---|
| 55 | Index: ../trunk-jpl/src/m/plot/plot_unit.py
|
---|
| 56 | ===================================================================
|
---|
| 57 | --- ../trunk-jpl/src/m/plot/plot_unit.py (revision 21425)
|
---|
| 58 | +++ ../trunk-jpl/src/m/plot/plot_unit.py (revision 21426)
|
---|
| 59 | @@ -28,7 +28,7 @@
|
---|
| 60 | # }}}
|
---|
| 61 | # {{{ define wich colormap to use
|
---|
| 62 | try:
|
---|
| 63 | - defaultmap=plt.cm.get_cmap('viridis')
|
---|
| 64 | + defaultmap=plt.cm.get_cmap('viridis',colorlevels)
|
---|
| 65 | except AttributeError:
|
---|
| 66 | print("Viridis can't be found (probably too old Matplotlib) reverting to gnuplot colormap")
|
---|
| 67 | defaultmap=truncate_colormap('gnuplot2',0.1,0.9,colorlevels)
|
---|