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 

Post the prototype please for multiplot

 
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: 1969
Location: South Pole, Antarctica

PostPosted: Tue Jun 18, 2019 1:23 am    Post subject: Post the prototype please for multiplot Reply with quote

I need to plot in one graph like 50 XY plots. This is useful for overview of large data. All curves depend on the same X. Unfortunately I have not followed development of %PL for the last year or so but remember Paul planned to realize this option. Can anyone post simplest possible working demo?
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


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

PostPosted: Tue Jun 18, 2019 9:11 am    Post subject: Reply with quote

Here is a sample program together with the associated comments...

Code:
      WINAPP
      INCLUDE <windows.ins>
      INTEGER M,N,i
      PARAMETER(N=11,M=20)
      REAL*8 xm,x(N),y(M*N)
      CHARACTER(len=24) str
      DO i=1,N
        xx = 0.1d0*(i-1)
        x(i) = xx
        xm = 0.1d0
        DO j=0,M-1
         y(i+j*N) = xm*xx
         xm = xm + 0.1d0
        ENDDO
      ENDDO
      i=winio@("%ca[Multi-graph]&")
      CALL winop@("%pl[n_graphs=20]") !20=M
      CALL winop@("%pl[stacked]")
      CALL winop@("%pl[x_array]")
      CALL winop@("%pl[x_max=1.0]")
      CALL winop@("%pl[dx=0.1]")
      CALL winop@("%pl[smoothing=4]")
      !Various line colours going from blue to red...
      DO j=1,M
        i = 255*j/M
        write(str,"(a,z6.6,a)") "%pl[colour=#", RGB@(255-i,0,i), "]"
        CALL winop@(trim(str))
      ENDDO 
      i=winio@('%pl&',400,250,N,x,y)
      i=winio@('%ff%nl%cn%tt[OK]')
      END


The value of n_graphs was limited to a maximum of 10.
This limit has now been removed. If n_graphs > 10 and more than one related call is made to winop@ then the value of n_graphs must be included in the first call to winop@.
A new %pl option [stacked] is provided for large values of n_graphs in order to avoid multiple winio@ arguments for the y arrays (and the x arrays when they are "independent").
[stacked] treats the y data as one large array with the values for the second graph added to the end of those for the first and so on (similarly for independent x arrays). If each graph has the same number of points, this is equivalent to using a 2-dimensional array with the data values on the first index and n ranging from 1 to n_graphs on the second index.
Back to top
View user's profile Send private message
DanRRight



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

PostPosted: Tue Jun 18, 2019 10:07 am    Post subject: Reply with quote

That was exactly what i needed, thanks Paul! Looks also very nice. We have so much data generated by PIC codes that to find optimum often the only way is to plot huge amount of plots or make a movie just not to miss some rear or sharp peak value

The only what i failed with this demo is that when i add %pv to make plot to be re-sizable
Code:
      ix = 400; iy=250
      i=winio@('%pv%pl&',ix,iy,N,x,y)

it does not by some reason resize...
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


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

PostPosted: Tue Jun 18, 2019 11:15 am    Post subject: Reply with quote

You probably just need %ww.
Back to top
View user's profile Send private message
DanRRight



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

PostPosted: Tue Jun 18, 2019 9:57 pm    Post subject: Reply with quote

Yes, %ww solves this. Very common time trap, by the way, which annoyed me in the past a lot. Because everything else works without %ww. And typically in couple years user forgets this again. I already discussed this here i think after getting kick from %pv Smile. As a potential suggestion, can CWP be made accepting %pv without %ww ? And if not, or not desirable, then to warn user in popup screen to add %ww ? This will make CWP more user friendly.

In the [independent] mode when x values are different for each of the n_graphs can number of X points N be also made independent ?
Back to top
View user's profile Send private message
John-Silver



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

PostPosted: Thu Jun 20, 2019 2:57 am    Post subject: Reply with quote

Dan, I think this (from the on-line documentation) means yes it can ...
Quote:

The option [independent] provides for independent x-data for each graph. In this case the number of data points must be presented as a variable (for one graph) or as an array (for one or more graphs) where the array index corresponds to the order in which the graphs are coded. This is also the case for the optional x-start and x-increment data. As a result, these values can be changed after a window has been formed.


(ref. https://silverfrost.com/ftn95-help/clearwinp/simplepl/native.aspx)
_________________
''Computers (HAL and MARVIN excepted) are incredibly rigid. They question nothing. Especially input data.Human beings are incredibly trusting of computers and don't check input data. Together cocking up even the simplest calculation ... Smile "
Back to top
View user's profile Send private message
John-Silver



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

PostPosted: Thu Jun 20, 2019 2:58 am    Post subject: Reply with quote

Paul, is that example in the documentation somewhere ?

The fact that the number of curves is now unlimited (?) should be noted too in the doc.
_________________
''Computers (HAL and MARVIN excepted) are incredibly rigid. They question nothing. Especially input data.Human beings are incredibly trusting of computers and don't check input data. Together cocking up even the simplest calculation ... Smile "
Back to top
View user's profile Send private message
DanRRight



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

PostPosted: Thu Jun 20, 2019 12:35 pm    Post subject: Reply with quote

Cool
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


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

PostPosted: Mon Jun 24, 2019 1:55 pm    Post subject: Reply with quote

ClearWin+ has been modified in order to allow %pv (and resizing) without %ww. This is experimental and will appear in the next release of the DLLs.
Back to top
View user's profile Send private message
John-Silver



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

PostPosted: Tue Jun 25, 2019 9:44 pm    Post subject: Reply with quote

the current latest beta dlls being ... ? .... 38 ?
_________________
''Computers (HAL and MARVIN excepted) are incredibly rigid. They question nothing. Especially input data.Human beings are incredibly trusting of computers and don't check input data. Together cocking up even the simplest calculation ... Smile "
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
Page 1 of 1

 
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