File: plot_polar.py

package info (click to toggle)
vedo 2025.5.3-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 10,404 kB
  • sloc: python: 64,792; javascript: 1,932; xml: 437; sh: 139; makefile: 6
file content (18 lines) | stat: -rw-r--r-- 586 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
"A splined polar plot"
from vedo import *
from vedo.pyplot import plot


angles    = vector([  0,  20,  60, 160, 200, 250, 300, 340])
distances = vector([0.1, 0.2, 0.3, 0.5, 0.6, 0.4, 0.2, 0.1])

dn1 = plot(angles, distances,
           mode='polar', deg=True, splined=True, fill=True,
           c='green', bc='k', alpha=0.7, title=__doc__, vmax=0.65)

dn2 = plot(angles+120, distances**2,
           mode='polar', deg=True, splined=True, fill=True,
           c='red', alpha=1, vmax=0.65)
dn2.z(0.01) # set a positive z so it stays in front

show(dn1, dn2, zoom=1.2, bg='k9').close()