semiautomaticgit / SemiAutomaticClassificationPlugin

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

Spectral signature plot not produced : bug #355

Open GITHUBAntoineDENIS opened 1 month ago

GITHUBAntoineDENIS commented 1 month ago

Hello, When trying to create the graph of spectral signature with scp

STACK TRACE: Une erreur est survenue lors de l'exécution du code Python :

AttributeError: 'ArtistList' object has no attribute 'pop' Traceback (most recent call last): File "C:\Users/Administrator/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\SemiAutomaticClassificationPlugin\interface\scp_dock.py", line 2639, in add_signature_to_spectral_plot cfg.spectral_signature_plotter.signature_list_plot_table() File "C:\Users/Administrator/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\SemiAutomaticClassificationPlugin\spectral_signature\spectral_signature_plot.py", line 278, in signature_list_plot_table self.signature_plot() File "C:\Users/Administrator/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\SemiAutomaticClassificationPlugin\spectral_signature\spectral_signature_plot.py", line 306, in signature_plot self.ax.lines.pop(i) ^^^^^^^^^^^^^^^^^ AttributeError: 'ArtistList' object has no attribute 'pop'

Version de Python : 3.12.3 (main, Apr 14 2024, 17:21:43) [MSC v.1938 64 bit (AMD64)] Version de QGIS : 3.34.6-Prizren Prizren, 623828f5

Chemin Python : C:/PROGRA~1/QGIS33~1.6/apps/qgis-ltr/./python C:/Users/Administrator/AppData/Roaming/QGIS/QGIS3\profiles\default/python C:/Users/Administrator/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins C:/PROGRA~1/QGIS33~1.6/apps/qgis-ltr/./python/plugins C:\PROGRA~1\QGIS33~1.6\apps\grass\grass83\etc\python C:\TP_SIG_TELED\TELED\5_CLASSIFICATION_SUPERVISEE_ANALYSE_DIACHRONIQUE C:\Program Files\QGIS 3.34.6\bin\python312.zip C:\PROGRA~1\QGIS33~1.6\apps\Python312\DLLs C:\PROGRA~1\QGIS33~1.6\apps\Python312\Lib C:\Program Files\QGIS 3.34.6\bin C:\PROGRA~1\QGIS33~1.6\apps\Python312 C:\PROGRA~1\QGIS33~1.6\apps\Python312\Lib\site-packages C:\PROGRA~1\QGIS33~1.6\apps\Python312\Lib\site-packages\win32 C:\PROGRA~1\QGIS33~1.6\apps\Python312\Lib\site-packages\win32\lib C:\PROGRA~1\QGIS33~1.6\apps\Python312\Lib\site-packages\Pythonwin C:/Users/Administrator/AppData/Roaming/QGIS/QGIS3\profiles\default/python C:/TP_SIG_TELED/TELED/5_CLASSIFICATION_SUPERVISEE_ANALYSE_DIACHRONIQUE


PYTHON ERROR 2024-05-17T09:06:10 WARNING Traceback (most recent call last): File "C:\Users/Administrator/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\SemiAutomaticClassificationPlugin\interface\scp_dock.py", line 2639, in add_signature_to_spectral_plot cfg.spectral_signature_plotter.signature_list_plot_table() File "C:\Users/Administrator/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\SemiAutomaticClassificationPlugin\spectral_signature\spectral_signature_plot.py", line 278, in signature_list_plot_table self.signature_plot() File "C:\Users/Administrator/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\SemiAutomaticClassificationPlugin\spectral_signature\spectral_signature_plot.py", line 306, in signature_plot self.ax.lines.pop(i) ^^^^^^^^^^^^^^^^^ AttributeError: 'ArtistList' object has no attribute 'pop'

PYTHON ERROR 2024-05-17T08:59:08 WARNING Traceback (most recent call last): File "C:\Users/Administrator/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\SemiAutomaticClassificationPlugin\interface\scp_dock.py", line 2639, in add_signature_to_spectral_plot cfg.spectral_signature_plotter.signature_list_plot_table() File "C:\Users/Administrator/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\SemiAutomaticClassificationPlugin\spectral_signature\spectral_signature_plot.py", line 278, in signature_list_plot_table self.signature_plot() File "C:\Users/Administrator/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\SemiAutomaticClassificationPlugin\spectral_signature\spectral_signature_plot.py", line 414, in signature_plot self.ax.set_xticks(wavelengths_list) File "C:\PROGRA~1\QGIS33~1.6\apps\Python312\Lib\site-packages\matplotlib\axes_base.py", line 73, in wrapper return get_method(self)(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\PROGRA~1\QGIS33~1.6\apps\Python312\Lib\site-packages\matplotlib\axis.py", line 2138, in set_ticks result = self._set_tick_locations(ticks, minor=minor) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\PROGRA~1\QGIS33~1.6\apps\Python312\Lib\site-packages\matplotlib\axis.py", line 2078, in _set_tick_locations locator = mticker.FixedLocator(ticks) # validate ticks early. ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\PROGRA~1\QGIS33~1.6\apps\Python312\Lib\site-packages\matplotlib\ticker.py", line 1700, in init _api.check_shape((None,), locs=self.locs) File "C:\PROGRA~1\QGIS33~1.6\apps\Python312\Lib\site-packages\matplotlib_api__init__.py", line 161, in check_shape raise ValueError( ValueError: 'locs' must be 1D with shape (N,), but your input has shape ()

image

semiautomaticgit commented 1 month ago

Hello @GITHUBAntoineDENIS ,

thank you for reporting this. It seems an issue related to a new version of Matplotlib. I'll try to fix it. In the meantime you can try to install an older version of QGIS which should include an older version of Matplotlib too.

Juliana9 commented 3 weeks ago

Olá, também estou passando pela mesma situação !! Qual seria a melhor versão para realizar a classificação?

semiautomaticgit commented 2 weeks ago

Olá, também estou passando pela mesma situação !! Qual seria a melhor versão para realizar a classificação?

Hello @Juliana9 , you can try QGIS version 3.28 https://download.qgis.org/downloads/QGIS-OSGeo4W-3.28.15-1.msi