Changeset 2945 for branch/2frame/GSASIIplot.py
- Timestamp:
- Jul 27, 2017 3:03:15 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branch/2frame/GSASIIplot.py
r2940 r2945 2973 2973 ################################################################################ 2974 2974 2975 def PlotXYZ(G2frame,XY,Z,labelX='X',labelY='Y',newPlot=False,Title='' ):2975 def PlotXYZ(G2frame,XY,Z,labelX='X',labelY='Y',newPlot=False,Title='',zrange=None,color=None): 2976 2976 '''simple contour plot of xyz data 2977 2977 … … 2983 2983 :param bool newPlot: =True if new plot is to be made 2984 2984 :param str Title: title for plot 2985 :param list zrange: [zmin,zmax]; default=None to use limits in Z 2986 :param str color: one of mpl.cm.dated.keys(); default=None to use G2frame.ContourColor 2985 2987 :returns: nothing 2986 2988 … … 3014 3016 G2frame.ContourColor = choice[sel] 3015 3017 else: 3016 G2frame.ContourColor = GSASIIpath.GetConfigValue('Contour_color',' Paired')3018 G2frame.ContourColor = GSASIIpath.GetConfigValue('Contour_color','RdYlGn') 3017 3019 dlg.Destroy() 3018 3020 wx.CallAfter(PlotXYZ,G2frame,XY,Z,labelX,labelY,False,Title) … … 3054 3056 Ymin = np.min(XY.T[0]) 3055 3057 Ymax = np.max(XY.T[0]) 3056 Dx = 0.5*(Xmax-Xmin)/Nxy[0]3057 Dy = 0.5*(Ymax-Ymin)/Nxy[1]3058 # Dx = 0.5*(Xmax-Xmin)/Nxy[0] 3059 # Dy = 0.5*(Ymax-Ymin)/Nxy[1] 3058 3060 Plot.set_title(Title) 3059 3061 if labelX: … … 3065 3067 else: 3066 3068 Plot.set_ylabel(r'Y',fontsize=14) 3067 acolor = mpl.cm.get_cmap(G2frame.ContourColor) 3069 if color is None: 3070 acolor = mpl.cm.get_cmap(G2frame.ContourColor) 3071 else: 3072 acolor = mpl.cm.get_cmap(color) 3073 if zrange is None: 3074 zrange=[0,Zmax*G2frame.Cmax] 3068 3075 Img = Plot.imshow(Z.T,cmap=acolor,interpolation=G2frame.Interpolate,origin='lower', \ 3069 aspect='equal',extent=[Xmin,Xmax,Ymin,Ymax],vmin=0,vmax=Zmax*G2frame.Cmax) 3070 # aspect='equal',extent=[Xmin-Dx,Xmax-Dx,Ymin+Dy,Ymax+Dy],vmin=0,vmax=Zmax*G2frame.Cmax) 3076 aspect='equal',extent=[Xmin,Xmax,Ymin,Ymax],vmin=zrange[0],vmax=zrange[1]) 3071 3077 Page.figure.colorbar(Img) 3072 3078 if not newPlot:
Note: See TracChangeset
for help on using the changeset viewer.