Short description
When adding a legend to a plot, the legend and the plot contents overlap. An example out of an application I'm building:

Code to reproduce
import pyqtgraph as pg
import numpy as np
plot = pg.plot().getPlotItem()
plot.addLegend()
x = np.arange(50)
y = np.cos(x / 100) * 3
item = pg.BarGraphItem(x=x, height=y, width=0.8, pen="w")
plot.addItem(item)
plot.legend.addItem(item, 'bar')
input("Press enter to quit")
Expected behavior
I could imagine multiple possible fixes:
- Make the legend opaque
- Automatically zoom out a little to make space for the legend
Real behavior
The legend simply appears on the top left, without any consideration whether it overlaps with the plot.
Tested environment(s)
- PyQtGraph version: 0.11.0rc0
- Qt Python binding: PyQt5 5.14.2 Qt 5.14.2
- Python version: 3.8.3
- NumPy version: 1.17.4
- Operating system: Arch Linux
- Installation method: pip
Short description
When adding a legend to a plot, the legend and the plot contents overlap. An example out of an application I'm building:

Code to reproduce
Expected behavior
I could imagine multiple possible fixes:
Real behavior
The legend simply appears on the top left, without any consideration whether it overlaps with the plot.
Tested environment(s)