ManimCommunity / ManimCommunity/manim
PolarPlane does not work with 0 as maximum
- Dominant language
- Python
- Stars
- 40.9k
- Forks
- 3.1k
- Avg merge
- 3d 12h
- Merged PRs (30d)
- 25
Description
## Enhancement proposal
It is very common in antenna engineering to plot antenna radiation patterns in dB on a polar axis. It is also fairly common for those plots to be normalized (i.e. such that 0 is the maximum). Currently this is not possible with PolarPlane. I believe this is primarily due to these lines:
```python
# PolarPlane.__init__()
# ...
super().__init__(
x_range=np.array((-radius_max, radius_max, radius_step)), # <===
y_range=np.array((-radius_max, radius_max, radius_step)), # <===
x_length=size,
y_length=size,
axis_config=self.radius_config,
**kwargs,
)
```
It should be possible to set 0 as the maximum, as well as set the minimum, eg.
```python
class RadiationPattern(Scene):
def construct(self):
polar = PolarPlane(
radius_min=-40,
radius_max=0,
radius_step=10,
)
```
## Additional comments
[This](http://3.bp.blogspot.com/-hjv9lBgG1hU/UmJo55kOZoI/AAAAAAAAA1Y/ITsihoy6J3M/s1600/01+-+sample-azimuth.png) is an example of this type of plot
Contributor guide
Research direction
Start in PolarPlane.__init__ at the x_range and y_range construction shown in the issue, then trace how radius_min, radius_max, and radius_step are handled. Verify that a RadiationPattern scene can create PolarPlane with radius_min=-40 and radius_max=0, and that the resulting normalized radiation-pattern range behaves as requested.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- data-visualization
- Issue type
- Feature
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100