##// END OF EJS Templates
Se agrega parametro de entrada 'show', por defecto (True) muestra la figuras, caso contrario (False) matplotlib no muestra la figuras
Daniel Valdez -
r342:de907111a31d
parent child
Show More
@@ -86,7 +86,7 class Figure:
86 86
87 87 raise ValueError, "This method has been replaced with createFigure"
88 88
89 def createFigure(self, idfigure, wintitle, widthplot=None, heightplot=None):
89 def createFigure(self, idfigure, wintitle, widthplot=None, heightplot=None, show=True):
90 90
91 91 """
92 92 Crea la figura de acuerdo al driver y parametros seleccionados seleccionados.
@@ -111,10 +111,11 class Figure:
111 111
112 112 self.widthscreen, self.heightscreen = self.getScreenDim(widthplot, heightplot)
113 113
114 self.fig = self.__driver.createFigure(self.idfigure,
115 self.wintitle,
116 self.widthscreen,
117 self.heightscreen)
114 self.fig = self.__driver.createFigure(idfigure=self.idfigure,
115 wintitle=self.wintitle,
116 width=self.widthscreen,
117 height=self.heightscreen,
118 show=show)
118 119
119 120 self.axesObjList = []
120 121
@@ -18,21 +18,23 from matplotlib.ticker import *
18 18 #Actualizacion de las funciones del driver
19 19 ###########################################
20 20
21 def createFigure(idfigure, wintitle, width, height, facecolor="w"):
21 def createFigure(idfigure, wintitle, width, height, facecolor="w", show=True):
22 22
23 23 matplotlib.pyplot.ioff()
24 24 fig = matplotlib.pyplot.figure(num=idfigure, facecolor=facecolor)
25 25 fig.canvas.manager.set_window_title(wintitle)
26 26 fig.canvas.manager.resize(width, height)
27 27 matplotlib.pyplot.ion()
28 matplotlib.pyplot.show()
28 if show:
29 matplotlib.pyplot.show()
29 30
30 31 return fig
31 32
32 def closeFigure():
33 def closeFigure(show=True):
33 34
34 35 matplotlib.pyplot.ioff()
35 matplotlib.pyplot.show()
36 if show:
37 matplotlib.pyplot.show()
36 38
37 39 return
38 40
@@ -30,7 +30,7 class CrossSpectraPlot(Figure):
30 30
31 31 return nrow, ncol
32 32
33 def setup(self, idfigure, nplots, wintitle, showprofile=True):
33 def setup(self, idfigure, nplots, wintitle, showprofile=True, show=True):
34 34
35 35 self.__showprofile = showprofile
36 36 self.nplots = nplots
@@ -41,7 +41,8 class CrossSpectraPlot(Figure):
41 41 self.createFigure(idfigure = idfigure,
42 42 wintitle = wintitle,
43 43 widthplot = self.WIDTH + self.WIDTHPROF,
44 heightplot = self.HEIGHT + self.HEIGHTPROF)
44 heightplot = self.HEIGHT + self.HEIGHTPROF,
45 show=True)
45 46
46 47 nrow, ncol = self.getSubplots()
47 48
@@ -55,7 +56,7 class CrossSpectraPlot(Figure):
55 56 def run(self, dataOut, idfigure, wintitle="", pairsList=None, showprofile='True',
56 57 xmin=None, xmax=None, ymin=None, ymax=None, zmin=None, zmax=None,
57 58 save=False, figpath='./', figfile=None,
58 power_cmap='jet', coherence_cmap='jet', phase_cmap='RdBu_r'):
59 power_cmap='jet', coherence_cmap='jet', phase_cmap='RdBu_r', show=True):
59 60
60 61 """
61 62
@@ -112,7 +113,8 class CrossSpectraPlot(Figure):
112 113 self.setup(idfigure=idfigure,
113 114 nplots=nplots,
114 115 wintitle=wintitle,
115 showprofile=showprofile)
116 showprofile=showprofile,
117 show=show)
116 118
117 119 if xmin == None: xmin = numpy.nanmin(x)
118 120 if xmax == None: xmax = numpy.nanmax(x)
@@ -203,7 +205,7 class RTIPlot(Figure):
203 205
204 206 return nrow, ncol
205 207
206 def setup(self, idfigure, nplots, wintitle, showprofile=True):
208 def setup(self, idfigure, nplots, wintitle, showprofile=True, show=True):
207 209
208 210 self.__showprofile = showprofile
209 211 self.nplots = nplots
@@ -218,7 +220,8 class RTIPlot(Figure):
218 220 self.createFigure(idfigure = idfigure,
219 221 wintitle = wintitle,
220 222 widthplot = self.WIDTH + self.WIDTHPROF,
221 heightplot = self.HEIGHT + self.HEIGHTPROF)
223 heightplot = self.HEIGHT + self.HEIGHTPROF,
224 show=show)
222 225
223 226 nrow, ncol = self.getSubplots()
224 227
@@ -239,7 +242,7 class RTIPlot(Figure):
239 242 def run(self, dataOut, idfigure, wintitle="", channelList=None, showprofile='True',
240 243 xmin=None, xmax=None, ymin=None, ymax=None, zmin=None, zmax=None,
241 244 timerange=None,
242 save=False, figpath='./', figfile=None, ftp=False, ftpratio=1):
245 save=False, figpath='./', figfile=None, ftp=False, ftpratio=1, show=True):
243 246
244 247 """
245 248
@@ -294,7 +297,8 class RTIPlot(Figure):
294 297 self.setup(idfigure=idfigure,
295 298 nplots=nplots,
296 299 wintitle=wintitle,
297 showprofile=showprofile)
300 showprofile=showprofile,
301 show=show)
298 302
299 303 tmin, tmax = self.getTimeLim(x, xmin, xmax)
300 304 if ymin == None: ymin = numpy.nanmin(y)
@@ -369,7 +373,7 class SpectraPlot(Figure):
369 373
370 374 return nrow, ncol
371 375
372 def setup(self, idfigure, nplots, wintitle, showprofile=True):
376 def setup(self, idfigure, nplots, wintitle, showprofile=True, show=True):
373 377
374 378 self.__showprofile = showprofile
375 379 self.nplots = nplots
@@ -384,7 +388,8 class SpectraPlot(Figure):
384 388 self.createFigure(idfigure = idfigure,
385 389 wintitle = wintitle,
386 390 widthplot = self.WIDTH + self.WIDTHPROF,
387 heightplot = self.HEIGHT + self.HEIGHTPROF)
391 heightplot = self.HEIGHT + self.HEIGHTPROF,
392 show=show)
388 393
389 394 nrow, ncol = self.getSubplots()
390 395
@@ -404,7 +409,7 class SpectraPlot(Figure):
404 409
405 410 def run(self, dataOut, idfigure, wintitle="", channelList=None, showprofile='True',
406 411 xmin=None, xmax=None, ymin=None, ymax=None, zmin=None, zmax=None,
407 save=False, figpath='./', figfile=None):
412 save=False, figpath='./', figfile=None, show=True):
408 413
409 414 """
410 415
@@ -455,7 +460,8 class SpectraPlot(Figure):
455 460 self.setup(idfigure=idfigure,
456 461 nplots=nplots,
457 462 wintitle=wintitle,
458 showprofile=showprofile)
463 showprofile=showprofile,
464 show=show)
459 465
460 466 if xmin == None: xmin = numpy.nanmin(x)
461 467 if xmax == None: xmax = numpy.nanmax(x)
@@ -512,11 +518,13 class Scope(Figure):
512 518 ncol = 3
513 519 return nrow, ncol
514 520
515 def setup(self, idfigure, nplots, wintitle):
521 def setup(self, idfigure, nplots, wintitle, show):
516 522
517 523 self.nplots = nplots
518 524
519 self.createFigure(idfigure, wintitle)
525 self.createFigure(idfigure=idfigure,
526 wintitle=wintitle,
527 show=show)
520 528
521 529 nrow,ncol = self.getSubplots()
522 530 colspan = 3
@@ -529,7 +537,7 class Scope(Figure):
529 537
530 538 def run(self, dataOut, idfigure, wintitle="", channelList=None,
531 539 xmin=None, xmax=None, ymin=None, ymax=None, save=False,
532 figpath='./', figfile=None):
540 figpath='./', figfile=None, show=True):
533 541
534 542 """
535 543
@@ -567,7 +575,8 class Scope(Figure):
567 575
568 576 self.setup(idfigure=idfigure,
569 577 nplots=nplots,
570 wintitle=wintitle)
578 wintitle=wintitle,
579 show=show)
571 580
572 581 if xmin == None: xmin = numpy.nanmin(x)
573 582 if xmax == None: xmax = numpy.nanmax(x)
@@ -616,7 +625,7 class ProfilePlot(Figure):
616 625
617 626 return nrow, ncol
618 627
619 def setup(self, idfigure, nplots, wintitle):
628 def setup(self, idfigure, nplots, wintitle, show):
620 629
621 630 self.nplots = nplots
622 631
@@ -626,7 +635,8 class ProfilePlot(Figure):
626 635 self.createFigure(idfigure = idfigure,
627 636 wintitle = wintitle,
628 637 widthplot = self.WIDTH,
629 heightplot = self.HEIGHT)
638 heightplot = self.HEIGHT,
639 show=show)
630 640
631 641 nrow, ncol = self.getSubplots()
632 642
@@ -637,7 +647,7 class ProfilePlot(Figure):
637 647
638 648 def run(self, dataOut, idfigure, wintitle="", channelList=None,
639 649 xmin=None, xmax=None, ymin=None, ymax=None,
640 save=False, figpath='./', figfile=None):
650 save=False, figpath='./', figfile=None, show=True):
641 651
642 652 if channelList == None:
643 653 channelIndexList = dataOut.channelIndexList
@@ -668,7 +678,8 class ProfilePlot(Figure):
668 678
669 679 self.setup(idfigure=idfigure,
670 680 nplots=nplots,
671 wintitle=wintitle)
681 wintitle=wintitle,
682 show=show)
672 683
673 684 if ymin == None: ymin = numpy.nanmin(y)
674 685 if ymax == None: ymax = numpy.nanmax(y)
@@ -724,7 +735,7 class CoherenceMap(Figure):
724 735
725 736 return nrow, ncol
726 737
727 def setup(self, idfigure, nplots, wintitle, showprofile=True):
738 def setup(self, idfigure, nplots, wintitle, showprofile=True, show=True):
728 739 self.__showprofile = showprofile
729 740 self.nplots = nplots
730 741
@@ -738,7 +749,8 class CoherenceMap(Figure):
738 749 self.createFigure(idfigure = idfigure,
739 750 wintitle = wintitle,
740 751 widthplot = self.WIDTH + self.WIDTHPROF,
741 heightplot = self.HEIGHT + self.HEIGHTPROF)
752 heightplot = self.HEIGHT + self.HEIGHTPROF,
753 show=True)
742 754
743 755 nrow, ncol = self.getSubplots()
744 756
@@ -754,7 +766,7 class CoherenceMap(Figure):
754 766 xmin=None, xmax=None, ymin=None, ymax=None, zmin=None, zmax=None,
755 767 timerange=None,
756 768 save=False, figpath='./', figfile=None, ftp=False, ftpratio=1,
757 coherence_cmap='jet', phase_cmap='RdBu_r'):
769 coherence_cmap='jet', phase_cmap='RdBu_r', show=True):
758 770
759 771 if pairsList == None:
760 772 pairsIndexList = dataOut.pairsIndexList
@@ -789,7 +801,8 class CoherenceMap(Figure):
789 801 self.setup(idfigure=idfigure,
790 802 nplots=nplots,
791 803 wintitle=wintitle,
792 showprofile=showprofile)
804 showprofile=showprofile,
805 show=show)
793 806
794 807 tmin, tmax = self.getTimeLim(x, xmin, xmax)
795 808 if ymin == None: ymin = numpy.nanmin(y)
@@ -897,7 +910,7 class RTIfromNoise(Figure):
897 910
898 911 return nrow, ncol
899 912
900 def setup(self, idfigure, nplots, wintitle, showprofile=True):
913 def setup(self, idfigure, nplots, wintitle, showprofile=True, show=True):
901 914
902 915 self.__showprofile = showprofile
903 916 self.nplots = nplots
@@ -909,7 +922,8 class RTIfromNoise(Figure):
909 922 self.createFigure(idfigure = idfigure,
910 923 wintitle = wintitle,
911 924 widthplot = self.WIDTH+self.WIDTHPROF,
912 heightplot = self.HEIGHT+self.HEIGHTPROF)
925 heightplot = self.HEIGHT+self.HEIGHTPROF,
926 show=show)
913 927
914 928 nrow, ncol = self.getSubplots()
915 929
@@ -919,7 +933,7 class RTIfromNoise(Figure):
919 933 def run(self, dataOut, idfigure, wintitle="", channelList=None, showprofile='True',
920 934 xmin=None, xmax=None, ymin=None, ymax=None,
921 935 timerange=None,
922 save=False, figpath='./', figfile=None):
936 save=False, figpath='./', figfile=None, show=True):
923 937
924 938 if channelList == None:
925 939 channelIndexList = dataOut.channelIndexList
@@ -954,7 +968,8 class RTIfromNoise(Figure):
954 968 self.setup(idfigure=idfigure,
955 969 nplots=nplots,
956 970 wintitle=wintitle,
957 showprofile=showprofile)
971 showprofile=showprofile,
972 show=show)
958 973
959 974 tmin, tmax = self.getTimeLim(x, xmin, xmax)
960 975 if ymin == None: ymin = numpy.nanmin(noisedB)
@@ -1031,7 +1046,7 class SpectraHeisScope(Figure):
1031 1046
1032 1047 return nrow, ncol
1033 1048
1034 def setup(self, idfigure, nplots, wintitle):
1049 def setup(self, idfigure, nplots, wintitle, show):
1035 1050
1036 1051 showprofile = False
1037 1052 self.__showprofile = showprofile
@@ -1047,7 +1062,8 class SpectraHeisScope(Figure):
1047 1062 self.createFigure(idfigure = idfigure,
1048 1063 wintitle = wintitle,
1049 1064 widthplot = self.WIDTH + self.WIDTHPROF,
1050 heightplot = self.HEIGHT + self.HEIGHTPROF)
1065 heightplot = self.HEIGHT + self.HEIGHTPROF,
1066 show = show)
1051 1067
1052 1068 nrow, ncol = self.getSubplots()
1053 1069
@@ -1093,7 +1109,7 class SpectraHeisScope(Figure):
1093 1109
1094 1110 def run(self, dataOut, idfigure, wintitle="", channelList=None,
1095 1111 xmin=None, xmax=None, ymin=None, ymax=None, save=False,
1096 figpath='./', figfile=None, ftp=False, ftpratio=1):
1112 figpath='./', figfile=None, ftp=False, ftpratio=1, show=True):
1097 1113
1098 1114 """
1099 1115
@@ -1138,7 +1154,8 class SpectraHeisScope(Figure):
1138 1154
1139 1155 self.setup(idfigure=idfigure,
1140 1156 nplots=nplots,
1141 wintitle=wintitle)
1157 wintitle=wintitle,
1158 show=show)
1142 1159
1143 1160 if xmin == None: xmin = numpy.nanmin(x)
1144 1161 if xmax == None: xmax = numpy.nanmax(x)
@@ -1157,6 +1174,7 class SpectraHeisScope(Figure):
1157 1174 xmin=xmin, xmax=xmax, ymin=ymin, ymax=ymax,
1158 1175 xlabel=xlabel, ylabel=ylabel, title=title, grid='both')
1159 1176
1177
1160 1178 self.draw()
1161 1179
1162 1180 if save:
@@ -1201,7 +1219,7 class RTIfromSpectraHeis(Figure):
1201 1219
1202 1220 return nrow, ncol
1203 1221
1204 def setup(self, idfigure, nplots, wintitle, showprofile=True):
1222 def setup(self, idfigure, nplots, wintitle, showprofile=True, show=True):
1205 1223
1206 1224 self.__showprofile = showprofile
1207 1225 self.nplots = nplots
@@ -1213,7 +1231,8 class RTIfromSpectraHeis(Figure):
1213 1231 self.createFigure(idfigure = idfigure,
1214 1232 wintitle = wintitle,
1215 1233 widthplot = self.WIDTH+self.WIDTHPROF,
1216 heightplot = self.HEIGHT+self.HEIGHTPROF)
1234 heightplot = self.HEIGHT+self.HEIGHTPROF,
1235 show = show)
1217 1236
1218 1237 nrow, ncol = self.getSubplots()
1219 1238
@@ -1223,7 +1242,7 class RTIfromSpectraHeis(Figure):
1223 1242 def run(self, dataOut, idfigure, wintitle="", channelList=None, showprofile='True',
1224 1243 xmin=None, xmax=None, ymin=None, ymax=None,
1225 1244 timerange=None,
1226 save=False, figpath='./', figfile=None, ftp=False, ftpratio=1):
1245 save=False, figpath='./', figfile=None, ftp=False, ftpratio=1, show=True):
1227 1246
1228 1247 if channelList == None:
1229 1248 channelIndexList = dataOut.channelIndexList
@@ -1264,7 +1283,8 class RTIfromSpectraHeis(Figure):
1264 1283 self.setup(idfigure=idfigure,
1265 1284 nplots=nplots,
1266 1285 wintitle=wintitle,
1267 showprofile=showprofile)
1286 showprofile=showprofile,
1287 show=show)
1268 1288
1269 1289 tmin, tmax = self.getTimeLim(x, xmin, xmax)
1270 1290 if ymin == None: ymin = numpy.nanmin(datadB)
General Comments 0
You need to be logged in to leave comments. Login now