Menu

#1880 Polar plot lines plotted only once mouse scrolled or up/down left/right key hit

None
closed-accepted
nobody
None
2017-04-27
2016-12-10
Anonymous
No

[gnuplot 5.0.4 win 32 XP sp3]

Polar plot lines plotted only once mouse scrolled or up/down left/right key hit (a bug?).
Occurs when r-axis is reversed "set rrange [90:0]".
Observed in terminal Windows, Wxt and Pdfcairo.

Polar plot questions/observations:
1. Untitled circular border "1 notitle" is not exactly at 100%.
2. Why does a command like "0.5 notitle" not plot a circle at 50% radius?
3. How to set the border color to, say, "grey80" for circles drawn by "set object circle"?
4. New command: plot both major and minor ttics, mttics (tics around the perimeter using dummy-variable t).

set angles degrees
set polar
set size square
set grid polar

# Reverse r-axis
set rrange [90:0]

set label "North = 0°" at 0,-98 center

# Sun positions given above the horizon (column 2 datum r >= 0).
# Set True North straight up, offset ("rotate") Azimuth by 90° (counterclockwise positive): using (90-$1):2
# Plot untitled circular border
plot  "-" using ( 90-$1 ) : 2 with lines title "21 Jun" at beginning, \
      "-" using ( 90-$1 ) : 2 with lines title "21 Dec" at end, \
      1   notitle
 62.1   0.5
 61.4   1.3
 60.7   2.1
 60.1   3.0
 59.4   3.8
 58.7   4.7
 58.0   5.6
 57.2   6.5
 56.5   7.3
 55.8   8.2
 55.0   9.1
 54.3   9.9
 53.5  10.8
 52.7  11.6
 51.9  12.4
 51.1  13.3
 50.3  14.1
 49.4  14.9
 48.6  15.7
 47.7  16.5
 46.8  17.3
 45.9  18.0
 45.0  18.8
 44.1  19.5
 43.2  20.2
 42.2  21.0
 41.2  21.7
 40.2  22.4
 39.2  23.0
 38.2  23.7
 37.2  24.3
 36.1  25.0
 35.1  25.6
 34.0  26.2
 32.9  26.8
 31.8  27.3
 30.6  27.9
 29.5  28.4
 28.3  28.9
 27.1  29.4
 25.9  29.9
 24.7  30.4
 23.5  30.8
 22.2  31.2
 21.0  31.6
 19.7  32.0
 18.4  32.3
 17.1  32.6
 15.8  32.9
 14.4  33.2
 13.1  33.5
 11.8  33.7
 10.4  33.9
  9.0  34.1
  7.7  34.2
  6.3  34.3
  4.9  34.4
  3.5  34.5
  2.1  34.6
  0.7  34.6
