Silverfrost Forums

Welcome to our forums

Problems with %pl

22 Dec 2019 5:17 #24801

New release is soon coming. Curious was this most annoying defect fixes already ? Or is there a workaround against of it ? You can not photoshop it after saving. Probably applying another bug mentioned above (placing characters on top) it is possible to move numbering to the left but i am not sure it always will work. In demo reproducer i was unable to repeat it

https://i.postimg.cc/QCNzn1rC/Bugs-tics-And-Numbering.jpg

24 Dec 2019 9:10 #24802

I forgot if another suggestion was mentioned to change not convenient

  CALL winop@(\'%pl[symbol=8]\') 
  CALL winop@(\'%pl[symbol_size=4]\') 

to convenient

  CALL winop@(\'%pl[symbol]\', 7) 
  CALL winop@(\'%pl[symbol_size]\', 4) 

Otherwise if you need to dynamically change width and type of symbols you will need to add a lot of source text for each of multiple curves plotted simultaneously

character chLineWid16, chSymbolType16, chSymbolSize*18

  chSymbolType = '%pl[symbol=  ]'
  write(chSymbolType(12:13),'(i2)',err=301) iSymbolType_f_x(6)
  goto 1301 

301 chSymbolType = '%pl[symbol= 7]' 1301 CALL winop@(chSymbolType)

 chSymbolSize = '%pl[symbol_size=  ]'
 write(chSymbolSize(17:17),'(i1)',err=2301) iSymbolSize_f_x(6)
 goro 3301 

2301 chSymbolSize = '%pl[symbol_size= 4]' 3301 CALL winop@(chSymbolSize)

24 Dec 2019 10:25 #24803

I have made a note to add a new function.

In the meantime, is it not possible to write the new function in Fortran?

24 Dec 2019 10:55 #24804

Paul,

If you are going to be looking at %pl again, can I suggest that two additional symbols would be a valuable addition (to myself anyway):

[symbol=12] Draw + [symbol=13] Draw X

Merry Christmas everybody!

Ken

24 Dec 2019 2:00 #24805

Ken

I can add this to the list but it is quite independent of the previous request which simply requires a little function to covert the arguments.

Paul

24 Dec 2019 3:38 #24806

Dan

A set of routines is already available as described in item 406 of cwplus.enh....

        SUBROUTINE WINOP_INT@(fmt, dval)
        SUBROUTINE WINOP_FLT@(fmt, fval)
        SUBROUTINE WINOP_CLR@(fmt, cval) !for colours
        SUBROUTINE WINOP_STR@(fmt, sval)
        SUBROUTINE WINOP_HDL@(fmt, hval)
        SUBROUTINE WINOP_FUN@(fmt, fun)
        CHARACTER(*) fmt,sval
        INTEGER dval,cval
        DOUBLE PRECISION fval
        INTEGER(7) hval
        DOUBLE PRECISION FUNCTION fun(x)
        DOUBLE PRECISION x
29 Dec 2019 4:42 #24813

Thanks Paul. Is this any better and faster cure then the way I provided ? Was there any particular reason to implement this such cumbersome way? This solution halted my brain to understand why, say, changing number 8 to 7 will require to fly through Australia. In the Help no reasoning or examples showing advantages of using was provided. Why not implement

CALL winop@('%pl[symbol=7]')

by obvious way

CALL winop@('%pl[symbol]', 7)

or at least kind of semi-standard Clearwin way

CALL winop@('%pl[symbol=@]', 7) ??? Will this allow to change plot parameters (widths, symbol sizes etc) dynamically after the plot was already made while my way will not? The minimal size but nicest looking working examples always help to understand these features.

30 Dec 2019 8:23 #24814

Dan

This is what you asked for and is already available (maybe because you asked for it previously).

Where you asked for:

CALL winop@('%pl[symbol]', 7)

you must write:

CALL winop_int@('%pl[symbol]', 7)

The new functions were provided in the simplest and most natural way available when writing DLL functions in C for a Fortran or C++ source. The new functions could have overloaded the name winop@ but (for me) that would not be the natural way to do it. There will be no noticeable difference in speed.

30 Dec 2019 11:07 #24816

This does not look as bad as I thought. It's a bit puzzling without an example. But now I understand. Thanks

3 Jan 2020 12:01 #24822

This loaded meaning of the common word 'overload' made me confused, too, when I first came across it in the 1990-s.

An overloaded word has to bear the burden of having multiple meanings. For example, the verb 'put' is given 57 different definitions in the Oxford English Dictionary.

Please see https://en.wikibooks.org/wiki/Computer_Programming/Function_overloading .

20 Jan 2020 3:51 #24907

Ken

I have added symbol 12 and 13.

22 Jan 2020 11:00 #24915

Thanks Paul, that's very much appreciated. Ken

17 Feb 2020 11:46 #24986

Paul, symbols 12 and 13 working as expected in release V8.61. Thank you.

9 Apr 2020 9:15 #25172

I have reviewed this thread and here is a sample program that illustrates how to draw multiple titles at specified points on the graph.

      WINAPP
      MODULE mydata
        USE clrwin
        INTEGER,PARAMETER::n=1000
        DOUBLE PRECISION y(n)
      CONTAINS
      INTEGER FUNCTION legend()
        DOUBLE PRECISION xpix,ypix
        IF(clearwin_string@('CALLBACK_REASON') == 'PLOT_ADJUST') THEN
          ir = get_plot_point@(400.0d0,1.4d0,xpix,ypix)
          CALL italic_font@(0); CALL bold_font@(1); CALL scale_font@(1.1d0)
          CALL draw_charactersD@('Sample plot', xpix, ypix, RGB@(0,0,128))
          ! **** More titles can go here ****
        ENDIF
        legend = 2
      END FUNCTION legend
      END MODULE mydata
      
      PROGRAM main
      USE mydata
      INTEGER i,x
      DOUBLE PRECISION p1,p2,p3,z
      p1=1.5d0
      p2=150.0d0
      p3=15d0
      x=0
      DO i=1,n
        z=p1*sin(x/p3)*exp(-x/p2)
        y(i) = z
        x=x+1
      ENDDO
      i=winio@('%ww[no_border]%ca[Damped wave]%pv&')
      i=winio@('%fn[Tahoma]&')
      i=winio@('%ts&', 1.1d0)
      i=winio@('%it&')
      i=winio@('%`bg&',rgb@(230,255,225))
      CALL winop@('%pl[native,gridlines]')
      CALL winop@('%pl[x_axis=Time(Milliseconds)]')
      CALL winop@('%pl[y_axis=Amplitude]')
      CALL winop@('%pl[smoothing=4]')
      i=winio@('%^pl',500,400,n,0.0d0,1.0d0,y,legend)
      END
Please login to reply.