Silverfrost Forums

Welcome to our forums

%pl and Simpleplot graphs

23 Oct 2014 1:35 #14920

Dan,

I am moving our discussion about Simpleplot and %pl to a new topic as it seems to me more apropriate, considering the focus of the problems we have being discussing during the last weeks.....thus, taking your last comment from the previous topic:

You know how much time i lost on the bugs of SPlot? Just today 3 hours full voice swearing (was getting exception violations on 10 years old code). And i thought i know all its pitfalls. This POS somehow i still don't understand is sensitive to the data it plots even if it is in the real*4 limits range. How to find the error in this case if source is not available and using debugger is not possible ? If author would at least cleaned the source and got the major bugs out then being eternal betatester of SP would not suck so much

I have to say that I had a different experience....I used Simpleplot with FTN77, FTN90 and FTN95 (both versions, i.e. Salford and Silverfrost) and I do not remember to have had a problem with exception violation....as you know, I practically don't use %pl except as [user_drawn], so that I code always direct calls to Simpleplot subroutines. I wonder if your problems are always with %pl or you found that also calls to Simpleplot gave you exception violations. I think it would be good for the discussion if you could share with us the bugs you found. As you know, I do not consider Simpleplot as a perfect graphical solution for FTN95, but is the only free-one that I found till now. I gave a look at DSLIN and did not find a way to use it with Clearwin, so it was out of discussion for me, and a couple of tests with Simdem did not gave me similar results as Clearwin+Simpleplot: it seemed that Simdem has its proper output, which is nice if you like it, but you cannot configure a Clearwin window as you want. That's the reason I am still with Simpleplot, with all the limitations it still has because is a ...uhmm...10 years old software?.

Agustin

25 Oct 2014 12:22 #14934

Here is one more bug: i changed linewidth to 7, which is seen by very thick axis, but plot linewith did not increase. It sometimes changes up by one pixel and then get back http://s25.postimg.org/6ijhbeadr/Line_Width_Bug.png

25 Oct 2014 2:03 #14937

It looks like you have called thckmg subroutine for the axes and not for the curves....sounds strange...I would like to see your code in order to check what seems to be wrong......

Agustin

26 Oct 2014 2:05 #14938

The source code is not extractable easily from the larger code. The called stuff before %pl is standard like in all examples above in older thread.

      CALL DIAGLV (0)
      CALL TEXTMN(sngl(SimplotCircEq_FontSize)) ! 0.35) 
      CALL AXLBJS('*C','C') 
      call thckmg('LINE',sngl(SimplotCircEq_lineWid)) ! 3 
      call chset(iSimplotCircEq_FontCharset) ! -11) 

   i=winio@('%pv%pl[x_axis='Time ',y_axis=Amplitude,&      
   &title='U(red, green-anal), U_A on load(orange), I(blue, black-anal)',&
   &colour=red, colour=blue, colour=green, colour=black, colour=#CC8800,X_ARRAY, N_GRAPHS=5]&',&
   &833,300,narr,timearr1,yarr1(1,1),yarr1(1,2),yarr1(1,3),yarr1(1,4),yarr1(1,5))
26 Oct 2014 2:13 #14941

please, check this code:

 Module SomeFun
 INCLUDE <windows.ins>
 real*8 :: TextSize=0.41
 integer:: LineWidth=1, iCharacterSetNo=-11, N=100,A=25
 Real*8  x(100), y(100), z(100), u(100), v(100), w(100)
 CONTAINS
 integer function RedrawS ()
 CALL DIAGLV (0)
 CALL TEXTMN(sngl(TextSize)) ! 45)
 CALL AXLBJS('*C','C')
 call thckmg('LINE', float(LineWidth))
 call chset(iCharacterSetNo)
 call simpleplot_redraw@
 RedrawS = 1
 End function
  End Module SomeFun
 Program Simple2
 use SomeFun
 do i=1,N;
 x(i)=i-1
 y(i)=A*sin(i/30.)**2;
 z(i)=A*sin(i/30.)**5;
 u(i)=A*sin(i/30.)**10;
 v(i)=A*cos(i/30.)**10;
 w(i)=A*sin(i/30.)**2 * cos(i/30.)**2;
 enddo
 i=winio@('%sy[3d_raised]&')
 i=winio@('%1tl%nd%nr&',16)
 i=winio@('%2.1ob[invisible,bottom_exit]&')
 i=winio@('Text   size   %ta%df%6^rf%ff&', 1d-2, TextSize, RedrawS)
 i=winio@('Line Width %ta%dd%6^rd%ff&', 1, LineWidth, RedrawS)
 i=winio@('%cb&')
 i=winio@('%ta Charset  (-12 to +26)%ta%dd%6^rd&', &
          1, iCharacterSetNo, RedrawS)
 i=winio@('%cb&')
 i=winio@('%ww%pv%pl[x_axis='Time [s]',y_axis=Amplitude,&     
    &title='U (red),    U_A (orange),     I (blue) ', &
    & colour=red, colour=blue, colour=green, colour=black, &
    &colour=#CC8800, X_ARRAY, N_GRAPHS=5]&',&
    & 833, 300, N, x, y, z, u, v, w)
 i=winio@('%ac[esc]%ff&', 'exit')
 i=winio@('%cn%^6bt[E&xit]','exit')
End Program 

