Just as you say. Employing a square function, per your example, seems to work out more like the ones I was thinking about. A distortion from decibels, and also not really undoing logarithmic, as you observed. But perhaps with the advantage of putting the ring for 0 dBi very nearly at the exact center, allowing more space for the primary data-of-interest. In the sample PNG graphic (a screenshot from Nec2Go) it is clear that they've done similar. The values for -20, -30, -40 are scrunched down in the very center. And it is -10 dBi which is at about the middle rung, while +8.9 dBi is the outermost rung (that being max output).

At least my puzzle is solved! It must wait until after work before I can try putting it into an SVG and deciding whether to keep it. Chances are, maybe you've persuaded me in that direction. In which case, I'll leave it as was. Alternately, I might keep both and make the choice selectable. I thank you for your kind assistance.

#!C:\Users\gstarl\Strawberry\perl\bin\perl # Azimuth_Scaling_Example.pl my $scale_min = 0; # Center point of radius in pixels. my $scale_max = 100; # Outer circumference in pixels. my $scale_span = $scale_max - $scale_min; # Example fake data # Also, positions of rings in azimuthal plot. my @data = (-50, -40, -30, -20, -10, 0, 10, 20); # Extract limits and span from data array. sub get_min_max_span { my @data = @_; my $min; my $max; for my $i (0 .. $#data) { if ($i == 0) { $min = $max = $data[0] } else { $min = $data[$i] if $min > $data[$i]; $max = $data[$i] if $max < $data[$i]; } } return $min, $max, $max-$min; } # Collect from data. my ($data_min, $data_max, $data_span) = get_min_max_span(@data); # Scale values in dBi for plot as pixels. # Also to place the dBi rings on plot. sub scale_value_for_graph { my ($value, $data_min, $data_max, $data_span, $scale_max) = @_; return ($value - $data_min)**2 * $scale_max / $data_span**2; } # Try it out. Goodie! The zero dBi position is about in the middle. for (@data) { print "\n$_ -> " . scale_value_for_graph($_, $data_min, $data_max, + $data_span, $scale_max); }

In reply to Re^6: Logarithmic Scale by aplonis
in thread Logarithmic Scale by aplonis

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.