Discussion:
Radiaton Characteristics using Gnuplot
(too old to reply)
lennar...@gmail.com
2020-07-27 08:00:23 UTC
Permalink
Hello,

I would like to draw a mixed Polar an linear plot with gnuplot like it is done in this image:

Loading Image...

The data comes from a data file (angle vs value) and is the same for positive and negative angles.

Data:
---------------
-100 0.01
-90 0.04
-80 0.07
-70 0.15
-60 0.18
-50 0.3
-40 0.5
-30 0.65
-20 0.82
-10 0.95
0 1
10 0.95
20 0.82
30 0.65
40 0.5
50 0.3
60 0.18
70 0.15
80 0.07
90 0.04
100 0.01
--------------

So far I did come up with this script, but I do not know how to rotate the plot to have 0° at the top. And how to combine with a linear plot.
--------------
set terminal svg size 500,500
set output 'C:\Program Files\gnuplot\output.svg'
unset border
set polar
set angles degree
set grid polar 10
set grid ls 0.2

set xrange [-1:1]
set yrange [0:1]
set trange [-90:90]

set xtics axis
set ytics axis

set xtics ("" 0.2, "" 0.4, "" 0.6, "" 0.8, "" 1.0)
set ytics 0.2, 0.1, 1.0

set ttics -90, 10, 90
set ttics format "%g".GPVAL_DEGREE_SIGN
set ttics font ":Italic"
set mttics 3

set size ratio 0.5 # twice as wide as high

set title 'Radiaton Characteristics'

plot 'C:\Program Files\gnuplot\data.csv' notitle with lines
--------------

Any tipps are appreciated,
Best regards
Lennart
Karl Ratzsch
2020-07-27 11:08:20 UTC
Permalink
Well, instead of rotating the plot, you can simply rotate your data
and adjust the labelling, and you can use "multiplot" to place two
totally independent plots on the same sheet of paper.

Karl
Post by ***@gmail.com
Hello,
So far I did come up with this script, but I do not know how to rotate the plot to have 0° at the top. And how to combine with a linear plot.
Hans-Bernhard Bröker
2020-07-27 18:58:31 UTC
Permalink
Post by ***@gmail.com
Hello,
I would like to draw a mixed Polar an linear plot with gnuplot
It doesn't work like that.

As can be deduced from the say "set polar" is a global setting that is
applied before you even issue a plot command, it really affects
everything you plot from there on.

So if you really need to mix polar with non-polar data in a single plot,
then either one or the other has to be converted from coordinate system
(r,thera) to (x,y), or vice versa:

x = r*cos(theta)
y = r*sin(theta)

or

r = sqrt(x**2+y**2)
theta = atan2(x,y)
Post by ***@gmail.com
plot 'C:\Program Files\gnuplot\data.csv' notitle with lines
Please don't do that. Your data files belong into your folders, not
gnuplot's installation directory.
lennar...@gmail.com
2020-07-28 09:15:57 UTC
Permalink
Thank you very much for your tips!

I'll see what I can do and post the results here.

Loading...