1. This is dataplot macro ploterrorbars.dp 2. Purpose: Superimpose error bars on an (existing) plot 3. Date: October 17, 2011 ==> January 17, 2012 4. Assumption: A plot already exists 5. Input: 6. yplotucl (vector) = 95% upper confidence limits (formed in dexomp1.dp) 7. yplotlcl (vector) = 95% lower confidence limits (formed in dexomp1.dp) 8. xplotm (vector) = ordering vector xplotm(1) = the x-position for the 1st mean 9. color1, color2, color3, . . . (strings) = color for the lines 10. color1 = the color for factor id 1 11. bartype (string) = line type for the error bars (default = solid) 12. 13. Note: If no error bars appear, then make ylim wider and replot 14. 15. Note: If this routine is preceeded by call dexmp.dp, then need x1tic offset 16. before calling ploterrorbars.dp 17. but if this routine is preceeded by dex mean plot . . ., then not needed. 18. 19. -----start point----- 20. 21let pausesw = 0 22. 23if pausesw = 1 24 print " " 25 print "At the beginning of ploterrorbars.dp:" 26 . print xplotm yplotlcl yplotm yplotucl 27 . print color1 color2 color3 nplotm 28 . pause 29end if 30. 31let string colordez = blue 32if colordef exists; let string colordez = ^colordef; end if 33. 34. -----Step 1: Generate the plot----- 35. 36lines solid 37if bartype exists 38 lines ^bartype 39end if 40let nzz = number yplotlcl 41print nzz 42. pause 43loop for jdummy = 1 1 nzz 44 . 45 let jdummy2 = jdummy 46 if xplotm exists 47 let jdummy2 = xplotm(jdummy) 48 end if 49 . 50 line color ^colordez 51 if color^jdummy2 exists 52 line color ^color^jdummy2 53 end if 54 . 55 let yp1 = yplotlcl(jdummy) 56 let yp2 = yplotucl(jdummy) 57 . print "jdummy jdummy2 yp1 yp2 = ^jdummy ^jdummy2 ^yp1 ^yp2" 58 . pause 59 drawdddd jdummy2 yp1 jdummy2 yp2 60 . 61 if pausesw = 1 62 print jdummy jdummy2 yp1 yp2 63 if ibatch not exist or ibatch = 0; pause; end if 64 end if 65 . 66end loop 67line 68line color blue 69. 70. Note: If no error bars appear, then make ylim wider and replot 71. 72