Commit 7c94be5d authored by thomas.forbriger's avatar thomas.forbriger
Browse files

[WP][TASK] (refract): optionally reverse loop direction

This is a legacy commit from before 2015-03-01.
It may be incomplete as well as inconsistent.
See COPYING.legacy and README.history for details.

actual reverse processing of legend strings is implemented and tested
parent b589b398
......@@ -41,11 +41,12 @@ c
c
include 'refract_dim.inc'
include 'refract_data.inc'
include 'refract_opt.inc'
include 'refract_pgpara.inc'
include 'refract_para.inc'
include 'refract_seipar.inc'
c
integer i
integer i,j
c
if (debug) print *,'DEBUG: entered pgfilenames'
c set viewport
......@@ -54,7 +55,14 @@ c set viewport
call pgswin(0., 1.0, 0., 1.0)
c
call pgsch(pg_nam_ch)
do i=1,nfiles
do j=1,nfiles
c file index
if (opt_Treverselegend) then
i=nfiles+1-j
else
i=j
endif
c plot label
call pgptxt(pg_nam_xpos(i),pg_nam_ypos(i),90.,0.,filename(i))
c in case there are different styles to show
if (((plflag_color).or.(plflag_linestyle).or.
......
......@@ -23,22 +23,24 @@ c Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
c ----
c
c REVISIONS and CHANGES
c 03/07/98 V1.0 Thomas Forbriger
c 03/07/98 V1.0 Thomas Forbriger (thof)
c 13/11/2012 V1.1 do positioning by full trial and error
c 30/04/2013 V1.2 the algorithm resulted in an infinite loop, if
c the last filename would not fit into one line
c 21/03/2014 thof: provide reverse order of labels
c
c==============================================================================
c
subroutine refract_pgnamscal
c
include 'refract_dim.inc'
include 'refract_opt.inc'
include 'refract_data.inc'
include 'refract_pgpara.inc'
include 'refract_para.inc'
include 'refract_seipar.inc'
c
integer i
integer i,j
real xbox(4), ybox(4)
real xsep, ysep, xpos, ypos
real purexsep, pureysep, maxheight
......@@ -73,8 +75,14 @@ c go
call pgqtxt(xpos, ypos, 90., 0., 'Fyg', xbox, ybox)
maxheight=max(maxheight,xbox(1)-xbox(2))
xpos=xpos+maxheight
i=1
do while (i.le.nfiles)
j=1
do while (j.le.nfiles)
c file index
if (opt_Treverselegend) then
i=nfiles+1-j
else
i=j
endif
c place filename label at next available position and test bounding box
pg_nam_xpos(i)=xpos
pg_nam_ypos(i)=ypos
......@@ -88,12 +96,12 @@ c create a carriage return and line-feed
xpos=maxheight+xpos+xsep
if (xpos.gt.1.) then
gotit=.false.
i=nfiles+1
j=nfiles+1
endif
else
c label fits, shift to next position
ypos=pg_nam_yend(i)+ysep
i=i+1
j=j+1
endif
enddo
if (nline.gt.pg_nam_maxlines) gotit=.false.
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment