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 

Suggestion - native %pl
Goto page 1, 2  Next
 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> ClearWin+
View previous topic :: View next topic  
Author Message
Kenneth_Smith



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

PostPosted: Mon Aug 17, 2020 12:39 pm    Post subject: Suggestion - native %pl Reply with quote

In addition to the present options in the native %pl for link (i.e. none, lines, curves) a useful future addition would be “spectrum”.

This would treat the x,y data input to %pl as frequency and magnitude data, and for each data point i it would draw a single line between two points i.e. ( x(i), y(i) ) and ( x(i), 0 ), creating a spectrum type plot.

I know this can be achieved indirectly by using the %pl call back or by careful stacking of the input data into multiple graphs, but I suspect that a more direct method would be useful to “new” users trying to plot such frequency domain plots before they conclude that %pl cannot use used to display data in this format.

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


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

PostPosted: Mon Aug 17, 2020 2:46 pm    Post subject: Reply with quote

Ken

Thanks for the suggestion.
Back to top
View user's profile Send private message AIM Address
John-Silver



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

PostPosted: Tue Aug 18, 2020 5:42 pm    Post subject: Reply with quote

... and ?
is there a chance such a capability could be quickly implemented or could it take a while ? , or is it a no-goer in the short-term ?
_________________
''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
PaulLaidler
Site Admin


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

PostPosted: Tue Aug 18, 2020 7:31 pm    Post subject: Reply with quote

Maybe two weeks say.

Would it only be vertical lines? If also horizontal lines (x(i),y(i)) to (0,y(i)), what would you call that?
Back to top
View user's profile Send private message AIM Address
Kenneth_Smith



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

PostPosted: Wed Aug 19, 2020 1:36 pm    Post subject: Reply with quote

Paul,

I don’t see a need for horizontal lines, but I suppose somebody out there might have such a requirement. “Column” or “stem” instead of “spectrum” and “bars” and for the horizontal lines, or perhaps “y_spoke” and “h_spoke”, or “y_stem” and “h_stem” if you prefer a mechanical or botanical analogy?

For my applications, on occasion, both the x (frequency) and y (magnitude) data can become negative, so it’s not just the first quadrant I am thinking about.

Thanks

Ken
Back to top
View user's profile Send private message Visit poster's website
John-Silver



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

PostPosted: Thu Aug 20, 2020 8:27 pm    Post subject: Reply with quote

... carefully thought out, this could be a very useful addition to the plotting armoury
_________________
''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
PaulLaidler
Site Admin


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

PostPosted: Wed Aug 26, 2020 12:26 pm    Post subject: Reply with quote

The "link" option for %pl has been extended to provide [link=columns] and [link=bars]. The first gives columns from the x-axis to the data points. The second gives bars from the y-axis to the data points. The width of a column and the height of a bar is determined by the selected line width.
Back to top
View user's profile Send private message AIM Address
Kenneth_Smith



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

PostPosted: Wed Aug 26, 2020 12:48 pm    Post subject: Reply with quote

Paul,

Thanks for this addition.

Ken
Back to top
View user's profile Send private message Visit poster's website
John-Silver



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

PostPosted: Thu Aug 27, 2020 2:24 pm    Post subject: Reply with quote

... is there an example avilable to try this out ?
_________________
''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
Kenneth_Smith



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

PostPosted: Thu Aug 27, 2020 3:39 pm    Post subject: Reply with quote

John,

Here is the code for a simple test I've just run. You must explicitly specify a value for width.

Code:
!Spectrum test
use clrwin
implicit none
integer, parameter :: dp = kind(1.d0)
integer, parameter :: n = 10
real(kind=dp):: mag(1:n) = 0.d0, h(1:n)=0.d0
integer i, iw

do i = 1, n
  mag(i) = 1.d0/i
  h(i)   = i
end do

iw = winio@('%mn[Exit]&','exit')
iw = winio@('%fn[Tahoma]%ts&',1.5d0)
call winop@('%pl[native,independent,x_array,gridlines,frame,link=columns,width=10,colour=blue]')
call winop@('%pl[Title="Harmonic content of a square wave"]')
call winop@('%pl[x_axis="Harmonic order",y_axis="Harmonic magnitude",dx=1,x_max=10.5,y_min=0,dy=0.25,y_max=1]')
iw = winio@('%pl&',600,400,n,h,mag)
iw = winio@(' ')
end


Here is a link to the image:

https://www.dropbox.com/s/81txtrnjghfg7zy/spectrum.jpg?dl=0

PS I have just sent myself to the bottom of the class! There should be no even harmonics in a symmetrical waveform!
Back to top
View user's profile Send private message Visit poster's website
John-Silver



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

PostPosted: Sat Sep 05, 2020 8:43 pm    Post subject: Reply with quote

thanks a lot Ken Smile Smile
_________________
''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: 1450
Location: Aerospace Valley

PostPosted: Thu Sep 17, 2020 7:01 pm    Post subject: Reply with quote

Paul & Co. might want to look into the fact that the plot produced by Ken's example above the tic marks on the x-axis aren't centred on the numbers (or vicey-versa !)

these are the sort of things that Project Managers pick up on within 10 seconds of seeing a graph, and they're not quezy about issuing directives like 'stop using that bloody plotting package and get hold of a more reliable one' !
_________________
''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: 1450
Location: Aerospace Valley

PostPosted: Fri Oct 02, 2020 8:51 pm    Post subject: Reply with quote

any feedback from Paul & Co about my observation there ?
_________________
''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: 1450
Location: Aerospace Valley

PostPosted: Sat Oct 10, 2020 2:11 pm    Post subject: Reply with quote

Here's the image (same as link submitted by Ken on 27th August) more than 3 weeks ago now:



Note the x-axis labels are not centred on the tics as they should be, which is what I was referring to in my earlier comment.

This seems to appear on a somewhat ad hoc basis on various plots I've seen over the past months. Always on the x-axis

Any comment/fix from SF would be appreciated.
_________________
''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
PaulLaidler
Site Admin


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

PostPosted: Sat Oct 10, 2020 5:26 pm    Post subject: Reply with quote

I have looked at this and for this sample on my machine the position needs to be 1 or 2 pixels to the level. I opted for 1 pixel and ran my %pl test suite.

Everything was OK except for one similar (single digit) case where the position became off centre the other way.

I have retained the shift left by one pixel so this sample will look better but the change could have an adverse effect in some cases.

Please consider this matter as closed.
Back to top
View user's profile Send private message AIM Address
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> ClearWin+ All times are GMT + 1 Hour
Goto page 1, 2  Next
Page 1 of 2

 
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