semiautomaticgit / SemiAutomaticClassificationPlugin

https://fromgistors.blogspot.com/p/semi-automatic-classification-plugin.html
Other
136 stars 50 forks source link

AttributeError: 'Legend' object has no attribute 'draggable' #63

Closed jpvilla closed 5 years ago

jpvilla commented 5 years ago

WARNING Traceback (most recent call last): File "/Users/Juan1/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins/SemiAutomaticClassificationPlugin/semiautomaticclassificationplugin.py", line 1296, in newProjectLoaded cfg.spSigPlot.refreshPlot() File "/Users/Juan1/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins/SemiAutomaticClassificationPlugin/spectralsignature/spectralsignatureplot.py", line 463, in refreshPlot self.signaturePlot() File "/Users/Juan1/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins/SemiAutomaticClassificationPlugin/spectralsignature/spectralsignatureplot.py", line 711, in signaturePlot cfg.uisp.Sig_Widget.sigCanvas.ax.legend(pL, pLN, bbox_to_anchor=(0.1, 0.0, 1.1, 1.0), loc=1, borderaxespad=0.).draggable() AttributeError: 'Legend' object has no attribute 'draggable'

jpvilla commented 5 years ago

como soluciono ese error Gracias

LittleWhite-tb commented 5 years ago

Hello,

Got the same error on Linux Manjaro, with QGIS 3.80 and matplotlib 3.1.1-1. It happens certainly only with matplotlib 3.1.1, cause they changed the draggable() function to set_dragabble() on Legend. (Source: https://matplotlib.org/api/api_changes.html#removals).

LittleWhite-tb commented 5 years ago

Can be quick fixed by editing the script yourself: Edit the spectralsignatureplot.py file, go to line 711 and change it for:

cfg.uisp.Sig_Widget.sigCanvas.ax.legend(pL, pLN, bbox_to_anchor=(0.1, 0.0, 1.1, 1.0), loc=1, borderaxespad=0.).set_draggable(True)
semiautomaticgit commented 5 years ago

Thank you. It should be fixed in SCP 6.3.1