# Problem with plot\_sensors\_connectivity

**URL:** <https://mne.discourse.group/t/problem-with-plot-sensors-connectivity/4196>\
**Category:** Support & Discussions\
**Tags:** eeg, visualization, connectivity\
**Created:** [December 27, 2021, 6:33am UTC](https://mne.discourse.group/t/problem-with-plot-sensors-connectivity/4196 "2021-12-27T06:33:24Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gbaghdadi](https://avatars.discourse-cdn.com/v4/letter/g/77aa72/32.png) [@Gbaghdadi](https://mne.discourse.group/u/Gbaghdadi)\
**Post date:** [December 27, 2021, 6:33am UTC](https://mne.discourse.group/t/problem-with-plot-sensors-connectivity/4196/1 "2021-12-27T06:33:24Z")

</div>

- MNE version: 0.24.1
- operating system: Windows 10

I have problem in plotting connectivity in sensor space. I wrote the following code.

```python
import mne
from mne_connectivity import spectral_connectivity
from mne.datasets import sample
from mne_connectivity.viz import plot_sensors_connectivity
import os 

raw = mne.io.read_raw_edf('../Validation/RawData For Code Validation/S3.edf', preload=True)
print(raw.info)
raw.get_data().shape[0]
epochs = mne.make_fixed_length_epochs(raw, duration=2, overlap=0, preload=True)
epochs.get_data().shape
sfreq = raw.info['sfreq']
con = spectral_connectivity(
    epochs, method='pli', mode='multitaper', sfreq=sfreq, fmin=0.5, fmax=40,
    faverage=True, mt_adaptive=False, n_jobs=1)
plot_sensors_connectivity(epochs.info,con.get_data(output='dense')[:,:, 0])

```

I got the following error from the last line, I could not find where is the problem:

```python
ValueError: zero-size array to reduction operation maximum which has no identity

```

---

<div class="post-metadata">

**Author:** ![BarryLiu97](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/barryliu97/32/33_2.png) [@BarryLiu97](https://mne.discourse.group/u/BarryLiu97)\
**Post date:** [December 27, 2021, 9:10am UTC](https://mne.discourse.group/t/problem-with-plot-sensors-connectivity/4196/2 "2021-12-27T09:10:28Z")

</div>

Hi, does your data have the location of EEG. Maybe use raw.get\_montage() to see that.

---

<div class="post-metadata">

**Author:** ![Gbaghdadi](https://avatars.discourse-cdn.com/v4/letter/g/77aa72/32.png) [@Gbaghdadi](https://mne.discourse.group/u/Gbaghdadi)\
**Post date:** [December 27, 2021, 10:01am UTC](https://mne.discourse.group/t/problem-with-plot-sensors-connectivity/4196/3 "2021-12-27T10:01:43Z")

</div>

> [@BarryLiu97](#):
>
> raw

Hi, Thank you so much for your help. As you guess my data had not EEG locations.
