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, 6 ... 18, 19, 20  Next
 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> ClearWin+
View previous topic :: View next topic  
Author Message
John-Silver



Joined: 30 Jul 2013
Posts: 631

PostPosted: Fri Jul 07, 2017 2:21 am    Post subject: Reply with quote

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


It actually works partially for me in that:

a) the 'top' of the curve is originally missing but appears after slightly re-sizing the window, albeit still outside the graph frame

b) the scales change to the better version!!!

Apart from that, I agree 100% that the user-choice of scale labelling styles is essential.

Now, I ran the last 'extended data' example in ftn95 (32bit) using this code:

Code:

   use clrwin
!   parameter (N=5)
   parameter (N=8)
   real*8 X(N), Y(N)
!   Data X/1e1, 1e2, 1e3,  1e4, 1e5/
!   Data Y/2.2, 66, 5555, 1111, 777/
   Data X/0.01,0.1,1,10, 100,1000,10000,100000/
   Data Y/0.011,0.044,0.33,2.2,66,3333,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


Either I made a stupid mistook or the result is even stranger than anything before !



Odd scale spacings in Y (1.1^n ?),
curve plotted out of frame bottom left,
Y scale 0.11 crosses tick marks,
Y axis totle crosses scale labels !

... and why what appears to be a shift in the curve location (by 2 orders of magnitude in both x and y directions) ?

Strange .... or more probably my mistake.
I've probably made a stoopid mistake in the redefined data.

I haven't tried 64bit yet.
Back to top
View user's profile Send private message
DanRRight



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

PostPosted: Fri Jul 07, 2017 5:11 pm    Post subject: Reply with quote

I see same plot like you. Bug.
Back to top
View user's profile Send private message
Kenneth_Smith



Joined: 18 May 2012
Posts: 159
Location: Glasgow, Scotland.

PostPosted: Sun Sep 03, 2017 9:03 pm    Post subject: Reply with quote

Thought I'd share these plots - all produced using the new native %pl



One thing for the nice to have list - it would be good if you could set width for each plot in turn - at present this is specified just once - for all curves in the %pl region.

Regards

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


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

PostPosted: Mon Sep 04, 2017 6:45 am    Post subject: Reply with quote

Thanks for the feedback Ken. Unfortunately the extension to variable width is unlikely to be feasible within the current design constraints.
Back to top
View user's profile Send private message
Robert



Joined: 29 Nov 2006
Posts: 223
Location: Manchester

PostPosted: Mon Sep 04, 2017 9:06 am    Post subject: Reply with quote

It is great to see some 'real' uses of FTN95. Great images too!
Back to top
View user's profile Send private message Visit poster's website
Kenneth_Smith



Joined: 18 May 2012
Posts: 159
Location: Glasgow, Scotland.

PostPosted: Mon Sep 04, 2017 9:44 am    Post subject: Reply with quote

Thanks Paul, I thought that might be the case for the width option.

For those that are curious, the polar plots are produced as follows:
1. Setting the width and height of the %pl region to be equal.
2. Use independent option for the data arrays to be plotted
3. Plot a circle that encloses all the vectors this forces the x and y limits of the axis, both positive and negative to be the same. I have chosen to show this on the plot, but it could be made invisible.
4. Each individual vector/phasor is stored as two arrays say x(1:2) and y(1:2). X(1) and y(1) = 0.d0, x(2) = real part of the vector, and x(2) = imaginary part.
5. The ends of the vectors (circles, squares etc) are added via a call back function using the normal %gr drawing routines.

The only odd thing I have noted is that sometimes the tick marks on the x and y axis (which are selected automatically) are different, even although the magnitude of the data to be plotted has the same extent (due to the enclosing circle). This can be seen in the plots above.

The plots are certainly more informative than the text data at the bottom left hand side which contains all the information in the plots.

Regards

Ken
Back to top
View user's profile Send private message Visit poster's website
DanRRight



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

PostPosted: Tue Sep 05, 2017 3:15 pm    Post subject: Reply with quote

Can native %pl plot two lines on the same plotting area each having its own (X,Y) set of data and own number of points?
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


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

PostPosted: Tue Sep 05, 2017 3:49 pm    Post subject: Reply with quote

