forums.silverfrost.com Forum Index forums.silverfrost.com
Welcome to the Silverfrost forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Native %pl
Goto page Previous  1, 2, 3, 4, 5 ... 26, 27, 28  Next
 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> ClearWin+
View previous topic :: View next topic  
Author Message
DanRRight



Joined: 10 Mar 2008
Posts: 2813
Location: South Pole, Antarctica

PostPosted: Thu Jun 08, 2017 9:49 am    Post subject: Reply with quote

John, Here is the link on my Microsoft Onedrive open account, file IdealPL.zip has data, sources and examples made in OriginLab for visual comparison with professional scientific graphics software

Code:
https://1drv.ms/u/s!Ao024Ta1-aVRhylqx47UY5Sx6W0p


Other demos are also open for everyone (excluding EXE file and PS_problem were for my own use)
Back to top
View user's profile Send private message
John-Silver



Joined: 30 Jul 2013
Posts: 1520
Location: Aerospace Valley

PostPosted: Fri Jun 09, 2017 8:34 am    Post subject: Reply with quote

thanks Dan.

Well running the code of 21st April post (which is same Ithink as the code in your zip file) with DLLs8 I have no problem with compilation (which you did with dlls7), and the Y scale looks fine with integer values plotted on the scale.
X-scale title is still right-justified.

I did however have to delete the code of the first %ww (with the 'original' plot) because it went off the bottom of my screen and no way to view it !
Even re-sizing by hand didn't help because no scroll bars.
I'm confused as to why, I was actually expecting 2 seperate windows. Why does it produce everything in one window (all in the second one: 'Default Window' ) ?
Back to top
View user's profile Send private message
DanRRight



Joined: 10 Mar 2008
Posts: 2813
Location: South Pole, Antarctica

PostPosted: Fri Jun 09, 2017 4:02 pm    Post subject: Reply with quote

John,
You can rearrange these two windows from stacking vertical to horizontal position adding just a pair of %ob/%cb for these two lines

Code:

      i=winio@('%ww[no_border]%ob&')
      i=winio@('%gr[BLACK]%ff%cb%lw&',660, 550, ilw)


Vertical window positioning was taken because i used large resolution 3840x2160 (4k TV as a PC monitor).

