Debian Codegraph @

src/options_page.f90

raw
1 !-----------------------------------------------------------------
2 !
3 ! This file is (or was) part of SPLASH, a visualisation tool
4 ! for Smoothed Particle Hydrodynamics written by Daniel Price:
5 !
6 ! http://users.monash.edu.au/~dprice/splash
7 !
8 ! SPLASH comes with ABSOLUTELY NO WARRANTY.
9 ! This is free software; and you are welcome to redistribute
10 ! it under the terms of the GNU General Public License
11 ! (see LICENSE file for details) and the provision that
12 ! this notice remains intact. If you modify this file, please
13 ! note section 2a) of the GPLv2 states that:
14 !
15 ! a) You must cause the modified files to carry prominent notices
16 ! stating that you changed the files and the date of any change.
17 !
18 ! Copyright (C) 2005-2017 Daniel Price. All rights reserved.
19 ! Contact: [email protected]
20 !
21 !-----------------------------------------------------------------
22
23 !-------------------------------------------------------------------------
24 ! Module containing page settings and options
25 ! includes default values of these options and submenu for changing them
26 !-------------------------------------------------------------------------
27 module settings_page
28 use settings_limits, only:iadapt,iadaptcoords,adjustlimitstodevice,xminoffset_track,xmaxoffset_track
29 use labels, only:lenlabel
30 implicit none
31 integer :: iaxis,nacross,ndown,ipapersize,nstepsperpage,linewidth,iscalepanel,linepalette
32 integer :: iPlotLegendOnlyOnPanel,modlinestyle,modcolour,maxlinestyle,maxcolour
33 integer :: iPageColours,ipapersizeunits
34 logical :: iColourEachStep,iChangeStyles,tile,interactive,nomenu
35 logical :: iPlotLegend,iPlotStepLegend,iPlotTitles,usecolumnorder
36 logical :: iPlotScale,iUseBackgroundColourForAxes,usesquarexy
37 real :: papersizex,aspectratio
38 real :: hposlegend,vposlegend,fjustlegend,hpostitle,vpostitle,fjusttitle
39 real :: charheight,alphalegend
40 real :: dxscale,hposscale,vposscale,yscalealt
41 real :: xminpagemargin,xmaxpagemargin,yminpagemargin,ymaxpagemargin
42 character(len=lenlabel) :: legendtext, scaletext
43 character(len=lenlabel) :: labelyalt
44 integer, parameter :: maxc = 16
45 real :: colourpalette(3,maxc)
46
47 namelist /pageopts/ iaxis,nacross,ndown,interactive,iadapt,iadaptcoords, &
48 nstepsperpage,iColourEachStep,iChangeStyles,tile,ipapersize,papersizex,aspectratio, &
49 iPlotLegend,iPlotStepLegend,hposlegend,vposlegend,iPlotTitles,hpostitle, &
50 vpostitle,fjusttitle,legendtext,iPageColours,charheight,linewidth,&
51 fjustlegend,iPlotLegendOnlyOnPanel, &
52 iPlotScale,dxscale,scaletext,hposscale,vposscale,iscalepanel,iUseBackgroundColourForAxes, &
53 usesquarexy,maxlinestyle,modlinestyle,maxcolour,modcolour,usecolumnorder,ipapersizeunits,&
54 adjustlimitstodevice,alphalegend,yscalealt,labelyalt,xminoffset_track,xmaxoffset_track, &
55 xminpagemargin,xmaxpagemargin,yminpagemargin,ymaxpagemargin,linepalette
56
57 contains
58
59 !---------------------------------------------
60 ! set default values for these options
61 !---------------------------------------------
62 subroutine defaults_set_page
63 use shapes, only:defaults_set_shapes
64 use plotlib, only:plotlib_maxlinecolour
65
66 interactive = .true. ! default for interactive mode
67 iaxis = 0 ! turns axes off/on
68 nstepsperpage = 1
69 iColourEachStep = .true. ! change colours if nstepsperpage > 1
70 iChangeStyles = .false. ! change marker/ line styles if nstepsperpage > 1
71 tile = .true.
72 usecolumnorder = .true.
73 nacross = 1 ! number of plots across page
74 ndown = 1 ! number of plots down page
75 ipapersize = 0 ! paper size option
76 papersizex = 0.0 ! size of x paper (no call to PGPAP if zero)
77 aspectratio = 0.0 ! aspect ratio of paper (no call to PGPAP if zero)
78 ipapersizeunits = 1 ! units in which the paper size is set
79
80 iPlotLegend = .true. ! whether or not to plot legend
81 iPlotStepLegend = .false. ! timestep legend
82 hposlegend = 0.95 ! horizontal legend position as fraction of viewport
83 vposlegend = 2.0 ! vertical legend position in character heights
84 fjustlegend = 1.0 ! justification factor for legend
85 alphalegend = 0.5 ! transparency of overlaid annotation
86 legendtext = 't='
87 iPlotLegendOnlyOnPanel = 0
88
89 iPlotTitles = .false. ! whether or not to plot titles
90 hpostitle = 0.5 ! horizontal title position as fraction of viewport
91 vpostitle = 1.0 ! vertical title position in character heights
92 fjusttitle = 0.5 ! justification factor for title
93 iPageColours = 0
94 charheight = 1.0 ! character height
95 linewidth = 0 ! line width
96 linepalette = 0
97
98 iPlotScale = .false.
99 hposscale = 0.5
100 vposscale = 1.0
101 dxscale = 1.0
102 scaletext = '1 unit'
103 iscalepanel = 0
104 maxlinestyle = 5
105 modlinestyle = 1
106 modcolour = 1
107 maxcolour = plotlib_maxlinecolour
108
109 yscalealt = 1.
110 labelyalt = ' '
111
112 usesquarexy = .true. ! spatial dimensions have same scale
113 call defaults_set_shapes
114
115 xminpagemargin = 0.
116 xmaxpagemargin = 0.
117 yminpagemargin = 0.
118 ymaxpagemargin = 0.
119
120 colourpalette = reshape((/0.,0.,0., &
121 0.933,0.173,0.173, &
122 0.18,0.545,0.341, &
123 0., 0., 1., &
124 0.192, 0.31, 0.31, &
125 0.58, 0., 0.827, &
126 0.0, 0.825, 0.825, &
127 1., 0.31, 0., &
128 0.373, 0.62, 0.627, &
129 0.933, 0.796, 0.678,&
130 0.0, 1.0, 0.5, &
131 0.0, 0.5, 1.0, &
132 0.5, 0.0, 0.0, &
133 1.0, 0.0, 0.5, &
134 0.333, 0.333, 0.333,&
135 0.667, 0.667, 0.667/),shape(colourpalette))
136
137 return
138 end subroutine defaults_set_page
139
140 !---------------------------------------------
141 ! changed default values for evsplash
142 !---------------------------------------------
143 subroutine defaults_set_page_ev
144
145 nstepsperpage = 1000
146 iColourEachStep = .true. ! change colours if nstepsperpage > 1
147 iChangeStyles = .true. ! change marker/ line styles if nstepsperpage > 1
148 iPlotLegend = .true. ! whether or not to plot legend
149 iPlotStepLegend = .true. ! timestep legend
150 hposlegend = 0.1 ! horizontal legend position as fraction of viewport
151 vposlegend = 2.0 ! vertical legend position in character heights
152 fjustlegend = 0.0 ! justification factor for legend
153
154 end subroutine defaults_set_page_ev
155
156 !---------------------------------------------
157 ! changed default values for 360 video
158 !---------------------------------------------
159 subroutine defaults_set_page_360
160
161 iPageColours = 2
162 iaxis = -2
163 ipapersize = 18
164 ipapersizeunits = 0
165 papersizex = 1080. !4320.
166 aspectratio = 0.5
167 iPageColours = 2
168 adjustlimitstodevice = .true.
169
170 end subroutine defaults_set_page_360
171
172 !----------------------------------------------------------------------
173 ! submenu with options relating to page setup
174 !----------------------------------------------------------------------
175 subroutine submenu_page(ichoose)
176 use params, only:maxplot
177 use prompting, only:prompt,print_logical
178 use pagecolours, only:pagecolourscheme,colour_fore,colour_back,maxpagecolours,&
179 write_coloursfile,read_coloursfile
180 use plotlib, only:plotlib_supports_alpha,plotlib_maxlinecolour,plotlib_maxlinestyle,&
181 plotlib_is_pgplot,plotlib_maxpalette
182 use filenames, only:coloursfile
183 integer, intent(in) :: ichoose
184 integer :: iaction,i,iunitsprev,ierr,nc
185 real :: papersizey,mnraslength
186 character(len=15) :: paperfmtstr
187 character(len=3) :: string
188
189 iaction = ichoose
190
191 papersizey = papersizex*aspectratio
192 if (ipapersizeunits > 0) then
193 write(paperfmtstr,"(f5.2,1x,f5.2)") papersizex,papersizey
194 else
195 write(paperfmtstr,"(i5,' x ',i4)") nint(papersizex),nint(papersizey)
196 endif
197
198 print "(a)",'---------------- page setup options -------------------'
199
200 if (iaction <= 0 .or. iaction > 8) then
201 print "( "// &
202 "' 0) exit ',/, "// &
203 "' 1) plot n steps on top of each other (n =',i4,')',/, "// &
204 "' 2) axes options (',i2,')',/, "// &
205 "' 3) change paper size ("//trim(paperfmtstr)//" )',/, "// &
206 "' 4) subdivide page into panels (',i2,1x,'x',1x,i2,', tiling is ',a,')',/, "// &
207 "' 5) spatial dimensions have same scale ( ',a,' )',/,"// &
208 "' 6) set character height (',f4.1,')',/,"// &
209 "' 7) adjust line width (',i2, ')',/,"// &
210 "' 8) set page and line colours ( ',a,' )')", &
211 nstepsperpage,iaxis,nacross,ndown,print_logical(tile), &
212 trim(print_logical(usesquarexy)),charheight,linewidth,&
213 trim(pagecolourscheme(iPageColours,short=.true.))
214
215 call prompt('enter option ',iaction,0,8)
216 endif
217
218 select case(iaction)
219 !------------------------------------------------------------------------
220 case(1)
221 call prompt('Enter number of timesteps per panel ',nstepsperpage,1)
222 print*,'Plotting up to ',nstepsperpage,' timesteps per panel'
223 if (nstepsperpage > 1) then
224 if (iadapt .or. iadaptcoords) then
225 print "(a)",'(note that adaptive plot limits are now off)'
226 iadapt = .false.
227 iadaptcoords = .false.
228 endif
229 if (nstepsperpage > 14) then
230 print "(a)",'(warning: steps per panel > number of colours, ie. colours will repeat)'
231 endif
232 call prompt('Use different colours for each step?',iColourEachStep)
233 if (iColourEachStep) then
234 call prompt('How often to change colour? (1=every step, 2=every 2nd step etc.)',modcolour,1)
235 call prompt('Enter max number of colours to use before repeating (16=plot lib max)',&
236 maxcolour,1,plotlib_maxlinecolour)
237 endif
238 !! if (.not.iColourEachStep) icolourthisstep = 1
239 call prompt('Use different markers/line style for each step? ',iChangeStyles)
240 if (iChangeStyles) then
241 call prompt('How often to change line style (1=every step, 2=every 2nd step etc.)',modlinestyle,1)
242 write(string,"(i3)",iostat=ierr) plotlib_maxlinestyle
243 call prompt('Enter max number of line styles to cycle through before repeating ('// &
244 trim(adjustl(string))//'=plot lib max)',maxlinestyle,1,plotlib_maxlinestyle)
245 endif
246
247 if (iColourEachStep .or. iChangeStyles) then
248 print "(/,a,/,a)",' (to change the legend text, create a file called', &
249 ' ''legend'' in the working directory, with one label per line)'
250 call prompt('Plot legend of marker styles/colours?',iPlotStepLegend)
251 endif
252 endif
253 return
254 !------------------------------------------------------------------------
255 case(2)
256 print*,'-4 : draw box and major tick marks only;'
257 print*,'-3 : draw box and tick marks (major and minor) only;'
258 print*,'-2 : draw no box, axes or labels;'
259 print*,'-1 : draw box only;'
260 print*,' 0 : draw box and label it with coordinates;'
261 print*,' 1 : same as AXIS=0, but also draw the coordinate axes (X=0, Y=0);'
262 print*,' 2 : same as AXIS=1, but also draw grid lines at major increments of the coordinates;'
263 print*,' 3 : draw box, ticks and numbers but no axes labels;'
264 print*,' 4 : same as AXIS=0, but with a second y-axis scaled and labelled differently'
265 print*,' 5 : draw box, major ticks and numbers but no axes labels;'
266 print*,'10 : draw box and label X-axis logarithmically;'
267 print*,'20 : draw box and label Y-axis logarithmically;'
268 print*,'30 : draw box and label both axes logarithmically.'
269 call prompt('enter axis option ',iaxis,-4,30)
270 if (iaxis==4) then
271 call prompt('enter scale factor for alternative y axis',yscalealt,0.)
272 call prompt('enter label for alternative y axis',labelyalt)
273 endif
274 print *,' axis = ',iaxis
275 return
276 !------------------------------------------------------------------------
277 case(3)
278 print*,' 0) plotting library default '
279 print*,' 1) small square : 2.92 x 2.92 inches'
280 print*,' 2) medium square : 5.85 x 5.85 inches'
281 print*,' 3) large square : 8.00 x 8.00 inches'
282 print*,' 4) single small graph : 5.85 x 4.13 inches'
283 print*,' 5) duo small graph : 11.70 x 4.13 inches'
284 print*,' 6) duo graph : 11.70 x 6.00 inches'
285 if (plotlib_is_pgplot) then
286 print*,' 7) Custom size '
287 call prompt(' Enter option for paper size ',ipapersize,0,7)
288 else
289 print*,' 7) 800 x 600 pixels'
290 print*,' 8) 640 x 360 pixels (360p)'
291 print*,' 9) 1280 x 720 pixels (720p)'
292 print*,'10) 1920 x 1080 pixels (1080p/Full HD)'
293 print*,'11) 1024 x 768 pixels'
294 print*,'12) 1440 x 900 pixels'
295 print*,'13) 2560 x 1440 pixels'
296 print*,'14) 2560 x 1600 pixels'
297 print*,'15) 3840 x 2160 pixels (4KTV/Ultra HD)'
298 print*,'16) 4096 x 2160 pixels (Cinema 4K)'
299 print*,'17) 5120 x 2880 pixels (5K)'
300 print*,'18) 4320 x 2160 pixels (2160s)'
301 print*,'19) 8640 x 4320 pixels (4320s)'
302 print*,'20) 27320 x 3072 pixels (CAVE-2)'
303 print*,'21) 1/3 of A4 journal page 79mm x 180 mm'
304 print*,'22) 1/2 of A4 journal page 118mm x 180 mm'
305 print*,'23) full A4 journal page 236mm x 180 mm'
306 print*,'24) Custom size '
307 call prompt(' Enter option for paper size ',ipapersize,0,24)
308 endif
309
310 select case(ipapersize)
311 case(1)
312 ipapersizeunits = 1
313 papersizex = 0.25*11.7
314 aspectratio = 1.0
315 case(2)
316 ipapersizeunits = 1
317 papersizex = 0.5*11.7
318 aspectratio = 1.0
319 case(3)
320 ipapersizeunits = 1
321 papersizex = 8.0
322 aspectratio = 1.0
323 case(4)
324 ipapersizeunits = 1
325 papersizex = 0.5*11.7
326 aspectratio = 1./sqrt(2.)
327 case(5)
328 ipapersizeunits = 1
329 papersizex = 11.7
330 aspectratio = 0.5/sqrt(2.)
331 case(6)
332 ipapersizeunits = 1
333 papersizex = 11.7
334 papersizey = 6.0
335 aspectratio = papersizey/papersizex
336 case(7)
337 if (plotlib_is_pgplot) then
338 ipapersizeunits = 1
339 call prompt(' x size (inches) ',papersizex,0.0)
340 call prompt(' y size (inches) or aspect ratio (-ve)',papersizey)
341 if (papersizey < 0.0) then
342 aspectratio = abs(papersizey)
343 else
344 aspectratio = papersizey/papersizex
345 endif
346 else
347 ipapersizeunits = 0
348 papersizex = 800.
349 papersizey = 600.
350 aspectratio = papersizey/papersizex
351 endif
352 case(8:23)
353 if (plotlib_is_pgplot) then
354 ipapersizeunits = 1
355 papersizex = 0. ! use PGPLOT default
356 aspectratio = 0.
357 else
358 ipapersizeunits = 0
359 mnraslength = 56.*0.42175 ! 56pc = 672pts converted to cm
360 select case(ipapersize)
361 case(8)
362 papersizex = 640.
363 papersizey = 360.
364 case(9)
365 papersizex = 1280.
366 papersizey = 720.
367 case(10)
368 papersizex = 1920.
369 papersizey = 1080.
370 case(11)
371 papersizex = 1024.
372 papersizey = 768.
373 case(12)
374 papersizex = 1440.
375 papersizey = 900.
376 case(13)
377 papersizex = 2560.
378 papersizey = 1440.
379 case(14)
380 papersizex = 2560.
381 papersizey = 1600.
382 case(15)
383 papersizex = 3840.
384 papersizey = 2160.
385 case(16)
386 papersizex = 4096.
387 papersizey = 2160.
388 case(17)
389 papersizex = 5120.
390 papersizey = 2880.
391 case(18)
392 papersizex = 4320.
393 papersizey = 2160.
394 case(19)
395 papersizex = 8640.
396 papersizey = 4320.
397 case(20)
398 papersizex = 27320.
399 papersizey = 3072.
400 case(21) ! 1/3 of MNRAS page
401 ipapersizeunits = 2
402 papersizex = 18.
403 papersizey = mnraslength/3.
404 case(22) ! 1/2 of MNRAS page
405 ipapersizeunits = 2
406 papersizex = 18.
407 papersizey = 0.5*mnraslength
408 case(23) ! full MNRAS page, allowing 2cm for caption
409 ipapersizeunits = 2
410 papersizex = 18.
411 papersizey = mnraslength - 2.
412 end select
413 aspectratio = papersizey/papersizex
414 endif
415 case(24)
416 if (plotlib_is_pgplot) then
417 ipapersizeunits = 1
418 papersizex = 0. ! use PGPLOT default
419 aspectratio = 0.
420 else
421 iunitsprev = ipapersizeunits
422 print*,' 0) pixels '
423 print*,' 1) inches '
424 print*,' 2) cm '
425 call prompt(' choose units for paper size',ipapersizeunits,0,2)
426 if (ipapersizeunits /= iunitsprev) then
427 select case(ipapersizeunits)
428 case(2)
429 papersizex = 29.7
430 papersizey = 21.0
431 case(1)
432 papersizex = 11.0
433 papersizey = 8.5
434 case(0)
435 papersizex = 800.
436 papersizey = -0.75
437 case default
438 papersizex = 0.
439 papersizey = 0.
440 end select
441 endif
442 call prompt(' x size in above units ',papersizex,1.)
443 call prompt(' y size or aspect ratio (-ve)',papersizey)
444 if (papersizey < 0.0) then
445 aspectratio = abs(papersizey)
446 else
447 aspectratio = papersizey/papersizex
448 endif
449 endif
450 case default
451 ipapersizeunits = 1
452 papersizex = 0.0 ! no call to PGPAP if they are zero
453 aspectratio = 0.0
454 end select
455
456 call prompt('Adjust plot limits to match device aspect ratio?',adjustlimitstodevice)
457
458 return
459 !------------------------------------------------------------------------
460 case(4)
461 call prompt('Enter number of plots across (columns):',nacross,1,maxplot)
462 call prompt('Enter number of plots down (rows):',ndown,1,maxplot/nacross)
463 if (nacross*ndown > 1) then
464 call prompt('Tile plots on the page where possible?',tile)
465 call prompt('Plot panels across-then-down? (no=down-then-across)',usecolumnorder)
466 endif
467 return
468 !------------------------------------------------------------------------
469 case(5)
470 usesquarexy = .not.usesquarexy
471 print "(a)",' Same scale for spatial dimensions is '//print_logical(usesquarexy)
472 !------------------------------------------------------------------------
473 case(6)
474 call prompt('Enter character height ',charheight,0.1,10.)
475 return
476 !------------------------------------------------------------------------
477 case(7)
478 print "(3(/,a))",' Setting line width to 0 means automatic line width choice:', &
479 ' This gives width = 2 for vector devices (/ps,/cps etc)', &
480 ' and width = 1 elsewhere (e.g. for pixel devices)'
481 print*
482 call prompt('Enter line width (0=auto)',linewidth,0)
483 return
484 !------------------------------------------------------------------------
485 case(8)
486 print "(3(/,i1,')',1x,a))",(i,pagecolourscheme(i),i=0,maxpagecolours)
487 call prompt(' Choose page colour scheme ',iPageColours,0,maxpagecolours)
488
489 write(*,"(3(/,a))",advance='no') &
490 ' Overlaid (that is, drawn inside the plot borders) axis ',&
491 ' ticks, legend text and titles are by default plotted ', &
492 ' in the foreground colour'
493
494 if (iPageColours > 0) then
495 print "(a,/)",' [i.e. '//trim(colour_fore(iPageColours))//'].'
496 call prompt('Do you want to plot these in background colour [i.e. '&
497 //trim(colour_back(iPageColours))//'] instead?',&
498 iUseBackgroundColourForAxes)
499 else
500 print "(a,/)",'.'
501 call prompt('Use background colour for these? ',iUseBackgroundColourForAxes)
502 endif
503 if (iUseBackgroundColourForAxes .and. plotlib_supports_alpha) then
504 call prompt('Enter opacity for overlaid text and annotation ',alphalegend,0.0,1.0)
505 endif
506
507 print "(9(/,a))",&
508 '-1: custom', &
509 ' 0: giza default line palette ', &
510 ' 1: default PGPLOT line palette', &
511 ' 2: modified Tricco palette', &
512 ' 3: cheer up emo kid / grandma''s pillow', &
513 ' 4: outback desert moonscape',&
514 ' 5: colourblind safe line palette', &
515 ' 6: optimum line palette', &
516 ' 7: graph-a-licious'
517 call prompt('Enter line palette',linepalette,-1,plotlib_maxpalette)
518 if (linepalette < 0) then
519 call read_coloursfile(coloursfile,maxc,colourpalette,nc,ierr)
520 if (ierr /= 0 .or. nc <= 0) then
521 print*,' writing colours to file '//trim(coloursfile)
522 call write_coloursfile(trim(coloursfile),maxc,colourpalette)
523 else
524 print*,' colours written to file '//trim(coloursfile)
525 endif
526 print*,' edit this file to change the line palette'
527 print*,' ** press any key to continue **'
528 read*
529 endif
530 return
531 end select
532
533 return
534 end subroutine submenu_page
535
536 !----------------------------------------------------------------------
537 ! submenu with options relating to legend and title settings
538 !----------------------------------------------------------------------
539 subroutine submenu_legend(ichoose)
540 use filenames, only:fileprefix
541 use prompting, only:prompt,print_logical
542 use shapes, only:nshapes,labelshapetype,shape,submenu_shapes
543 use legends, only:prompt_panelselect
544 use labels, only:headertags,count_non_blank
545 integer, intent(in) :: ichoose
546 integer :: iaction,i,ierr,i1,i2,nhdr
547 character(len=50) :: string
548
549 iaction = ichoose
550 print "(a)",'---------------- legend and title options -------------------'
551
552 if (iPlotStepLegend) then
553 print "(/,a,/,a,/)",' Hint: to change the step legend text, create a file called', &
554 ' '''//trim(fileprefix)//'.legend'' in the working directory, with one label per line'
555 endif
556 if (iPlotTitles) then
557 if (.not.iPlotStepLegend) print "(a)"
558 print "(a,/,a,/)",' To set the plot titles, create a file called', &
559 ' '''//trim(fileprefix)//'.titles'' in the working directory, with one title per line'
560 endif
561
562 if (iaction <= 0 .or. iaction > 6) then
563 !--format shape settings string
564 if (nshapes > 0) then
565 i2 = 2
566 string = ': '
567 else
568 i2 = 0
569 string = ' '
570 endif
571 do i=1,nshapes
572 i1 = i2 + 1
573 i2 = min(i1 + len_trim(labelshapetype(shape(i)%itype)),len(string))
574 write(string(i1:i2),"(a)",iostat=ierr) trim(labelshapetype(shape(i)%itype)(1:i2-i1))
575 if (i < nshapes .and. i2 < len(string)) then
576 write(string(i2:i2+1),"(', ')",iostat=ierr)
577 i2 = i2 + 1
578 endif
579 enddo
580 !--print menu
581 print 20,print_logical(iPlotLegend),hposlegend,vposlegend,fjustlegend,trim(legendtext), &
582 print_logical(iPlotTitles),hpostitle,vpostitle,fjusttitle, &
583 print_logical(iPlotStepLegend), print_logical(iPlotScale), &
584 nshapes,trim(string)
585
586 20 format(' 0) exit ',/, &
587 ' 1) time legend settings (',1x,a,1x,f5.2,1x,f5.2,1x,f5.2,1x,'"',a,'")',/, &
588 ' 2) title settings (',1x,a,1x,f5.2,1x,f5.2,1x,f5.2,')',/, &
589 ' 3) legend for multiple steps per page on/off (',1x,a,1x,')',/, &
590 ' 4) plot scale |---| on coordinate plots (',1x,a,1x,')',/, &
591 ' 5) annotate plot (e.g. arrow,square,circle,text) (',1x,i2,a,')')
592
593 iaction = 0
594 call prompt(' Enter option ',iaction,0,6)
595 endif
596
597 select case(iaction)
598 case(1)
599 call prompt('Plot time legend? ',iPlotLegend)
600 print "(a)",'Time legend is '//print_logical(iPlotLegend)
601 if (iPlotLegend) then
602 print "(9(/,a),/)", &
603 ' Example format strings: ', &
604 ' t = : this is the default format "t = 0.1 years"', &
605 ' t = %t.5 : with time to 5 significant figures', &
606 ' Time: %t dog-%ut : gives "Time: 0.1 dog-years"', &
607 ' %(t + 2013) : prints time offset by 2013', &
608 ' %(t + 2013).5 : as above, to 5 sig. figs.', &
609 ' %(t*100) : multiplied by 100', &
610 ' %(t + 2013-04-10):dt : prints time as date offset by 2013-04-10', &
611 ' %(t + 2013-04-10 12:00):dt : prints time as date and time offset by 2013-04-10 12:00'
612 nhdr = count_non_blank(headertags)
613 print "(a)",' You can print any header variables using %(var):'
614 print "(43(2x,6(a),/))",headertags(1:nhdr)
615 print "(a)"
616
617 call prompt('Enter legend text ',legendtext)
618
619 print "(a)",'------ set legend position (can also be done interactively) --------'
620 call prompt('Enter horizontal position as fraction of viewport', &
621 hposlegend,0.0,1.0)
622 call prompt('Enter vertical position in character heights from top',vposlegend)
623 call prompt('Enter justification factor (0.0=left 1.0=right)',fjustlegend,0.0,1.0)
624 call prompt_panelselect('legend',iPlotLegendOnlyOnPanel)
625 endif
626 case(2)
627 print "(/,a,/,a,/)",' To set the plot titles, create a file called', &
628 ' '''//trim(fileprefix)//'.titles'' in the working directory, with one title per line'
629 call prompt('Use plot titles? ',iPlotTitles)
630 print "(a)",'Titles are '//print_logical(iPlotTitles)
631 if (iPlotTitles) then
632 print "(a)",'------ set title position (can also be done interactively) --------'
633 call prompt('Enter horizontal position as fraction of viewport', &
634 hpostitle,0.0,1.0)
635 call prompt('Enter vertical position in character heights above top',vpostitle)
636 call prompt('Enter justification factor (0.0=left 1.0=right)',fjusttitle,0.0,1.0)
637 endif
638 case(3)
639 iPlotStepLegend = .not.iPlotStepLegend
640 print "(a)",'Step legend is '//print_logical(iPlotStepLegend)
641 if (iPlotStepLegend) then
642 print "(/,a,/,a,/)",' Hint: to change the step legend text, create a file called', &
643 ' '''//trim(fileprefix)//'.legend'' in the working directory, with one label per line'
644 print*,' press return to continue '
645 read*
646 endif
647 case(4)
648 call prompt('Plot scale on co-ordinate plots? ',iPlotScale)
649 if (iPlotScale) then
650 call prompt('Enter length of scale in the current x,y,z units ',dxscale)
651 call prompt('Enter text to appear below scale (e.g. ''10 AU'')',scaletext)
652 call prompt('Enter horizontal position as fraction of viewport', &
653 hposscale,0.0,1.0)
654 call prompt('Enter vertical position in character heights above bottom',vposscale)
655 if (nacross*ndown > 1) then
656 call prompt('Enter which panel on the plotting page the scale should appear on '// &
657 '(0=all co-ordinate plots)',iscalepanel,0,nacross*ndown)
658 endif
659 endif
660 case(5)
661 call submenu_shapes()
662 end select
663
664 end subroutine submenu_legend
665
666 end module settings_page