it tries to do what you say and in my case, I get that all the lines have the same thickness. In fact, when you use %pl instead of Simpleplot subroutines, you are not in control of the different lines: you just set the thickness of any line before entering in %pl, so that all lines, axes and curves should have the same properties.. I do not see with your partial code why you are getting different results. If the code above works for you, seems that the problem is not with Simpleplot.....

Agustin

26 Oct 2014 11:37 #14943

What was the trick in this code above? Quick look at this code tells that it is the same as in the other thread which I know that it works fine. But the one I report as buggy is essentially the same code, it has just more irrelevant stuff in modules to post here. Yet it glitches. Something interferes with not so robust and not polished by many users %pl. I actually suspect I was so far the only one 'betatester' who used it from its start in 90-th 😃 . Well, will try to extract the %pl code from larger one when have time and see what that gives.

26 Oct 2014 11:55 #14944

there is no trick at all... 😃 ...it's a short version of the previous ones as you noted.....I put it to show you that it was quite strange what you found with your code.....I use %pl as well, but only when the plots are quite simple and I do not require a lot of customisation......so you are not alone with %pl!....what I suspect is that you are using several %pl statements and likely before one of them you are setting the thickness of the lines and in the other one not.....but as you know, without the more or less complete code I cannot check that.....I know that you like a single command for plotting, but my advise is to use %pl, if you like it, as user_drawn and allow the customisation of the graphs by using direct calls to Simpleplot subroutines....

so, in the end, I do not find that it was a bug in Simpleplot, but something else in some part of your code.....

Agustin

27 Oct 2014 7:13 (Edited: 27 Oct 2014 7:30) #14945

John, You could be right. Some bug adjusts linewidth wrong way

I extracted the buggy code, it is still pretty large, i am trying to shorten it, will post it soon if this is not my own error

27 Oct 2014 7:37 #14946

Well, the reason seems is different. Here is this @#$%^ bug in all its glory. I reproduced it on our regular test code. It happens when Y value becomes negative. I changed only Y(i) function to allow it to be negative. When Y is always positive the linewidth is 7. When Y gets both positive and negative it switches to 1.

Module SomeFun 
  INCLUDE <windows.ins> 
  real*8 :: TextSize=0.41 
  integer:: LineWidth=7, iCharacterSetNo=-11, N=100,A=25 
  Real*8  x(100), y(100), z(100), u(100), v(100), w(100) 
  CONTAINS 
  integer function RedrawS () 
  CALL DIAGLV (0) 
  CALL TEXTMN(sngl(TextSize)) ! 45) 
  CALL AXLBJS('*C','C') 
  call thckmg('LINE', float(LineWidth)) 
  call chset(iCharacterSetNo) 
  call simpleplot_redraw@ 
  RedrawS = 1 
  End function 
   End Module SomeFun 
  Program Simple2 
  use SomeFun 
  do i=1,N; 
  x(i)=i-1 
  y(i)=A*sin(i/30.); 
  z(i)=A*sin(i/30.)**5; 
  u(i)=A*sin(i/30.)**10; 
  v(i)=A*cos(i/30.)**10; 
  w(i)=A*sin(i/30.)**2 * cos(i/30.)**2; 
  enddo 
  i=winio@('%sy[3d_raised]&') 
  i=winio@('%1tl%nd%nr&',16) 
  i=winio@('%2.1ob[invisible,bottom_exit]&') 
  i=winio@('Text   size   %ta%df%6^rf%ff&', 1d-2, TextSize, RedrawS) 
  i=winio@('Line Width %ta%dd%6^rd%ff&', 1, LineWidth, RedrawS) 
  i=winio@('%cb&') 
  i=winio@('%ta Charset  (-12 to +26)%ta%dd%6^rd&', & 
           1, iCharacterSetNo, RedrawS) 
  i=winio@('%cb&') 
  i=winio@('%ww%pv%pl[x_axis='Time [s]',y_axis=Amplitude,&      
     &title='U (red),    U_A (orange),     I (blue) ', & 
     & colour=red, colour=blue, colour=green, colour=black, & 
     &colour=#CC8800, X_ARRAY, N_GRAPHS=5]&',& 
     & 833, 300, N, x, y, z, u, v, w) 
  i=winio@('%ac[esc]%ff&', 'exit') 
  i=winio@('%cn%^6bt[E&xit]','exit') 
 End Program
27 Oct 2014 12:55 #14952

as far as I remember (I do not have my computer with me at this moment) the 'default' value for lines thickness in Simpleplot is 1, so that it seems that %pl does not like negative data in the curves so much and resets the value of the curves line to 1. Why?....well seems that we can only say that Simpleplot is 'not guilty' as, as John said, it apparently comes from some kind of bug in %pl, and that's a problem for Silverfrost not for 'BUSS'. John: have you tested the problem with direct calls to Simpleplot using the spwin module or the %pl[user_drawn] way?......I wonder if it also happens with %pl as a user drawn window.....

Agustin

29 Oct 2014 3:34 #14959

Here is another damn problem with %pl. Data sensitivity. The Y values less then around 1d-50 could crash %pl. We all know it is confusing that Simpleplot is real4 while %pl is real8 so i do not get in this mousetrap again and all small values are substituted with something around 1e-30. Still i get this crash inside the Simpleplot as you can see from the debugger information. So far I tried many thing but my old large code crashes in some specific initial data parameter space. Will continue debug when have spare time, i lost too much for now for this @#$%.

http://s25.postimg.org/6qi6sf8cv/Data_Sensitivity.png

Please login to reply.