0

I have to assign 24 titles on 24 graphs with different values and values has a specific interval, how can I create these titles while creating multiple graphs with multiple-valued titles and how to save automatilcally these 24 graphs with different names say(1,2,3,4..) in IDL programming language

this is the structure of my code

pro prac_append
  out=indgen(24)+1
  ot=string(out,format='(I02.2)')

  fmt='d,d,d,d,d,d,d,d,d,d,d'

  cl=get_color(24,13)

  for i=0, n_elements(out)-1 do begin
    file=file_search('E:\ALL FORTRAN\fortran77_code\corrected\corrected_4\corrected_4\output'+ot[i]+'.txt')
    readcol,file,time,x,y,z,pz,pp,phi,eta,pitchangle,ke,deta,format=fmt

    p=plot(eta,deta,xtitle='eta',ytitle='dη',xstyle=1,xrange=[-7,7],yrange=[-0.8,0.6],color=cl[*,1],$
           title='eta(0)='+string(i+0.27318197))

    p.save,'E:\ALL FORTRAN\fortran77_code\corrected\corrected_4\corrected_4\new_plots\cor_deta\append prac\graph.png'

  endfor
  stop
end

thank you, your help will be appreciated

mgalloy
  • 2,356
  • 1
  • 12
  • 10

1 Answers1

0

For saving the files to different numbered filenames:

root = 'E:\ALL FORTRAN\fortran77_code\corrected\corrected_4\corrected_4\new_plots\cor_deta\append prac'
p.save, filepath(string(i, format='(%"graph-%02d.png")'), root=root)

What do you mean by "multiple-valued titles"? Depending on what you mean, you could do something similar to the above.

mgalloy
  • 2,356
  • 1
  • 12
  • 10