Yes you can have a number of graphs on one x-y frame each with its own independent data and with its own number of points. In this case the argument giving the number of points becomes an array of values rather than a single scalar value.
Back to top
View user's profile Send private message
DanRRight



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

PostPosted: Tue Sep 05, 2017 7:38 pm    Post subject: Reply with quote

Cool, thanks.
Back to top
View user's profile Send private message
Kenneth_Smith



Joined: 18 May 2012
Posts: 159
Location: Glasgow, Scotland.

PostPosted: Tue Sep 05, 2017 10:19 pm    Post subject: Reply with quote

Dan,

Very quick and dirty demonstration for you.

Ken

Code:
module mod1
implicit none
real(kind=2) x1(1:2), x2(1:2), y1(1:2), y2(1:2)
integer:: n(1:2) = (/2,2/)

contains

  subroutine main
  include<windows.ins>
  integer i
  do i = 1, 2, 1
    x1(i) = RANDOM@()
    x2(i) = RANDOM@()
    y1(i) = RANDOM@()
    y2(i) = RANDOM@()
  end do

    i=winio@('%`bg[white]&')
    call winop@("%pl[native]")
    CALL winop@("%pl[smoothing=4]")
    CALL winop@("%pl[width=2]")
    CALL winop@("%pl[x_array]")
    CALL winop@("%pl[x_min=0,x_max=1]")  !######
    CALL winop@("%pl[y_min=0,y_max=1]")  !######
    call winop@("%pl[N_GRAPHS=2]")
    CALL winop@("%pl[independent]")
    CALL winop@("%pl[link=lines,link=lines]")
    CALL winop@("%pl[colour=red, colour=blue]")
    call winop@("%pl[pen_style=0,pen_style=0]")
    i = winio@('%pl&',400,250,n,x1,y1,x2,y2)
    i = winio@('%ff%nl%cn%^tt[NEXT]',update)
  end subroutine main

  integer function update()
  include<windows.ins>
  integer i
  do i = 1, 2, 1
    x1(i) = RANDOM@()
    x2(i) = RANDOM@()
    y1(i) = RANDOM@()
    y2(i) = RANDOM@()
  end do
    call SIMPLEPLOT_REDRAW@()
    update = 1
  end function update

end module mod1

program test
use mod1
implicit none
  call main
end program test
Back to top
View user's profile Send private message Visit poster's website
DanRRight



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

PostPosted: Wed Sep 06, 2017 1:14 pm    Post subject: Reply with quote

Thanks Ken, that was very usable demo, saving me time for initial experimentation which is always the most unpleasant with Clearwin - you try, and try and try and things are not working, not working and not working and when eventually it start working you do not understand what was wrong in the first place Smile

I hope Silverfrost will eventually include numerous demo examples.
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


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

PostPosted: Mon Sep 11, 2017 1:24 pm    Post subject: Reply with quote

Dan (and other 64 bit %pl users)

I was planning to fix some of these issues but there is too much information here for me to process. Would you be willing to isolate one issue at a time and post some code that demonstrates each failure. Just one detail at a time please and when that is fixed we could move on to the next.
Back to top
View user's profile Send private message
DanRRight



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

PostPosted: Mon Sep 11, 2017 3:45 pm    Post subject: Reply with quote

Paul,

Yes, we can summarize all the problems in one page

1) One critical strategic moment has to be in mind before you start (to avoid fixing of current fixing) : at some point the native %pl has to offer scalability when you use mouse to resize: by fixing aspect ratio it has to offer proportional changes of the sizes of all elements on the plotting surface like all Pro plotting software is doing by default. Here is Originlab:

This is needed both for run-time and postprocessor visualization graphics and specifically for presentations and publications where each publisher has own requirements. Right now changing plotting area size creates havoc in the initially adjusted position of all elements and requires reprogramming. Scalability has to be a default and changed by the user.

2) As we all showed above, the current native %pl is close to exceed all other plotters in simplicity being of topmost classic look, production quality, ready for any highend (Nature, Scientific American etc) publications. That means either all lines and fonts have to be specific size (say lines 2 pixel wide, specific fonts, bold size, border sizes etc ) by default or Styles have to be introduced at some point (like Default Style, Classic1, Classic2, MyStyle1 etc) and invoked in one simple call. And that means these lines like in the example above
Code:
  i=winio@('%sf%ts%bf%es&', 2d0)
  call winop@("%pl[axes_pen=3,width=3,x_axis='Radius(cm)',y_axis='Temperature (MeV)']")

