View previous topic :: View next topic |
Author |
Message |
Kenneth_Smith
Joined: 18 May 2012 Posts: 697 Location: Hamilton, Lanarkshire, Scotland.
|
Posted: Mon Aug 17, 2020 12:39 pm Post subject: Suggestion - native %pl |
|
|
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 |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7933 Location: Salford, UK
|
Posted: Mon Aug 17, 2020 2:46 pm Post subject: |
|
|
Ken
Thanks for the suggestion. |
|
Back to top |
|
|
John-Silver
Joined: 30 Jul 2013 Posts: 1520 Location: Aerospace Valley
|
Posted: Tue Aug 18, 2020 5:42 pm Post subject: |
|
|
... 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 ... " |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7933 Location: Salford, UK
|
Posted: Tue Aug 18, 2020 7:31 pm Post subject: |
|
|
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 |
|
|
Kenneth_Smith
Joined: 18 May 2012 Posts: 697 Location: Hamilton, Lanarkshire, Scotland.
|
Posted: Wed Aug 19, 2020 1:36 pm Post subject: |
|
|
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 |
|
|
John-Silver
Joined: 30 Jul 2013 Posts: 1520 Location: Aerospace Valley
|
Posted: Thu Aug 20, 2020 8:27 pm Post subject: |
|
|
... 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 ... " |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7933 Location: Salford, UK
|
Posted: Wed Aug 26, 2020 12:26 pm Post subject: |
|
|
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 |
|
|
Kenneth_Smith
Joined: 18 May 2012 Posts: 697 Location: Hamilton, Lanarkshire, Scotland.
|
Posted: Wed Aug 26, 2020 12:48 pm Post subject: |
|
|
Paul,
Thanks for this addition.
Ken |
|
Back to top |
|
|
John-Silver
Joined: 30 Jul 2013 Posts: 1520 Location: Aerospace Valley
|
Posted: Thu Aug 27, 2020 2:24 pm Post subject: |
|
|
... 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 ... " |
|
Back to top |
|
|
Kenneth_Smith
Joined: 18 May 2012 Posts: 697 Location: Hamilton, Lanarkshire, Scotland.
|
Posted: Thu Aug 27, 2020 3:39 pm Post subject: |
|
|
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 |
|
|
John-Silver
Joined: 30 Jul 2013 Posts: 1520 Location: Aerospace Valley
|
Posted: Sat Sep 05, 2020 8:43 pm Post subject: |
|
|
thanks a lot Ken _________________ ''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 ... " |
|
Back to top |
|
|
John-Silver
Joined: 30 Jul 2013 Posts: 1520 Location: Aerospace Valley
|
Posted: Thu Sep 17, 2020 7:01 pm Post subject: |
|
|
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 ... " |
|
Back to top |
|
|
John-Silver
Joined: 30 Jul 2013 Posts: 1520 Location: Aerospace Valley
|
Posted: Fri Oct 02, 2020 8:51 pm Post subject: |
|
|
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 ... " |
|
Back to top |
|
|
John-Silver
Joined: 30 Jul 2013 Posts: 1520 Location: Aerospace Valley
|
Posted: Sat Oct 10, 2020 2:11 pm Post subject: |
|
|
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 ... " |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7933 Location: Salford, UK
|
Posted: Sat Oct 10, 2020 5:26 pm Post subject: |
|
|
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 |
|
|
|