Ignore:
Timestamp:
Jun 4, 2013, 4:41:53 PM (12 years ago)
Author:
aslmd
Message:

UTIL PYTHON planetoplot_v2. Added rainbow spahetti plot based on an idea by Alizee. Simply set a colormap for a 1D plot and you get it. Also added in pp_reload (simple rainbow function in ppplot). Added also xmin and xmax capabilitiy. Fixed various bugs related to dummy axis, logarithmic axes. Removed time_counter from set_ppclass.txt it is useless in most cases.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/UTIL/PYTHON/planetoplot_v2/ppclass.py

    r972 r977  
    784784                    if self.title is not None: plobj.title = self.title
    785785                    if self.units is not None: plobj.units = self.units
     786                    if self.colorb is not None: plobj.colorb = self.colorb
    786787                    # -- 1D specific
    787788                    if dp == 1:
     
    795796                        if self.vmin is not None: plobj.vmin = self.vmin
    796797                        if self.vmax is not None: plobj.vmax = self.vmax
    797                         if self.colorb is not None: plobj.colorb = self.colorb
    798798                    # finally append plot object
    799799                    self.p.append(plobj)
     
    909909                    self.fig.add_subplot(1,1,1,axisbg=pl.axisbg) # define one subplot (still needed for user-defined font sizes)
    910910                    sav = pl.xlabel,pl.ylabel,pl.xcoeff,pl.ycoeff,pl.title,pl.swaplab # save titles and labels
     911                    # possibility to color lines according to a color map
     912                    # ... made so that all plots span the whole color map automatically.
     913                    if self.colorb is not None:
     914                        if self.verbose: print "**** OK. We make a rainbow spaghetti plot with color map ",self.colorb
     915                        ppplot.rainbow(cb=self.colorb,num=self.howmanyplots)
    911916                else:
    912917                    pl.invert = False ; pl.lstyle = None # don't invert again axis
     
    932937        # once completed show the plot (cannot show intermediate plotin)
    933938        # ... added a fix (customplot=True) for the label problem in basemap
    934         print "**** PPCLASS. Done step: makeplot"
     939        if not self.quiet: print "**** PPCLASS. Done step: makeplot"
    935940        if (self.n == self.howmanyplots):
    936941            ppplot.save(mode=self.out,filename=self.filename,folder=self.folder,custom=self.customplot,includedate=self.includedate,res=self.res)
     
    11331138            except:
    11341139                try: self.p[iii].wscale = opt.wscale[0]
     1140                except: pass
     1141            ###
     1142            try: self.p[iii].xmin = opt.xmin[iii]
     1143            except:
     1144                try: self.p[iii].xmin = opt.xmin[0]
     1145                except: pass
     1146            ###
     1147            try: self.p[iii].ymin = opt.ymin[iii]
     1148            except:
     1149                try: self.p[iii].ymin = opt.ymin[0]
     1150                except: pass
     1151            ###
     1152            try: self.p[iii].xmax = opt.xmax[iii]
     1153            except:
     1154                try: self.p[iii].xmax = opt.xmax[0]
     1155                except: pass
     1156            ###
     1157            try: self.p[iii].ymax = opt.ymax[iii]
     1158            except:
     1159                try: self.p[iii].ymax = opt.ymax[0]
    11351160                except: pass
    11361161
Note: See TracChangeset for help on using the changeset viewer.