Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

This error message means that you are trying to add a new layout to a PlotWidget in PyQt5, but the PlotWidget already has a layout attached to it. A QWidget or any of its subclasses (including PlotWidget) can only have one layout at a time.

To fix the error, you need to remove the existing layout from the PlotWidget before adding a new one. You can do this by calling the setLayout() method on the PlotWidget and passing it the new layout. Alternatively, you can remove the existing layout by calling the deleteLater() method on it before adding a new layout.