spyder-ide / spyder

Official repository for Spyder - The Scientific Python Development Environment
https://www.spyder-ide.org
MIT License
8.32k stars 1.61k forks source link

error when plotting #15358

Closed alcarnielo closed 3 years ago

alcarnielo commented 3 years ago

Description

What steps will reproduce the problem?

I was treatting a pressure distribution over airfoil file ("X" x "CP" ) inside a pandas dataframe. When I tried to verify the results. Then I performed a simple plot directelly from the dataframe

the lst_splt list is something like this:

lst_splt = [['0.01','0.03'], ['0.02','0.06'],...]

it was obtained using XFOIL (a pannel method file) ant is on this format:

"""

x Cp

 1.00000    0.24276
 0.99818    0.23883
 0.99591    0.22657
 0.99342    0.21421
 0.99066    0.20128
 0.98759    0.18802

(this file is extense and will not be completely described herein) ... """

reading the file

fl = open(cp_fl,'r') lst = fl.readlines() lst_splt = [ s.replace('#','').split() for s in lst]

creating a dataframe

cp = pd.DataFrame(lst_splt[1:], columns=lst_splt[:1], dtype=float)

checking data

cp.plot()

Traceback

  File "/home/alvaro/anaconda3/lib/python3.8/site-packages/spyder/plugins/plots/widgets/figurebrowser.py", line 421, in _handle_new_figure
    self.thumbnails_sb.add_thumbnail(fig, fmt)
  File "/home/alvaro/anaconda3/lib/python3.8/site-packages/spyder/plugins/plots/widgets/figurebrowser.py", line 866, in add_thumbnail
    self.set_current_thumbnail(thumbnail)
  File "/home/alvaro/anaconda3/lib/python3.8/site-packages/spyder/plugins/plots/widgets/figurebrowser.py", line 942, in set_current_thumbnail
    thumbnail.highlight_canvas(thumbnail == self.current_thumbnail)
  File "/home/alvaro/anaconda3/lib/python3.8/site-packages/spyder/plugins/plots/widgets/figurebrowser.py", line 1035, in highlight_canvas
    qdarkstyle.palette.DarkPalette.COLOR_SELECTION_LIGHT
AttributeError: module 'qdarkstyle.palette' has no attribute 'DarkPalette'
WARNING:spyder.widgets.github.backend:Failed to send bug report on Github. response={'code': 401, 'json': {'message': 'Bad credentials', 'documentation_url': 'https://docs.github.com/rest'}}

Versions

Dependencies


# Mandatory:
atomicwrites >=1.2.0            :  1.4.0 (OK)
chardet >=2.0.0                 :  3.0.4 (OK)
cloudpickle >=0.5.0             :  1.6.0 (OK)
diff_match_patch >=20181111     :  20200713 (OK)
intervaltree >=3.0.2            :  3.1.0 (OK)
IPython >=4.0                   :  7.22.0 (OK)
jedi =0.17.2                    :  0.17.2 (OK)
jsonschema >=3.2.0              :  3.2.0 (OK)
keyring >=17.0.0                :  22.3.0 (OK)
nbconvert >=4.0                 :  6.0.7 (OK)
numpydoc >=0.6.0                :  1.1.0 (OK)
parso =0.7.0                    :  0.7.0 (OK)
pexpect >=4.4.0                 :  4.8.0 (OK)
pickleshare >=0.4               :  0.7.5 (OK)
psutil >=5.3                    :  5.8.0 (OK)
pygments >=2.0                  :  2.8.1 (OK)
pylint >=1.0                    :  2.7.4 (OK)
pyls >=0.36.1;<1.0.0            :  0.36.2 (OK)
pyls_black >=0.4.6              :  0.4.6 (OK)
pyls_spyder >=0.1.1             :  0.3.2 (OK)
qdarkstyle >=2.8                :  3.0.2 (OK)
qtawesome >=0.5.7               :  1.0.2 (OK)
qtconsole >=4.7.7               :  5.0.3 (OK)
qtpy >=1.5.0                    :  1.9.0 (OK)
rtree >=0.8.3                   :  0.9.7 (OK)
setuptools >=39.0.0             :  52.0.0.post20210125 (OK)
sphinx >=0.6.6                  :  3.2.1 (OK)
spyder_kernels >=1.10.0;<1.11.0 :  1.10.0 (OK)
three_merge >=0.1.1             :  0.1.1 (OK)
watchdog >=0.10.3               :  1.0.2 (OK)
xdg >=0.26                      :  0.27 (OK)
zmq >=17                        :  20.0.0 (OK)

# Optional:
cython >=0.21                   :  0.29.23 (OK)
matplotlib >=2.0.0              :  3.3.4 (OK)
numpy >=1.7                     :  1.19.2 (OK)
pandas >=1.1.1                  :  1.2.4 (OK)
scipy >=0.17.0                  :  1.6.2 (OK)
sympy >=0.7.3                   :  1.8 (OK)
spyder-bot commented 3 years ago

Thanks for reporting. To fix this, please close Spyder, open the Anaconda Prompt and run there:

conda install qdarkstyle=2.8.1