359.3  34.6
357.9  34.6
356.6  34.5
355.2  34.5
353.8  34.4
352.4  34.2
351.0  34.1
349.7  33.9
348.3  33.7
347.0  33.5
345.6  33.2
344.3  32.9
343.0  32.6
341.7  32.3
340.4  32.0
339.1  31.6
337.8  31.2
336.6  30.8
335.4  30.4
334.1  29.9
332.9  29.5
331.7  29.0
330.6  28.4
329.4  27.9
328.3  27.4
327.2  26.8
326.1  26.2
325.0  25.6
323.9  25.0
322.9  24.4
321.8  23.7
320.8  23.1
319.8  22.4
318.8  21.7
317.8  21.0
316.9  20.3
315.9  19.5
315.0  18.8
314.1  18.1
313.2  17.3
312.3  16.5
311.5  15.7
310.6  14.9
309.8  14.1
309.0  13.3
308.1  12.5
307.3  11.6
306.6  10.8
305.8  10.0
305.0   9.1
304.3   8.2
303.5   7.4
302.8   6.5
302.1   5.6
301.4   4.7
300.7   3.9
300.0   3.0
299.3   2.1
298.6   1.3
297.9   0.5
e
118.1   0.4
117.5   1.1
116.8   2.0
116.2   2.8
115.5   3.7
114.9   4.7
114.3   5.6
113.7   6.5
113.0   7.5
112.4   8.5
111.8   9.4
111.2  10.4
110.7  11.4
110.1  12.4
109.5  13.4
108.9  14.4
108.3  15.4
107.8  16.4
107.2  17.4
106.6  18.4
106.1  19.4
105.5  20.4
105.0  21.5
104.4  22.5
103.9  23.5
103.3  24.5
102.8  25.6
102.2  26.6
101.7  27.6
101.1  28.7
100.6  29.7
100.0  30.8
 99.5  31.8
 98.9  32.9
 98.4  33.9
 97.8  35.0
 97.2  36.0
 96.7  37.1
 96.1  38.1
 95.5  39.2
 94.9  40.2
 94.4  41.3
 93.8  42.3
 93.2  43.4
 92.5  44.5
 91.9  45.5
 91.3  46.6
 90.6  47.6
 90.0  48.7
 89.3  49.7
 88.6  50.8
 87.9  51.9
 87.2  52.9
 86.5  54.0
 85.7  55.0
 84.9  56.1
 84.1  57.2
 83.3  58.2
 82.4  59.3
 81.5  60.3
 80.5  61.4
 79.5  62.4
 78.4  63.4
 77.3  64.5
 76.1  65.5
 74.9  66.5
 73.5  67.6
 72.1  68.6
 70.6  69.6
 68.9  70.6
 67.1  71.6
 65.1  72.5
 62.9  73.5
 60.5  74.4
 57.8  75.3
 54.8  76.2
 51.5  77.1
 47.8  77.9
 43.5  78.6
 38.8  79.3
 33.4  79.9
 27.5  80.5
 20.9  80.9
 13.8  81.2
  6.3  81.4
358.6  81.5
351.0  81.4
343.6  81.1
336.7  80.8
330.3  80.3
324.6  79.7
319.5  79.1
314.9  78.4
310.9  77.6
307.3  76.8
304.1  75.9
301.2  75.0
298.6  74.1
296.3  73.1
294.2  72.2
292.3  71.2
290.5  70.2
288.9  69.2
287.4  68.2
286.0  67.2
284.7  66.2
283.4  65.1
282.3  64.1
281.2  63.1
280.1  62.0
279.1  61.0
278.2  59.9
277.3  58.9
276.4  57.8
275.6  56.8
274.8  55.7
274.0  54.7
273.3  53.6
272.5  52.6
271.8  51.5
271.1  50.4
270.4  49.4
269.8  48.3
269.1  47.3
268.5  46.2
267.9  45.1
267.2  44.1
266.6  43.0
266.0  42.0
265.4  40.9
264.9  39.8
264.3  38.8
263.7  37.7
263.1  36.7
262.6  35.6
262.0  34.6
261.4  33.5
260.9  32.5
260.3  31.4
259.8  30.4
259.2  29.4
258.7  28.3
258.1  27.3
257.6  26.2
257.0  25.2
256.5  24.2
255.9  23.1
255.4  22.1
254.8  21.1
254.3  20.1
253.7  19.1
253.2  18.0
252.6  17.0
252.0  16.0
251.5  15.0
250.9  14.0
250.3  13.0
249.7  12.0
249.1  11.1
248.5  10.1
247.9   9.1
247.3   8.1
246.7   7.2
246.1   6.2
245.5   5.3
244.9   4.3
244.2   3.4
243.6   2.5
243.0   1.6
242.3   0.8
e