/** which i also recommend to everyone - this is way cheaper and infinitely better than any non-4k real PC large monitors in the world. Latter one because there are no PC monitors of size ~50" but this is exactly the minimum size all monitors have to have. As the owner of many top notch monitors in the past (i hated some of them despite their sometimes $3-4K price tags) i will assure that you will be stunned both with the improved quality of work and entertainment. Also, before, couple years back, only NVIDIA 900 series videocards worked with 4K monitors via HDMI ports, but today probably all work (the only condition for good text rendering is that the monitor has to support 60Hz at 4:4:4 chroma simultaneously. And if your kids play games on it then it has to have also small input lag ~25ms or less in game mode. There such good chroma bandwidth is rarely needed. Consumption is by the way only 72W in my case of 50", less then for 2-3x smaller CRT monitors).
Back to top
View user's profile Send private message
John-Silver



Joined: 30 Jul 2013
Posts: 1520
Location: Aerospace Valley

PostPosted: Wed Jun 21, 2017 8:08 am    Post subject: Reply with quote

finally got back onto the benchmarking on my machine.
thanks for the file Dan and the mod to get everything on my screen.

I don't see all the problems you commented on on 8th May.

Re-sizing doesn't do strange things with axes scales.

I did notice one small thing which hasn't been mentioned before -
the very first label on x-axis scale is not centre justified over tick -axis tick mark, it looks like it's left justified against the left extreme of the y axis tick mark just above it.
A small and subtle discrepancy.

This is presumeably to avoid clashing of the x-axis and y-axis lbels when they both exist ?

The curves still plot out of the graphic area.
To note here, playing around with an Excel plot (chart), they too extend beyond the borders of the graphic frame but only marginally. Just enough to indicate that the curves go out of bounds but nothing drastic like we have in ftn95 at the moment
.[/img]


Last edited by John-Silver on Wed Jun 21, 2017 8:42 am; edited 1 time in total
Back to top
View user's profile Send private message
John-Silver



Joined: 30 Jul 2013
Posts: 1520
Location: Aerospace Valley

PostPosted: Wed Jun 21, 2017 8:26 am    Post subject: Reply with quote

I turned my attention, as another benchmark) to the example programs in the documentation:
http://silverfrost.com/ftn95-help/clearwinp/simplepl/native.aspx

The first one runs fine, however the second one, namely:


Code:
      WINAPP
      MODULE mydata
        USE clrwin
        ENUM,BIND(C)
         ENUMERATOR::link_none=0,link_lines,link_curves !values 0,1,2
         ENUMERATOR::all_graphs=0,graph1                !values 0,1
        END ENUM
        INTEGER,PARAMETER::n=1000
        LOGICAL shown
        DOUBLE PRECISION y(n)
      CONTAINS
      INTEGER FUNCTION show()
        INTEGER errstate
        errstate = change_plot_int@(0,"link",graph1,link_curves)
        if(errstate /= 0) print*, clearwin_string@("ERROR_REPORT")
        errstate = change_plot_int@(0,"colour",graph1,RGB@(255,0,0))
        errstate = change_plot_dbl@(0,"y_max",all_graphs,1.5d0)
        shown = .true.
        CALL simpleplot_redraw@()
        show = 2
      END FUNCTION show
      INTEGER FUNCTION clear()
        INTEGER errstate
        errstate = change_plot_int@(0,"link",graph1,link_none)
        shown = .false.
        CALL simpleplot_redraw@()
        clear = 2
      END FUNCTION clear
      INTEGER FUNCTION legend()
        IF(shown) THEN
          CALL draw_characters@("Legend:..", 300, 100, 0)
          CALL draw_line_between@(300,120,360,120,RGB@(0,0,255))
        ENDIF
        legend = 2
      END FUNCTION legend
      END MODULE mydata
     
      PROGRAM main
      USE mydata
      INTEGER i,x
      DOUBLE PRECISION p1,p2,p3
      p1=1.5d0
      p2=150.0d0
      p3=15d0
      x=0
      DO i=1,n
        y(i)=p1*sin(x/p3)*exp(-x/p2)
        x=x+1
      ENDDO
      shown = .false.
      i=winio@('%ww[no_border]%ca[Damped wave]%pv&')
      i=winio@('%mn[Edit[Show, Clear]]&', show, clear)
      i=winio@('%fn[Tahoma]&')
      i=winio@('%ts&', 1.1d0)
      i=winio@('%tc&',rgb@(0,0,80))
      i=winio@('%it&')
      i=winio@('%`bg&',rgb@(230,255,225))
      CALL winop@("%pl[native]")
      CALL winop@('%pl[title="Sample plot"]')
      CALL winop@("%pl[x_axis=Time(Milliseconds)]")
      CALL winop@("%pl[y_axis=Amplitude@(-4.0)]")
      CALL winop@("%pl[smoothing=4]") ! anti-aliasing
      CALL winop@("%pl[link=none]")   ! delay drawing
      i=winio@("%^pl",500,400,n,0.0d0,1.0d0,y,legend)
      END


won't run for some reason.
I'm running as 32bit
I get this message:


with details as follows:


I then tried running it as 64bit and got this message during SLINK64 :-
Quote:
[SLINK64 v1.8, Copyright (c) Silverfrost Ltd. 2015-2017]
***Command file terminated unexpectedly - use a file command to save the load.


Any ideas why this is not running ?
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 7916
Location: Salford, UK

PostPosted: Wed Jun 21, 2017 10:21 am    Post subject: Reply with quote

The 64 bit case runs OK for me. I will take a look at the 32 bit case.
Back to top
View user's profile Send private message AIM Address
DanRRight



Joined: 10 Mar 2008
Posts: 2813
Location: South Pole, Antarctica

PostPosted: Wed Jun 21, 2017 11:00 pm    Post subject: Reply with quote

John,
1) What are your screen dimensions? You may not see all these problems if you resize the plot but the screen size is not large enough

2) The Silverfrost demo code you posted crashes in 32bit case too.
The 64 run OK

BTW, from my quick look : what is ENUMERATOR and the code with it for?
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 7916
Location: Salford, UK

PostPosted: Thu Jun 22, 2017 9:02 am    Post subject: Reply with quote

John

I have not looked at this yet but I think that Dan has highlighted the problem...
The new ENUM feature is not working in this program for 32 bits. Try using PARAMETER instead.
Back to top
View user's profile Send private message AIM Address
John-Silver



Joined: 30 Jul 2013
Posts: 1520
Location: Aerospace Valley

PostPosted: Sat Jun 24, 2017 8:36 am    Post subject: Reply with quote

in the error message for my SLINK64 above, what does ...
Quote:
use a file command to save the load.

mean ?
... and what's the 'command file' which is referred to ?
Back to top
View user's profile Send private message
John-Silver



Joined: 30 Jul 2013
Posts: 1520
Location: Aerospace Valley

PostPosted: Sat Jun 24, 2017 8:49 am    Post subject: Reply with quote

I also havee the same quaìestion as Dan, 'what does this ENUMERATOR code do ?'
... and that might clify to me what you mean by 'replace it with PARAMETER' (or maybe it won't ! , at the moment I have no idea what you mean)
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 7916
Location: Salford, UK

PostPosted: Sat Jun 24, 2017 11:18 am    Post subject: Reply with quote

John

I don't reognise the error report and I don't have access to a PC at the moment.

For the code
Code:
ENUM,BIND(C)
         ENUMERATOR::link_none=0,link_lines,link_curves !values 0,1,2
         ENUMERATOR::all_graphs=0,graph1                !values 0,1
        END ENUM


use
Code:
INTEGER,PARAMETER::link_none=0
INTEGER,PARAMETER::link_lines=1
INTEGER,PARAMETER::link_curves=2


etc. ENUMERATOR simply provides automatic numbering of integer values.
Back to top
View user's profile Send private message AIM Address
Kenneth_Smith



Joined: 18 May 2012
Posts: 697
Location: Hamilton, Lanarkshire, Scotland.

PostPosted: Mon Jun 26, 2017 3:45 pm    Post subject: Reply with quote

Paul,

I curious to know if you have been able to make any progress with the suggestions I made back at the beginning of May?

Thanks

Ken
Back to top
View user's profile Send private message Visit poster's website
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 7916
Location: Salford, UK

PostPosted: Mon Jun 26, 2017 7:00 pm    Post subject: Reply with quote

Ken

I haven't done any work on this for a while. I am hoping to review this thread an make some final adjustments some time before the next full release.
Back to top
View user's profile Send private message AIM Address
Kenneth_Smith



Joined: 18 May 2012
Posts: 697
Location: Hamilton, Lanarkshire, Scotland.

PostPosted: Mon Jun 26, 2017 10:06 pm    Post subject: Reply with quote

Thanks Paul. I found myself looking at the native %pl again today after 6 weeks doing other things and rediscovering some of the minor issues for a second time - my memory is not as good as it used to be - hence the question.
Ken
Back to top
View user's profile Send private message Visit poster's website
DanRRight



Joined: 10 Mar 2008
Posts: 2813
Location: South Pole, Antarctica

PostPosted: Mon Jul 03, 2017 4:01 pm    Post subject: Reply with quote

Addition to my post called CONTINUE2 above about LOG scale.

1) With the latest DLLs i found that the code produces initially bad looking Y scale numbering and goes out of scale, see for example this simple code (the code for plotting must be always short and simple like this or even shorter)

Code:
   use clrwin
   parameter (N=5)
   real*8 X(N), Y(N)
   Data X/1e1, 1e2, 1e3,  1e4, 1e5/
   Data Y/2.2, 66, 8333, 1111, 777/

   i=winio@('%ww%pv%pl[framed,x_array,scale=log_log,N_GRAPHS=1]%es', 625,500, N, X, Y) 

   end




But if you try to resize the plot just a tiny bit pulling window border or corner using mouse it abruptly displays everything correctly.

Interesting is that if we change one number 8333 to 3333 this trick does not work

Probably will be easy to fix.

2) I hope that in the future after fixing all the bugs Silverfrost will make the default plotting with the one simple command like with the code above and the plot will look nice and perfectly ready for publication. This is how Matlab is doing that flattening competition landscape for decades. Of course it is easy to do all the "beautifications" with just one-two more lines of code like here
Code:
   use clrwin
   parameter (N=5)
   real*8 X(N), Y(N)
   Data X/1e1, 1e2, 1e3,  1e4, 1e5/
   Data Y/2.2, 66, 8333, 1111, 777/

   i=winio@('%sf%ts%bf%es&', 2d0)
   call winop@("%pl[axes_pen=3,width=3,x_axis='X Axis Title',y_axis='Y Axis Title']") 

   i=winio@('%ww%pv%pl[native,framed,x_array,scale=log_log,N_GRAPHS=1]', 625,500, n, X, Y) 
   end




But my previous two decades experience with the hundreds of uses of Simpleplot in my codes tells me that beautification takes a lot of time so that you end up with no any. As a result many my plots which were quickly made look ugly like the first picture above, and there is no time to change anything because any touch to the working CWP code always causes many recompilations, CWP has a lot of intricate details you always forget.

This nicer looking example shows the defects of absence of Scientific, Decimal etc numbering formatting options: the numbering does not look concise, in one style, it mixes different styles.

3) As to the numbering formats of LOG plots we here suggested to introduce few distinct user-definable formatting options: Scientific (numbers shown as 10^0, 10^1, 10^2, 10^3 etc) and Decimal (1, 10, 100, 1000...). All these ( and few other options like Engineering (1e0, 1e1, 1e2, 1e3) and Decimal with FP (1.0, 2.0, 3.0) ) are already there, they just need to be introduced into the user changeable settings.

With the LOG scale it is often possible for the code to choose these formats automatically: if the numbers are very small or very large and there are a lot of orders of magnitude to display then just the Scientific format has to be used

At the end here how this exact XY data is visualized by the professional scientific software using Scientific and Decimal formats. As you can compare the new %PL is already pretty close to the best of the best (the new PL can also do antialiasing for curves and in this example is even better doing data interpolation - compare how 8333 peak values are displayed)



Decimal format is of course the most difficult. If extend the plotted data to
Code:
0.01  0.011
0.1   0.044
1      0.33
10      2.2
100      66
1000   8333
10000  1111
100000  777

the OriginLab plots it this way

and if even more then 1e-3, 1e-4 ...


Last edited by DanRRight on Sun Apr 15, 2018 11:28 am; edited 4 times in total
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> ClearWin+ All times are GMT + 1 Hour
Goto page Previous  1, 2, 3, 4, 5 ... 26, 27, 28  Next
Page 4 of 28

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group