; IDL Notebook: Plot | Michael Ian Lapsley

IDL Notebook: Plot

Posted on Friday, March 13, 2015, 8:58 AM

IDL Notebook: Examples and references from lessons learned while using IDL

Plot formatting examples:

; Plot
p = plot($

          x,y, $
          name = 'NameStr', $
          color = 'blue', $
          symbol = 'o',$
          margin=[0.1,0.1,0.2,0.14])

leg      = legend(position = [1,0.86])
p.xrange = [0,100]
p.yrange = [-0.2,1.2]
p.xtitle = 'XTitleStr'
p.ytitle = 'YTitleStr'
p.title  = 'TitleStr'


p.save,'ouputDirStr'+'fileNameStr'+'.png',resolution=300
p.close

-----------------------------------

Manually create legend:

;create legend
leg1 = legend()
leg1[1-1].label = ['ir source - atmosphere absorption']
for i = 1,size(alldarns,/n_elements) do begin
  leg1[i-1+1].label = ['channel:'+strtrim(channel[i-1],2)+' sern:'+allserns[i-1]+' darn:'+alldarns[i-1]]
endfor

-------------------------------------

Plot with N colors:

colorsN = unique_colors(N,/duller)
FOR I = 0,N-1 DO BEGIN
 PL1 = PLOT(x,y,color=colorsN[*,I],/OVERPLOT)
END

------------------------------------



No Response to "IDL Notebook: Plot"

Leave A Reply