Discussion

  • Ethan Merritt

    Ethan Merritt - 2016-12-15

    Questions 1+2:
    Not sure what you were expecting, but the commands work as expected for me. I have attached the output from

    unset xtics; unset ytics
    set polar; plot 0.5
    

    The circle goes exactly through the axis at r = 0.5. This is not "50%" because autoscaling did not extend the axis to end exactly at 1.0. If you want that you can say

    unset xtics; unset ytics
    set polar; set rrange [0:1]; plot 0.5
    

    You might also want "set size square" to make the circle look less like an oval.

    Question 3:

    set obj 1 circle at 0.0 radius 2.0
    set obj 1 fillstyle empty border lc "gray80" lw 5
    

    Question 4:
    Good idea to allow minor tic marks around the polar grid circle.

    Main issue:
    I don't think it makes any physical sense to invert or reverse the polar axis. The program clearly gets confused, but I must admit that I am myself confused as to what this would mean. The problem doesn't occur if the rraxis isn't reversed, right?

     
  • Ethan Merritt

    Ethan Merritt - 2016-12-28

    CVS for 5.1 now uses "set ttics" to define angular tic marks around the perimeter of the outermost circle in a polar grid.

    CVS for both 5.0 and 5.1 ensure that the R axis range is not inverted.

     
  • Ethan Merritt

    Ethan Merritt - 2016-12-28
    • status: open --> pending-fixed
    • Group: -->
    • Priority: -->
     
  • Raoul Abrutat

    Raoul Abrutat - 2017-01-04

    Thanks Ethan,

    set object circle works fine (Question 3). I have yet to install CVS 5.1 (Question 4).

    Main issue:
    Yes, the problem doesn't occur if the rraxis isn't reversed.
    Sun path diagram convention requires that 90 (degrees) is in the center and 0 (degrees) on the outside,
    hence rrange is reversed "set rrange [90:0]".

    While this remains, e.g. terminal pdfcairo is without lines, see attached pdf.

    Cheers
    Raoul

     
    • Ethan Merritt

      Ethan Merritt - 2017-01-12

      I think I have the necessary bits working in CVS 5.1
      Please have a look at this demo and let me know if I got it right. This type of plot is new to me.
      http://gnuplot.sourceforge.net/demo_cvs/solar_path.html

      Work remaining:

      • mouse coordinates not echoed properly on svg, canvas terminals
      • some way to put azimuth=0 at the top or bottom of the circle
      • see also tracker item #1892
       
  • Ethan Merritt

    Ethan Merritt - 2017-01-04

    I was not familiar with sun path diagrams. Thank you for the pointer to a real-world example. I understand how this convention "makes sense" since the plot is really a spherical projection in which R represents the altitude-above-horizon angle rather than a 2D surface for which R is a radial distance from the center.

    The gnuplot code for polar plots was not written with this interpretation in mind, so I think it will need to be reexamined and revised in order for this type of plot to work. That may at the same time allow addressing a separate feature request that the orientation of the plot can be set to have 0° (North) at the left/top/right/bottom.

     

    Last edit: Ethan Merritt 2017-01-07
  • Ethan Merritt

    Ethan Merritt - 2017-01-07

    This turns out to require a non-trivial set of changes. I think it will be worth it, but that means it will be a feature for version 5.1 and beyond. Various strange things happen, all bad, if you use a reversed R axis in version 5.0 so there it is best if we say "you can't do that".

     
    • Rainald Koch

      Rainald Koch - 2017-02-18

      workaround: user-defined labels on r = zenith angle = 90° - elevation

       
  • Ethan Merritt

    Ethan Merritt - 2017-01-07
    • status: pending-fixed --> pending
     
  • Ethan Merritt

    Ethan Merritt - 2017-02-15

    Revision / extension of polar mode in 5.1 is now complete, including placement of the theta origin at the top of the plot and angles increasing clockwise.
    set theta top clockwise

     
  • Ethan Merritt

    Ethan Merritt - 2017-02-15
    • status: pending --> closed-accepted
     
  • Raoul Abrutat

    Raoul Abrutat - 2017-04-27

    Gnuplot 5.1 patchlevel 0 last modified 2017-02-24
    Using msvc build binaries:
    http://www.tatsuromatsuoka.com/gnuplot/Eng/winbin/
    http://ctan.ijs.si/mirror/w32tex/w32/

    Dear Ethan,

    Thank you very much for your good work comprising programming, samples, sun path algorithm (solar_params.dem) and manual.

    Highly appreciated.

    As a result I am pleased to attach 2 "beautiful" output examples (with hour lines) on Cairolatex and Windows terminal.
    (Windows terminal displays the inner circle (set object 1 circle size 10) as an ellipse.)

    Cheers
    Raoul Abrutat

     
  • Raoul Abrutat

    Raoul Abrutat - 2017-04-27
    1. file
     

Log in to post a comment.