Repository: matplotlib/matplotlib

Issue:
[Bug]: On polar axis, stem plot with non-zero bottom has an extra red line.
### Bug summary

I'm tring to make stem plots on polar axis. When I set the stem bottom to non-zero values, I noticed an abnormal red line that connects the bottom of first and last stem. I don't think this is an expected behaviour.

### Code for reproduction

```Python
import matplotlib.pyplot as plt
import numpy as np

# Fixing random state for reproducibility
np.random.seed(19680801)

# Compute areas and colors
N = 50
r = 2 * np.random.rand(N)
theta = 2 * np.pi * np.random.rand(N)

fig = plt.figure()
ax = fig.add_subplot(projection='polar')
c1 = ax.stem(
    theta, 
    r+4, 
    bottom=4,
)
```

### Actual outcome

![Image](https://github.com/user-attachments/assets/597e2f81-2023-42fa-83b5-10de2085adb1)

### Expected outcome

A plot without the red line connectting the bottom of first and last stem.

### Additional information

_No response_

### Operating system

_No response_

### Matplotlib Version

3.10.0

### Matplotlib Backend

_No response_

### Python version

_No response_

### Jupyter version

_No response_

### Installation

None


Discussion:
I guess the red line is the baseline that shows up [at the bottom of the stems on a rectangular axes](https://matplotlib.org/stable/gallery/lines_bars_and_markers/stem_plot.html).  So for polar it should ideally be a circle at r=4, but it is drawn very simply by passing `[np.min(locs), np.max(locs)], [bottom, bottom]` to `plot`.

If you just want it to disappear, you can pass `basefmt='none'` in your call to `stem`.
Thank you! Indeed `basefmt='none'` got rid of that red line. I'm surprised how simple this line was defined.

My follow up question here is, how do I set a normal baseline for stem plot in polar axis (a circle at r=4 as you said)? Of course I can just draw it seperately; but if there's some native integration in the stem plot, it would be nice and neat.
The baseline implementation in `stem()` was written under the implicit assumption of an rectilinear Axes. Unclear whether that's an oversight or it may also be that `stem()` predates polar Axes. Anyway, there's currently no built-in solution for this. You can draw the line separtely, or you can add more points to the line afterwards:

```
c1 = ax.stem(theta, r+4, bottom=4)
x, y = c1.baseline.get_data()
theta = np.linspace(np.min(x), np.max(x), 200)
r = np.full(200, y[0])
c1.baseline.set_data(theta, r)
```

![Image](https://github.com/user-attachments/assets/6081ae9e-9759-43ad-abb3-3845290dbc5b)






Patch:
diff --git a/lib/matplotlib/axes/_axes.py b/lib/matplotlib/axes/_axes.py
index c4967025e136..3135be8798f2 100644
--- a/lib/matplotlib/axes/_axes.py
+++ b/lib/matplotlib/axes/_axes.py
@@ -3194,6 +3194,8 @@ def stem(self, *args, linefmt=None, markerfmt=None, basefmt=None, bottom=0,
         baseline, = self.plot(baseline_x, baseline_y,
                               color=basecolor, linestyle=basestyle,
                               marker=basemarker, label="_nolegend_")
+        baseline.get_path()._interpolation_steps = \
+            mpl.axis.GRIDLINE_INTERPOLATION_STEPS
 
         stem_container = StemContainer((markerline, stemlines, baseline),
                                        label=label)


Test patch:
diff --git a/lib/matplotlib/tests/test_axes.py b/lib/matplotlib/tests/test_axes.py
index 237a0a044253..97abc750b9ef 100644
--- a/lib/matplotlib/tests/test_axes.py
+++ b/lib/matplotlib/tests/test_axes.py
@@ -4617,6 +4617,17 @@ def test_stem_orientation():
             orientation='horizontal')
 
 
+def test_stem_polar_baseline():
+    """Test that the baseline is interpolated so that it will follow the radius."""
+    fig = plt.figure()
+    ax = fig.add_subplot(projection='polar')
+    x = np.linspace(1.57, 3.14, 10)
+    y = np.linspace(0, 1, 10)
+    bottom = 0.5
+    container = ax.stem(x, y, bottom=bottom)
+    assert container.baseline.get_path()._interpolation_steps > 100
+
+
 @image_comparison(['hist_stacked_stepfilled_alpha'])
 def test_hist_stacked_stepfilled_alpha():
     # make some data