matplotlib / matplotlib/mplfinance
how to extend the y-axis?
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 4.4k
- Forks
- 678
- PR merge metrics
- No merged PRs in 30d
Description
Perhaps the best way to explain this problem is by the picture below. As you can see, there are three blue lines drawn, but the top line is out of plot. How can I extend the y-axis on the graph so that the top line is fully visible?

This code below created the plot:
```python
fig, axlist = mpf.plot(data[start_date:end_date], figratio=(20,12),
type='candle',
alines=seq_of_seq_of_points,
volume=True,
tight_layout=True,
style='yahoo',
addplot=apd,
returnfig=True)
fig.suptitle("SPY", y=1.05, fontsize=30, x=0.59)
```
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the mpf.plot call shown in the issue and inspect how its y-axis limits, margins, and tight_layout handling affect the alines. Check the returned fig and axlist alongside fig.suptitle to determine where the top line is clipped. Done means the plotted line is fully visible without breaking the candle, volume, or addplot layout; no source file or test is named in the report.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- matplotlib, python
- Domain
- data-visualization
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100