Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

no plot visible #22074

Open
Vinesh46-git opened this issue May 13, 2024 · 1 comment
Open

no plot visible #22074

Vinesh46-git opened this issue May 13, 2024 · 1 comment

Comments

@Vinesh46-git
Copy link

Description

What steps will reproduce the problem?

import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
import seaborn as sns

Load the tips dataset

tips_df = sns.load_dataset("tips")

Create a radial plot

fig = plt.figure(figsize=(8, 6))
ax = fig.add_subplot(111, polar=True)

Convert categorical variables to numerical values

day_mapping = {'Thur': 0, 'Fri': 1, 'Sat': 2, 'Sun': 3}
tips_df['day_numeric'] = tips_df['day'].map(day_mapping)

Compute mean total bill amount for each day

mean_total_bill = tips_df.groupby('day_numeric')['total_bill'].mean().values

Compute the number of days

num_days = len(mean_total_bill)

Create theta values for each day

theta = np.linspace(0, 2*np.pi, num_days, endpoint=False)

Plot the radial plot

ax.plot(theta, mean_total_bill)
ax.fill(theta, mean_total_bill, 'b', alpha=0.1)

Set the labels

ax.set_xticks(theta)
ax.set_xticklabels(day_mapping.keys())

Set the title

plt.title('Mean Total Bill Amount by Day')

Show the plot

plt.show()

Traceback

Exception in comms call get_namespace_view:
  File "C:\Users\bandewav8638\Anaconda3\lib\site-packages\spyder_kernels\comms\commbase.py", line 343, in _handle_remote_call
    return_value = self._remote_callback(
  File "C:\Users\bandewav8638\Anaconda3\lib\site-packages\spyder_kernels\comms\frontendcomm.py", line 267, in _remote_callback
    return super(FrontendComm, self)._remote_callback(
  File "C:\Users\bandewav8638\Anaconda3\lib\site-packages\spyder_kernels\comms\commbase.py", line 356, in _remote_callback
    return self._remote_call_handlers[call_name](
  File "C:\Users\bandewav8638\Anaconda3\lib\site-packages\spyder_kernels\console\kernel.py", line 189, in get_namespace_view
    view = make_remote_view(ns, settings, EXCLUDED_NAMES)
  File "C:\Users\bandewav8638\Anaconda3\lib\site-packages\spyder_kernels\utils\nsview.py", line 677, in make_remote_view
    'type':  get_human_readable_type(value),
  File "C:\Users\bandewav8638\Anaconda3\lib\site-packages\spyder_kernels\utils\nsview.py", line 528, in get_human_readable_type
    elif isinstance(item, PIL.Image.Image):
  File "C:\Users\bandewav8638\Anaconda3\lib\site-packages\spyder_kernels\utils\lazymodules.py", line 55, in __getattr__
    return getattr(self.__spy_mod__, name)
AttributeError: module 'PIL' has no attribute 'Image'

Versions

  • Spyder version: 5.2.2
  • Python version: 3.9.13
  • Qt version: 5.9.7
  • PyQt5 version: 5.9.2
  • Operating System: Windows 10

Dependencies

# Mandatory:
atomicwrites >=1.2.0          :  1.4.0 (OK)
chardet >=2.0.0               :  3.0.4 (OK)
cloudpickle >=0.5.0           :  2.0.0 (OK)
cookiecutter >=1.6.0          :  1.7.3 (OK)
diff_match_patch >=20181111   :  20200713 (OK)
intervaltree >=3.0.2          :  3.1.0 (OK)
IPython >=7.6.0;<8.0.0        :  7.31.1 (OK)
jedi >=0.17.2;<0.19.0         :  0.18.1 (OK)
jellyfish >=0.7               :  0.9.0 (OK)
jsonschema >=3.2.0            :  4.16.0 (OK)
keyring >=17.0.0              :  23.4.0 (OK)
nbconvert >=4.0               :  6.4.4 (OK)
numpydoc >=0.6.0              :  1.4.0 (OK)
paramiko >=2.4.0              :  2.8.1 (OK)
parso >=0.7.0;<0.9.0          :  0.8.3 (OK)
pexpect >=4.4.0               :  4.8.0 (OK)
pickleshare >=0.4             :  0.7.5 (OK)
psutil >=5.3                  :  5.9.0 (OK)
pygments >=2.0                :  2.11.2 (OK)
pylint >=2.5.0                :  2.14.5 (OK)
pyls_spyder >=0.4.0           :  0.4.0 (OK)
pylsp >=1.3.2;<1.4.0          :  1.3.3 (OK)
pylsp_black >=1.0.0           :  1.0.0 (OK)
qdarkstyle =3.0.2             :  3.0.2 (OK)
qstylizer >=0.1.10            :  0.1.10 (OK)
qtawesome >=1.0.2             :  1.0.3 (OK)
qtconsole >=5.2.1;<5.3.0      :  5.2.2 (OK)
qtpy >=1.5.0                  :  2.2.0 (OK)
rtree >=0.9.7                 :  0.9.7 (OK)
setuptools >=49.6.0           :  63.4.1 (OK)
sphinx >=0.6.6                :  5.0.2 (OK)
spyder_kernels >=2.2.1;<2.3.0 :  2.2.1 (OK)
textdistance >=4.2.0          :  4.2.1 (OK)
three_merge >=0.1.1           :  0.1.1 (OK)
watchdog >=0.10.3             :  2.1.6 (OK)
zmq >=17                      :  23.2.0 (OK)

# Optional:
cython >=0.21                 :  0.29.32 (OK)
matplotlib >=2.0.0            :  3.5.2 (OK)
numpy >=1.7                   :  1.26.4 (OK)
pandas >=1.1.1                :  1.4.4 (OK)
scipy >=0.17.0                :  1.9.1 (OK)
sympy >=0.7.3                 :  1.10.1 (OK)
@ccordoba12
Copy link
Member

Hey @Vinesh46-git, thanks for reporting. This problem should be fixed in our latest version available in Anaconda (5.5.1). Please update by closing Spyder, opening the Anaconda Prompt and running there the commands mentioned in our documentation.

Let us know if that works for you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants