 |
forums.silverfrost.com Welcome to the Silverfrost forums
|
View previous topic :: View next topic |
Author |
Message |
Kenneth_Smith
Joined: 18 May 2012 Posts: 818 Location: Lanarkshire, Scotland.
|
Posted: Sat Mar 25, 2017 10:19 am Post subject: |
|
|
1500 lines of code to produce this writing to a %gr region
At most 30 lines to present 95% of the same information with the new %pl
Don't be disheartened by our grumblings Paul.
Ken |
|
Back to top |
|
 |
DanRRight
Joined: 10 Mar 2008 Posts: 2927 Location: South Pole, Antarctica
|
Posted: Sat Mar 25, 2017 6:03 pm Post subject: |
|
|
More complaints - better product - more users - happier developers.
But not for a long time, because more users - louder, more intense the outcry 
Last edited by DanRRight on Tue Mar 28, 2017 11:25 pm; edited 1 time in total |
|
Back to top |
|
 |
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 8217 Location: Salford, UK
|
Posted: Wed Mar 29, 2017 7:28 am Post subject: |
|
|
John
The place to look is in ftn95.chm under ClearWin+->SIMPLEPLOT->Native graph plotting.
Here is a quote about adjusting the position of the captions...
Quote: | If ClearWin+ draws a title or axis caption at an inappropriate point then its position can be adjusted. For example [title=My Graph@(4.8)] using a decimal point, draws "My Graph" at a point that is adjusted 4 pixels to the right and 8 pixels down from its default position. |
Here is another quote...
Quote: | The following routine can be called from within a %PL callback function in order to get the pixel coordinates of a particular point relative to the axes.
SUBROUTINE GET_PLOT_POINT@(x,y,xpix,ypix)
REAL*8 x,y (input values)
REAL*8 xpix,ypix (output values)
The function returns zero on success or a non-zero error code.
|
but it is not a SUBROUTINE. It is a FUNCTION returning an INTEGER. |
|
Back to top |
|
 |
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 8217 Location: Salford, UK
|
Posted: Sat Apr 01, 2017 8:03 pm Post subject: |
|
|
Perhaps I am misunderstanding. GET_PLOT_POINT@(0.0d0,0.0d0,xp,yp) gives the origin for the axes. You also know the (x,y) values for a given tick mark so you can get the corresponding pixel co-ordinates. |
|
Back to top |
|
 |
DanRRight
Joined: 10 Mar 2008 Posts: 2927 Location: South Pole, Antarctica
|
Posted: Sun Apr 02, 2017 1:28 am Post subject: |
|
|
Can we get pixel (or actual plotted X,Y) coordinates of the mouse like with usual %gr? |
|
Back to top |
|
 |
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 8217 Location: Salford, UK
|
Posted: Sun Apr 02, 2017 8:18 am Post subject: |
|
|
Dan
The native %pl uses a %gr region so you should be able get the mouse position in the same way. If not then please post a sample to show how it would be coded.
John
There is now an option (probably only in the next release) to set the margin so I am hoping that this will mean that you will be able to do what you want. |
|
Back to top |
|
 |
DanRRight
Joined: 10 Mar 2008 Posts: 2927 Location: South Pole, Antarctica
|
Posted: Thu Apr 06, 2017 12:09 am Post subject: Re: |
|
|
PaulLaidler wrote: |
Naturally it can't handle log y for negative y and to switch to a linear scale seems reasonable to me. Negative values of log y are more difficult to handle because the automatic y min can get very large but we can look into that.
|
If zero and negative numbers appear in the dataset and there exist restriction cutting off all the data below specific threshold like that
call winop@('%pl[Y_MIN=1.e0]')
then the native %PL should not switch from log to linear scale. Right now it sometimes switches to linear scale without any reason |
|
Back to top |
|
 |
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 8217 Location: Salford, UK
|
Posted: Thu Apr 06, 2017 8:14 am Post subject: |
|
|
Thanks Dan. When the next release comes out, if it is still wrong, perhaps you could send me an illustrative example.
%pl now does the log transformation of the raw data so it is bound to reject zero and negative values in the raw data. The next release is designed to allow zero and negative values in the transformed data. |
|
Back to top |
|
 |