have to be hidden inside some new keyword for Style %st[1] or so being editable by the user. Current default (one pixel lines, fonts sizes, borders) follows old dead Simpleplot %pl default and looks unacceptably bad as it was shown above many times.

3) Then the LOG (log_log, log_lin, lin_log) plotting to be fixed first which has the most of problems right now. You can start with the last demo example few posts back

4) Anything else mentioned above is a bonus


Last edited by DanRRight on Tue Sep 12, 2017 3:50 am; edited 7 times in total
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


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

PostPosted: Mon Sep 11, 2017 4:27 pm    Post subject: Reply with quote

Dan

I will aim to add "fixed_aspect" as an option.

I would need a working program and all its data. Is that available and if so where?
Back to top
View user's profile Send private message
DanRRight



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

PostPosted: Mon Sep 11, 2017 4:32 pm    Post subject: Reply with quote

Paul
That fixed style would be great

As to source examples and data I have emailed to you sources and data for LINEAR plotting. For the LOG plotting this example has all numbers set in the DATA and its pictures published few posts back
Code:
   use clrwin
 !   parameter (N=5)
    parameter (N=8)
    real*8 X(N), Y(N)
 !   Data X/1e1, 1e2, 1e3,  1e4, 1e5/
 !   Data Y/2.2, 66, 5555, 1111, 777/
    Data X/0.01,0.1,1,10, 100,1000,10000,100000/
    Data Y/0.011,0.044,0.33,2.2,66,3333,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


and this example (discussed in CONTINUE2 above and the pictures are posted there too) also does not need external files, it creates data by itself
Code:
   WINAPP
    MODULE modd
    USE clrwin
    INTEGER,PARAMETER::N=65
    REAL*8 X(N),Y(N),Z(N),T(N), U(N)
    !.....................................
    CONTAINS
    !.....................................
    INTEGER FUNCTION callb()
    REAL(2) random
    DO i=1,N
      X(i)=i
      Y(i)=exp(0.35*i) * random()
      T(i)=Y(i)     
      Z(i)=exp(0.7*i) * (random()-0.003)
      U(i)=Z(i)
    ENDDO
    CALL SIMPLEPLOT_REDRAW@
    callb = 2
    END FUNCTION
    END MODULE

    !.....................................
    PROGRAM KKK
    USE modd

    j=callb()
    i=winio@('%ww&')
    CALL winop@("%pl[native]")
!    CALL winop@('%pl[title="Log_linear@(115,299)"]')
    CALL winop@('%pl[title="Title: ideal log_linear@(-15,10)"]')
    CALL winop@("%pl[x_array]")
    CALL winop@("%pl[scale=log_linear]")
!    CALL winop@("%pl[y_min=.3]")
    CALL winop@("%pl[y_max=1e7]")
    CALL winop@("%pl[N_GRAPHS=4]")
    call winop@("%pl[framed]")
    CALL winop@("%pl[tick_len=10]")
    CALL winop@("%pl[axes_pen=4]")
    CALL winop@("%pl[x_axis='Wavelength (A)@(-202,2)']")
    CALL winop@("%pl[y_axis='Intensity (arb.units)@(-20,-222)']")

 !  i=winio@('%fn[Tahoma]&')  ! Verdana
    i=winio@('%sf&')
    i=winio@('%ts&', 2.2d0)
    i=winio@('%tc&',rgb@(0,0,0))
    i=winio@('%bf&')

    CALL winop@("%pl[width=3]")
    CALL winop@("%pl[colour=red,link=none,symbol=7]")
    CALL winop@("%pl[colour=blue,link=none,symbol=9]")
    CALL winop@("%pl[symbol_size=8.]")
    CALL winop@("%pl[colour=black]")
    CALL winop@("%pl[colour=green]")
    i=winio@('%pv%pl&', 700,570, N, X,Y,Z,T,U) 
    i=winio@('%ac[Ctrl+Z]&',callb)
    i=winio@('%sf%ts&', 1.d0)
    i=winio@('%ff%cn%^bt[Redraw]%es',callb)
    END
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, 6 ... 18, 19, 20  Next
Page 5 of 20

 
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