1

I've got a dataset of angle ranges that I'd like to represent as a polar plot. The format is as follows:

[Radius]\t[Range 1 lower] [Range 1 upper]\t[Range 2 lower] [Range 2 upper]...

A typical data line looks like this:

1.181   0 0 31.8196 38.3883 141.612 148.18  180 180 211.82 218.388  321.612 328.18

The number of ranges per line can differ, there are also lines without any ranges. Ideally I'd like to end up with a polar plot, where at a given radius the angle between the lower and upper limit of each range is filled, while the rest of the plot is empty.

The ranges do not overlap, but some of them have the same angle as lower and upper limit (for instance the "0 0" range in the example above), what should still be visible, as (as always) those single point and hardly-visible details in the calculation turned out to be those observed in experiment...

For now I've changed the C-program that outputs said ranges to give me a cloud of points with polar coordinates which I plot with dots, but I'd really prefer a kind-of vectorial plot with filled areas, as that'd mean (much) lower file size, and would allow zooming...

Any help would be appreciated, thanks in advance,
Andreas

soulsource
  • 341
  • 3
  • 12
  • Could you give an update? Did you find a gnuplot solution or went for another plotting soft or used a different data output? – Joce Apr 04 '16 at 11:24
  • Thanks for your suggestion. I have been busy with another project meanwhile, so I decided to keep the "cloud of points" solution for the moment. Still, your answer will get pretty useful once I get back to this, due to the special nature of the data I want to plot - the ranges are increasing monotonously with radius, something I didn't think of when I asked the question. This means, that I can (at least) reduce the cloud of points to a list of ranges for a certain number of radii. Anyhow, your idea to directly write an SVG also sounds pretty tempting, as I have the vertex coordinates already. – soulsource Apr 06 '16 at 07:57

1 Answers1

0

There are purely gnuplot 4.4+ solutions, but they will be intricate. One reason is that polar plotting of data files is not done with polar interpolation, but linear interpolation (straight lines between the endpoints). I would rather have the C program output the gnuplot commands to plot your data directly, e.g.

set polar
set angles degrees
plot (t<38.3883&t>31.8196)?1.181:1/0 with filledcurves above r=0, \
     (t<...

I'd advise to treat the 0-range cases separately with set arrow from 0,0 to r*cos(angle),r*sin(angle).

I'm not sure the file will be so much smaller, again gnuplot will generate a polyline to approximate the arc of circle at r=1.181. If you want a small file with actual arcs of circle, you may want to generate svg code directly from your C code.

Joce
  • 2,220
  • 15
  • 26