Commit d4223576 authored by thomas.forbriger's avatar thomas.forbriger Committed by thomas.forbriger
Browse files

improved file name placement

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.


SVN Path:     http://gpitrsvn.gpi.uni-karlsruhe.de/repos/TFSoftware/trunk
SVN Revision: 4857
SVN UUID:     67feda4a-a26e-11df-9d6e-31afc202ad0c
parent 75d309b8
......@@ -28,6 +28,7 @@ c 24/05/00 V1.1 - file specific style settings
c - axis labels
c - line width and character height
c - fg and bg RGB
c 13/11/2012 V1.2 use different parameters for file name positioning
c
c==============================================================================
c
......@@ -46,9 +47,11 @@ c negative values means: unused
real pg_file_rgb(3,maxfiles)
c
c plotting parameters for file names
real pg_nam_maxheight, pg_nam_rest
real pg_nam_relwidth(maxfiles)
real pg_nam_ch, pg_nam_xsep, pg_nam_ysep, pg_nam_scale
integer pg_nam_maxlines
real pg_nam_xpos(maxfiles)
real pg_nam_ypos(maxfiles)
real pg_nam_yend(maxfiles)
real pg_nam_ch, pg_nam_linesep
c
c standard line width
integer pg_std_lw
......@@ -79,8 +82,8 @@ c common blocks
common /refr_pgpara/ pg_maindevice
common /refr_pgstrings/ pg_title, pg_xlabel, pg_ylabel,
& pg_pmmode, pg_pickmode
common /refr_pgnam/ pg_nam_relwidth, pg_nam_maxheight, pg_nam_rest,
& pg_nam_ch, pg_nam_xsep, pg_nam_ysep, pg_nam_scale
common /refr_pgnam/ pg_nam_xpos, pg_nam_ypos, pg_nam_yend,
& pg_nam_ch, pg_nam_linesep, pg_nam_maxlines
common /refr_pgfile/ pg_file_ls, pg_file_lw, pg_file_ci, pg_file_rgb
common /refr_pgstd/ pg_std_lw, pg_std_ch, pg_std_fgrgb, pg_std_bgrgb
common /refr_pgsettings/ pg_syntt_lw
......
......@@ -34,7 +34,7 @@ c 04/12/2009 V1.6 use correct DIN notation for units
c 26/11/2010 V1.7 provide means to select file formats
c 14/11/2011 V1.8 remember whether minoff is forced
c 12/11/2012 V1.9 new option -Sn
c 13/11/2012 V1.10 new option -Ef
c 13/11/2012 V1.10 new option -Ef and -TL
c
c==============================================================================
c
......@@ -64,7 +64,7 @@ c CVS Id
& '$Id$')
c commandline
integer maxopt
parameter(maxopt=62)
parameter(maxopt=63)
character*3 optid(maxopt)
character*120 optarg(maxopt)
logical optset(maxopt), opthasarg(maxopt)
......@@ -80,6 +80,9 @@ c titles, labels, legends
& '-Ts','-TM'/
data (opthasarg(i), i=16,22) /7*.TRUE./
data (optarg(i), i=16,22) /3*'-',2*'T','1.','0.,0.'/
data optid(63) /'-TL'/
data opthasarg(63) /.TRUE./
data optarg(63) /'5'/
c line options and color options
data (optid(i), i=23,30) /'-Lw','-Lc','-Lm','-Cb','-Cf',
& '-CW','-Cc','-Cm'/
......@@ -217,6 +220,9 @@ c titles, label, legends
read(optarg(21), *) opt_Tscale
opt_Tmodel=optset(22)
read(optarg(22), *) opt_Tmodt, opt_Tmodx
read(optarg(63), *) pg_nam_maxlines
if (pg_nam_maxlines.lt.1)
& stop 'ERROR: at least one line must be provided for file names'
c
c override traditional options
c ============================
......
......@@ -29,6 +29,7 @@ c 12/10/12 V1.2 in portrait mode file name legend did not contain
c the underlines within the plot area if more than
c one line was neede; resolved by workaround:
c increased x-range of world coordinates
c 13/11/2012 V1.3 use absolute coordinates
c
c==============================================================================
c
......@@ -40,37 +41,27 @@ c
include 'refract_para.inc'
include 'refract_seipar.inc'
c
real xpos, ypos, endpos
integer i
c
if (debug) print *,'DEBUG: entered pgfilenames'
c set viewport
call pgsave
call pgsvp(tov_vpright, 1., 0., 1.)
call pgswin(0., 1.1, 0., 1.0)
call pgsvp(tov_vpright, 1., tov_vpbot, tov_vptop)
call pgswin(0., 1.0, 0., 1.0)
c
xpos=(pg_nam_xsep+pg_nam_maxheight)*pg_nam_scale
ypos=pg_nam_ysep+pg_nam_rest*0.5
call pgsch(pg_nam_ch)
do i=1,nfiles
endpos=ypos+pg_nam_relwidth(i)*pg_nam_scale
call pgptxt(xpos,ypos,90.,0.,filename(i))
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.
& (pg_file_ci(i).gt.0)).and.(nfiles.gt.1)) then
call pgsave
call refract_selfilestyle(i)
call pgmove(xpos+0.5*pg_nam_xsep, ypos)
call pgdraw(xpos+0.5*pg_nam_xsep, endpos)
call pgmove(pg_nam_xpos(i)+0.75*pg_nam_linesep, pg_nam_ypos(i))
call pgdraw(pg_nam_xpos(i)+0.75*pg_nam_linesep, pg_nam_yend(i))
call pgunsa
endif
c
ypos=ypos+pg_nam_relwidth(i)*pg_nam_scale+pg_nam_ysep
endpos=ypos+pg_nam_relwidth(i)*pg_nam_scale+pg_nam_ysep
if (endpos.gt.1.) then
ypos=pg_nam_ysep+pg_nam_rest*0.5
xpos=xpos+pg_nam_xsep+pg_nam_maxheight*pg_nam_scale
endif
enddo
c
call pgunsa
......
......@@ -24,6 +24,7 @@ c ----
c
c REVISIONS and CHANGES
c 03/07/98 V1.0 Thomas Forbriger
c 13/11/2012 V1.1 do positioning by full trial and error
c
c==============================================================================
c
......@@ -37,65 +38,62 @@ c
c
integer i
real xbox(4), ybox(4), relheight
real xsep, ysep, xpos, ypos, newypos
real purexsep, pureysep
real thisch, scalfac
real xsep, ysep, xpos, ypos
real purexsep, pureysep, maxheight
real scalfac
integer scalstep, scalmaxstep, nline
logical gotit
parameter (purexsep=0.2, pureysep=0.05, scalmaxstep=10)
parameter (purexsep=0.1, pureysep=0.02, scalmaxstep=30)
c
c set viewport
call pgsvp(tov_vpright, 1., 0., 1.)
call pgswin(0., 1.1, 0., 1.)
call pgsvp(tov_vpright, 1., tov_vpbot, tov_vptop)
call pgswin(0., 1.0, 0., 1.)
c
pg_nam_maxheight=0.
do i=1,nfiles
call pgqtxt(0., 0., 270., 0., filename(i), xbox, ybox)
relheight=xbox(2)-xbox(1)
pg_nam_relwidth(i)=ybox(2)-ybox(3)
pg_nam_maxheight=max(pg_nam_maxheight, relheight)
enddo
c go and find best scale
pg_nam_rest=1.
call pgqch(thisch)
c go and find best scale by trial and error
scalstep=-1
gotit=.false.
do while ((.not.(gotit)).and.(scalstep.le.scalmaxstep))
c set parameters for this run
scalstep=scalstep+1
scalfac=0.75**scalstep
scalfac=0.98**scalstep
xsep=purexsep*scalfac
ysep=pureysep*scalfac
xpos=xsep
ypos=ysep
ypos=0.
pg_nam_ch=scalfac*pg_std_ch
pg_nam_linesep=xsep
nline=1
gotit=.true.
c go
call pgsch(pg_nam_ch)
maxheight=0.
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)
newypos=ypos+pg_nam_relwidth(i)*scalfac+ysep
if (newypos.gt.0.9) then
pg_nam_rest=min(pg_nam_rest, 1.-ypos-ysep)
ypos=ysep
pg_nam_xpos(i)=xpos
pg_nam_ypos(i)=ypos
call pgqtxt(xpos, ypos, 90., 0., filename(i), xbox, ybox)
pg_nam_yend(i)=ybox(4)
if (pg_nam_yend(i).gt.0.9) then
ypos=0.
nline=nline+1
xpos=pg_nam_maxheight*scalfac+xpos+xsep
xpos=maxheight+xpos+xsep
if (xpos.gt.1.) then
gotit=.false.
i=nfiles
endif
else
ypos=newypos
ypos=pg_nam_yend(i)+ysep
i=i+1
endif
i=i+1
enddo
pg_nam_rest=min(pg_nam_rest, 1.-ypos-ysep)
if (nline.gt.pg_nam_maxlines) gotit=.false.
enddo
c
if (scalstep.gt.scalmaxstep)
& stop 'ERROR (pgnamscal): could not scale filenames'
c
pg_nam_scale=scalfac
pg_nam_ch=thisch*scalfac
pg_nam_xsep=xsep
pg_nam_ysep=ysep
c
if (verbose) print *,'NOTICE (pgnamscal): use ',nline,' lines',
& ' with scaling factor ',pg_nam_scale
......
......@@ -47,7 +47,7 @@ c go
print *,'Usage: refract [-D] [-d dev] [-v] [-p] [-ty format]'
print *,' [-Tt title] [-Tx label] [-Ty label] [-Tm T|F]'
print *,' [-Ta label] [-Tl T|F] [-Ts factor] [-TM t,x]'
print *,' [-Lw width] [-Lc] [-Lm max] [-Lt width]'
print *,' [-TL n] [-Lw width] [-Lc] [-Lm max] [-Lt width]'
print *,' [-Cb r,g,b] [-Cf r,g,b] [-CW] [-Cc] [-Cm max]'
print *,' [-Eg] [-Ev] [-Eb] [-EP T|F] [-ES T|F] [-ET T|F]'
print *,' [-En] [-Es] [-Ew T|F] [-Et T|F] [-Ep T|F]'
......@@ -126,6 +126,8 @@ c
print *,'-Tl T|F print standard legend (T: yes; F: no)'
print *,'-Ts factor character height factor'
print *,'-TM t,x plot model box at time t and offset x'
print *,'-TL n do not use more than n lines for'
print *,' file name annotations'
print *,' '
print *,'Line options'
print *,'------------'
......
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