DanRRight
Joined: 10 Mar 2008 Posts: 2927 Location: South Pole, Antarctica
|
Posted: Thu Apr 06, 2017 11:34 pm Post subject: |
|
|
Sounds good. Curious though how did you implement acceptance of zero values without mentioned above y_min=Val ? By allowing many additional orders of magnitude ? |
|
Back to top |
|
 |
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 8217 Location: Salford, UK
|
Posted: Fri Apr 07, 2017 7:32 am Post subject: |
|
|
I think that is what it amounts to. We will see what the end result is. |
|
Back to top |
|
 |
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 8217 Location: Salford, UK
|
Posted: Fri Apr 07, 2017 7:52 am Post subject: |
|
|
log10(1e-3) = -3 |
|
Back to top |
|
 |
DanRRight
Joined: 10 Mar 2008 Posts: 2927 Location: South Pole, Antarctica
|
Posted: Fri Apr 07, 2017 10:18 am Post subject: |
|
|
John,
The problem is when the argument of LOG becomes a very small number or worse zero because the log10(0)=-inf. To plot such data in the LOG scale the %pl switches from LOG to LINEAR scale. My offer was not to switch on linear scale if condition is set in %pl not to plot anything below Y_min.
The way how to handle this could be to crash the code but that's bad idea. Another way is that %pl will still plot this very small or zero number as very small number (smaller then anything else on the graph by say 10-20 orders of magnitude). The user will immediately notice this huge drop and will somehow fix the problem with plotted data. I think Simpleplot was sometimes doing that, sometimes crashed. But Simpleplot also had the feature i mentioned above, so that if you explicitly tell it not to plot anything below some Y_min it plotted small data numbers as Y_min |
|
Back to top |
|
 |
DanRRight
Joined: 10 Mar 2008 Posts: 2927 Location: South Pole, Antarctica
|
Posted: Sat Apr 08, 2017 1:51 am Post subject: Re: |
|
|
John-Silver wrote: | A better option would be to simply not plot the points below a certain level |
Yes, exactly. You set the Y_min and Y_max and anything below and above is ignored. That's how all usually do |
|
Back to top |
|
 |
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 8217 Location: Salford, UK
|
Posted: Thu Apr 13, 2017 12:32 pm Post subject: |
|
|
A new version of the native %pl is available via the following download.
There will probably still be some forms of data that it can't handle.
I am not going to do any further work on this for at least a few months so if you have feedback it would be better to keep it till later.
https://www.dropbox.com/s/xhk4ofgp5g5xcpn/newDLLs6.zip?dl=0 |
|
Back to top |
|
 |
Kenneth_Smith
Joined: 18 May 2012 Posts: 818 Location: Lanarkshire, Scotland.
|
Posted: Thu Apr 13, 2017 5:44 pm Post subject: |
|
|
Paul,
Can you confirm the syntax for the specification of separate top, left, and bottom, margins?
The readme file says:-
Quote: | %pl[margin=(left,top,right,bottom)] ... set the margins to left,top,right,bottom pixels |
but my example below generates an error
Quote: | Runtime error from program:g:\motor\problem.exe
Run-time Error
Invalid margin value in %PL specification
00401000 main [+01d2] |
Code: | winapp
program test
implicit none
include <windows.ins>
real(kind=2) :: ns = 3600.d0
real(kind=2) :: slope = -200.d0
real(kind=2), dimension(1:1000) :: speed, po_pr
real(kind = 2) po
integer i
po = 0.d0
do i = 1, 1000, 1
speed(i) = ns + slope*po
po_pr(i) = po
po = po + 0.001d0
end do
i = winio@('%fn[Tahoma]&')
i = winio@('%mn[Close ]&','EXIT')
i = winio@('%bg&',rgb@(250,250,250))
i = winio@('%tc&',rgb@(0,0,0))
i = winio@('%`bg&',rgb@(255,255,255))
call winop@("%pl[native]")
!call winop@("%pl[margin=60]") !THIS WORKS
call winop@("%pl[margin=(60,60,60,60)]") !THIS DOES NOT WORK
i = winio@('%pl[x_array,N_GRAPHS=1,COLOUR=BLACK]',400, 300, 1000, po_pr, speed)
end program test |
I can see that I am picking up the new dlls since the default %pl[x_sigfigs] and %pl[y_sigfigs] have changed in another test I ran.
Thanks |
|
Back to top |
|
 |
|
|
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
|