 |
forums.silverfrost.com Welcome to the Silverfrost forums
|
View previous topic :: View next topic |
Author |
Message |
Kenneth_Smith
Joined: 18 May 2012 Posts: 828 Location: Lanarkshire, Scotland.
|
Posted: Mon Jul 28, 2025 3:35 pm Post subject: %pl[link=lines,width=1] vs. %pl[link=lines,width=3] |
|
|
In the following program two %pl graphs are used to plot identical data.
The data is an impulse function � zero everywhere but at one point where is it 10 units.
The first %pl with %pl[WIDTH=1] draws the expected graph. In the second %pl with %pl[WIDTH=3] the graph overshoots the desired magnitude of the impulse (by far more than 3 pixels).
Please see the annotated graphic below:
https://www.dropbox.com/scl/fi/5vk4iin61argojqmkhfgq/Screenshot-2025-07-28-150549.jpg?rlkey=5zlx6vqrapgc6h4mkdjaictml&st=6cpbqh0l&dl=0
For both %pl graphs the link option is set to LINES, so this should not be related to the default �TENSION� setting.
If the parameter N (number of data points) is reduced from 200 to 20, this does not occur.
I am using the 22nd June FTN95 and DLLs.
Sorry Paul, I broke %pl again!
Code: |
program test_pl
use clrwin
implicit none
integer, parameter :: n = 200 !## Change n to 20 and everthing is OK
integer :: i, iw
real*8 :: x(n), y(n)
do i = 1, n
x(i) = i
end do
y = 0.d0
y(n/2) = 10.d0 ! Magnitude 10 impulse at one time instant
print*, 'min/max y = ', minval(y), maxval(y)
! This graph is drawn correctly
call winop@('%pl[native,n_graphs=1,x_array,link=lines,gridlines,y_min=0,y_max=12,symbol=10]')
call winop@('%pl[width=1]') !###
call winop@('%pl[Title="This graph is correct with width=1"]')
iw = winio@('%pl&',900,300,n,x,y)
! This graph has a problem
call winop@('%pl[native,n_graphs=1,x_array,link=lines,gridlines,y_min=0,y_max=12,symbol=10]')
call winop@('%pl[width=3]') !### only difference between the configuration of the two %pl graphs
call winop@('%pl[Title="This graph is not correct with width=3"]')
iw = winio@('%ff%pl&',900,300,n,x,y)
iw = winio@('')
end program test_pl
|
|
|
Back to top |
|
 |
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 8235 Location: Salford, UK
|
Posted: Mon Jul 28, 2025 5:18 pm Post subject: |
|
|
Ken
Thank you for the feedback. I have logged this for investigation. |
|
Back to top |
|
 |
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 8235 Location: Salford, UK
|
Posted: Wed Aug 06, 2025 12:13 pm Post subject: |
|
|
Ken
This behaviour reflects a limitation of the Microsoft GDI+ library.
The plot values are correct on calling an API called GdipDrawLines.
I suspect that it is not a fault but simply a limitation relating to what you can draw when joining thick lines at a spike point.
It may be possible to apply a clipping rectangle but it would be messy. |
|
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
|