[35] | 1 | PRO pltsc,tab1,tab2, min1, max1, min2, max2, varname2, BOXZOOM = boxzoom, $ |
---|
[2] | 2 | COL1D=col1d,STY1D=sty1d,OV1D=ov1d, _extra = ex |
---|
| 3 | ; |
---|
| 4 | ; scatter plot (inspired from plt1d) |
---|
| 5 | ; |
---|
[114] | 6 | ; |
---|
| 7 | compile_opt idl2, strictarrsubs |
---|
| 8 | ; |
---|
[2] | 9 | |
---|
[35] | 10 | ;--------------------------------------------------------- |
---|
| 11 | ; include common |
---|
| 12 | @cm_4mesh |
---|
| 13 | @cm_4data |
---|
| 14 | IF NOT keyword_set(key_forgetold) THEN BEGIN |
---|
| 15 | @updatenew |
---|
| 16 | @updatekwd |
---|
| 17 | ENDIF |
---|
| 18 | ;-------------------------------------------------------------- |
---|
[2] | 19 | |
---|
| 20 | ; Rq: on ne reinitialise pas qd on rapelle pltsc |
---|
| 21 | if NOT keyword_set(ov1d) then reinitplt |
---|
| 22 | ;; reduce data xyzt domain |
---|
| 23 | |
---|
[35] | 24 | if keyword_set(boxzoom) then BEGIN |
---|
| 25 | Case 1 Of |
---|
| 26 | N_Elements(Boxzoom) Eq 1:bte = [lon1, lon2, lat1, lat2, 0., boxzoom[0]] |
---|
| 27 | N_Elements(Boxzoom) Eq 2:bte = [lon1, lon2, lat1, lat2, boxzoom[0], boxzoom[1]] |
---|
| 28 | N_Elements(Boxzoom) Eq 4:bte = [Boxzoom, vert1, vert2] |
---|
| 29 | N_Elements(Boxzoom) Eq 5:bte = [Boxzoom[0:3], 0, Boxzoom[4]] |
---|
| 30 | N_Elements(Boxzoom) Eq 6:bte = Boxzoom |
---|
| 31 | Else: Begin |
---|
| 32 | ras = report('Wrong Definition of Boxzoom') |
---|
| 33 | return |
---|
| 34 | End |
---|
| 35 | endcase |
---|
| 36 | savedbox = 1b |
---|
| 37 | saveboxparam, 'boxparam4pltsc.dat' |
---|
| 38 | domdef, bte, GRIDTYPE = vargrid |
---|
| 39 | ENDIF |
---|
[2] | 40 | |
---|
| 41 | ; extract indexes to plot |
---|
| 42 | |
---|
| 43 | indexm = where(tab1 LE valmask/10.) |
---|
| 44 | tab1 = tab1[indexm] |
---|
| 45 | tab2 = tab2[indexm] |
---|
| 46 | |
---|
| 47 | npts = (size(indexm))[1] |
---|
| 48 | |
---|
| 49 | ; deal with min and max of plot |
---|
| 50 | IF finite(min1) EQ 0 THEN min1 = min(tab1) |
---|
| 51 | IF finite(max1) EQ 0 THEN max1 = max(tab1) |
---|
| 52 | IF finite(min2) EQ 0 THEN min2 = min(tab2) |
---|
| 53 | IF finite(max2) EQ 0 THEN max2 = max(tab2) |
---|
| 54 | |
---|
| 55 | |
---|
| 56 | ; init plot if not overlay |
---|
| 57 | |
---|
| 58 | IF NOT keyword_set(ov1d) THEN placedessin, 'yfx', posfenetre, posbar, $ |
---|
| 59 | contour = contour, _extra = ex |
---|
| 60 | yy = tab1 |
---|
| 61 | xx = tab2 |
---|
| 62 | |
---|
| 63 | ; axis range |
---|
| 64 | !x.range = [min2-abs(max2-min2)/5.,max2+abs(max2-min2)/5.] |
---|
| 65 | !y.range = [min1-abs(max1-min1)/5.,max1+abs(max1-min1)/5.] |
---|
| 66 | |
---|
| 67 | IF (NOT keyword_set(sty1d)) THEN sty1d = 0 |
---|
| 68 | IF (NOT keyword_set(col1d)) THEN col1d = 0 |
---|
| 69 | IF NOT keyword_set(ov1d) THEN BEGIN |
---|
| 70 | legende, min1, max1, 'yfx', VARNAME2 = varname2, NPTS = npts, _EXTRA = ex |
---|
| 71 | ; |
---|
| 72 | plot,xx,yy, background = 255, psym = sty1d+1, color=col1d, thick=2 $ |
---|
| 73 | , title = '', subtitle = '',_extra = ex |
---|
| 74 | |
---|
| 75 | if n_elements(ex) NE 0 then BEGIN |
---|
[35] | 76 | ; pour avoir un cadre de la couleur 0 et trace une ligne a y=0 |
---|
| 77 | if (where(tag_names(ex) EQ 'COLOR'))[0] NE -1 then ex.COLOR = 0 |
---|
[2] | 78 | if (where(tag_names(ex) EQ 'LINESTYLE'))[0] NE -1 then ex.LINESTYLE= 0 |
---|
[35] | 79 | ENDIF |
---|
| 80 | plot, !x.range, [0, 0], /noerase, /nodata, xstyle = 1, ystyle = 1, _extra = ex |
---|
[2] | 81 | ; trace une ligne a x=0 |
---|
[35] | 82 | plot, [0, 0], !y.range, /noerase, /nodata, title = '', subtitle = '', _extra = ex |
---|
[2] | 83 | ENDIF ELSE oplot,xx,yy,color=col1d,linestyle=sty1d,thick=2, _extra = ex |
---|
| 84 | ;------------------------------------------------------------ |
---|
| 85 | ;------------------------------------------------------------ |
---|
| 86 | ; 3eme partie: impression eventuelle |
---|
| 87 | ;------------------------------------------------------------ |
---|
| 88 | ;------------------------------------------------------------ |
---|
| 89 | fini: |
---|
| 90 | terminedessin, _extra = ex |
---|
[35] | 91 | if keyword_set(savedbox) THEN restoreboxparam, 'boxparam4pltsc.dat' |
---|
[2] | 92 | ;------------------------------------------------------------ |
---|
| 93 | if n_elements(key_performance) NE 0 then $ |
---|
| 94 | IF key_performance EQ 1 THEN print, 'temps plt1d', systime(1)-tempsun |
---|
| 95 | ;------------------------------------------------------------ |
---|
| 96 | ;------------------------------------------------------------ |
---|
| 97 | ;------------------------------------------------------------ |
---|
| 98 | return |
---|
| 99 | end |
---|
| 100 | |
---|
| 101 | |
---|