##// END OF EJS Templates
Regresa a la version original desarrollada por Marco M.
Alexander Valdez -
r165:6be50d6279e1
parent child
Show More
@@ -14,10 +14,10 import datetime
14 14
15 15 #import plplot
16 16 import matplotlib as mpl
17 #mpl.use('TKAgg')
17 mpl.use('TKAgg')
18 18 import matplotlib.pyplot as plt
19 19
20 #import scitools.numpyutils as sn
20 import scitools.numpyutils as sn
21 21
22 22 def cmap1_init(colormap='gray'):
23 23
@@ -1131,81 +1131,81 if __name__ == '__main__':
1131 1131 linearObj.plot(indexplot, x, y, type)
1132 1132
1133 1133 linearObj.refresh()
1134 linearObj.show()
1134 # linearObj.show()
1135 1135
1136 1136
1137 # """
1138 # Ejemplo2
1139 # """
1140 #
1141 # # make these smaller to increase the resolution
1142 # dx, dy = 0.05, 0.05
1143 # x = numpy.arange(-3.0, 3.0001, dx)
1144 # y = numpy.arange(-2.0, 2.0001, dy)
1145 ## X,Y = numpy.meshgrid(x, y)
1146 # X,Y = sn.ndgrid(x, y)
1147 # Z = (1- X/2 + X**5 + Y**3)*numpy.exp(-X**2-Y**2)
1148 #
1149 # # Creating Object
1150 # indexPlot = 2
1151 # nsubplot = 1
1152 # winTitle = "mi grafico pcolor"
1153 # colormap = "br_green"
1154 # showColorbar = True
1155 # showPowerProfile = False
1156 # XAxisAsTime = False
1157 #
1158 # subplotTitle = "subplot no. "
1159 # xlabel = ""
1160 # ylabel = ""
1161 #
1162 # xmin = -3.0
1163 # xmax = 3.0
1164 # ymin = -2.0
1165 # ymax = 2.0
1166 # zmin = -0.3
1167 # zmax = 1.0
1168 #
1169 # isPlotIni = False
1170 # isPlotConfig = False
1171 # ntimes = 10
1172 #
1173 #
1174 # for i in range(ntimes):
1175 #
1176 # # Instancia del objeto
1177 # if not(isPlotConfig):
1178 # pcolorObj = PcolorPlot(indexPlot, nsubplot, winTitle, colormap, showColorbar, showPowerProfile, XAxisAsTime)
1179 # isPlotConfig = True
1180 #
1181 # # Crea los subplots
1182 # if not(isPlotIni):
1183 # for index in range(nsubplot):
1184 # indexplot = index + 1
1185 # title = subplotTitle + '%d'%indexplot
1186 # subplot = index
1187 # pcolorObj.createObjects(indexplot,xmin,xmax,ymin,ymax,zmin,zmax,title,xlabel,ylabel)
1188 # isPlotIni = True
1189 #
1190 # # Inicializa el grafico en cada iteracion
1191 # pcolorObj.setFigure(indexPlot)
1192 # pcolorObj.setNewPage("")
1193 #
1194 # for index in range(nsubplot):
1195 # subplot = index
1196 # pcolorObj.iniPlot(subplot+1)
1197 #
1198 # #plotea los datos
1199 # for channel in range(nsubplot):
1200 # data = Z+0.1*numpy.random.randn(len(x),len(y))
1201 # pcolorObj.plot(channel+1, x, y, data)
1202 #
1203 # pcolorObj.refresh()
1204 #
1205 ## pcolorObj.closePage() #descomentar esta linea para mas iteraciones
1206 #
1207 # time.sleep(1)
1208 #
1209 # pcolorObj.show()
1210 #
1211 # print "end" No newline at end of file
1137 """
1138 Ejemplo2
1139 """
1140
1141 # make these smaller to increase the resolution
1142 dx, dy = 0.05, 0.05
1143 x = numpy.arange(-3.0, 3.0001, dx)
1144 y = numpy.arange(-2.0, 2.0001, dy)
1145 # X,Y = numpy.meshgrid(x, y)
1146 X,Y = sn.ndgrid(x, y)
1147 Z = (1- X/2 + X**5 + Y**3)*numpy.exp(-X**2-Y**2)
1148
1149 # Creating Object
1150 indexPlot = 2
1151 nsubplot = 1
1152 winTitle = "mi grafico pcolor"
1153 colormap = "br_green"
1154 showColorbar = True
1155 showPowerProfile = False
1156 XAxisAsTime = False
1157
1158 subplotTitle = "subplot no. "
1159 xlabel = ""
1160 ylabel = ""
1161
1162 xmin = -3.0
1163 xmax = 3.0
1164 ymin = -2.0
1165 ymax = 2.0
1166 zmin = -0.3
1167 zmax = 1.0
1168
1169 isPlotIni = False
1170 isPlotConfig = False
1171 ntimes = 10
1172
1173
1174 for i in range(ntimes):
1175
1176 # Instancia del objeto
1177 if not(isPlotConfig):
1178 pcolorObj = PcolorPlot(indexPlot, nsubplot, winTitle, colormap, showColorbar, showPowerProfile, XAxisAsTime)
1179 isPlotConfig = True
1180
1181 # Crea los subplots
1182 if not(isPlotIni):
1183 for index in range(nsubplot):
1184 indexplot = index + 1
1185 title = subplotTitle + '%d'%indexplot
1186 subplot = index
1187 pcolorObj.createObjects(indexplot,xmin,xmax,ymin,ymax,zmin,zmax,title,xlabel,ylabel)
1188 isPlotIni = True
1189
1190 # Inicializa el grafico en cada iteracion
1191 pcolorObj.setFigure(indexPlot)
1192 pcolorObj.setNewPage("")
1193
1194 for index in range(nsubplot):
1195 subplot = index
1196 pcolorObj.iniPlot(subplot+1)
1197
1198 #plotea los datos
1199 for channel in range(nsubplot):
1200 data = Z+0.1*numpy.random.randn(len(x),len(y))
1201 pcolorObj.plot(channel+1, x, y, data)
1202
1203 pcolorObj.refresh()
1204
1205 # pcolorObj.closePage() #descomentar esta linea para mas iteraciones
1206
1207 time.sleep(1)
1208
1209 pcolorObj.show()
1210
1211 print "end" No newline at end of file
General Comments 0
You need to be logged in to leave comments. Login now