# Plotting Error - EEG Unit

**URL:** <https://mne.discourse.group/t/plotting-error-eeg-unit/5233>\
**Category:** Support & Discussions\
**Tags:** visualization, data-import\
**Created:** [July 7, 2022, 9:56am UTC](https://mne.discourse.group/t/plotting-error-eeg-unit/5233 "2022-07-07T09:56:41Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Star](https://avatars.discourse-cdn.com/v4/letter/s/ad7895/32.png) [@Star](https://mne.discourse.group/u/Star)\
**Post date:** [July 7, 2022, 9:56am UTC](https://mne.discourse.group/t/plotting-error-eeg-unit/5233/1 "2022-07-07T09:56:41Z")

</div>

Hello,

This is a sample of my dataset.

 ![image](https://global.discourse-cdn.com/free1/uploads/mne/original/2X/f/f5d828b16a124c2d5aa665457f23c0b5e73eac08.png)

sampling frequency - 128 Hz

- operating system: Windows 10

When plotted getting an distorted image like the below one. How to rectify it and get a proper signal.  
`raw.plot()`

 ![image](https://global.discourse-cdn.com/free1/uploads/mne/original/2X/6/6ea309aee0f41f911c07b9de0f2ae8eb897bf2f6.png)

In the csv folder of the dataset I have events also. Have created a channel for the events also. But getting error.  
ValueError: No stim channels found. Consider specifying them manually using the ‘stim\_channel’ parameter.

`events = mne.find_events(raw)`

How to process the events col. of the csv file and process the eeg signals and predict which event based on the 14 channels?

Thanks

---

<div class="post-metadata">

**Author:** ![richard](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/richard/32/15_2.png) [@richard](https://mne.discourse.group/u/richard)\
**Post date:** [July 7, 2022, 11:44am UTC](https://mne.discourse.group/t/plotting-error-eeg-unit/5233/2 "2022-07-07T11:44:12Z")

</div>

Hello,

> [@Star](#):
>
> How to rectify it and get a proper signal.

the data values seem to be in µV, but MNE requires SI units, i.e., Volts. Multiply the values by 1e-6 and things should already look much better.

As for the other question, can you please open a separate topic?

Best wishes,  
Richard

---

<div class="post-metadata">

**Author:** ![Star](https://avatars.discourse-cdn.com/v4/letter/s/ad7895/32.png) [@Star](https://mne.discourse.group/u/Star)\
**Post date:** [July 7, 2022, 11:57am UTC](https://mne.discourse.group/t/plotting-error-eeg-unit/5233/3 "2022-07-07T11:57:12Z")

</div>

Hello Richard,

```python
dataframe = pd.read_csv('eeg.csv') 
eeg_data = dataframe.transpose().to_numpy()
n_channels = len(dataframe.columns)    
sampling_freq = 128  
info = mne.create_info(n_channels, sfreq=sampling_freq)

info = mne.create_info(ch_names, ch_types=ch_types, sfreq=sampling_freq)
info.set_montage('standard_1020')

raw = mne.io.RawArray(eeg_data, info)
raw.save('eeg.fif',overwrite=True)

raw.plot()

```

I’m converting it from .csv to .fif and plotting, so then how do I convert the data unit from µV to V.

Thanks

---

<div class="post-metadata">

**Author:** ![richard](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/richard/32/15_2.png) [@richard](https://mne.discourse.group/u/richard)\
**Post date:** [July 7, 2022, 12:39pm UTC](https://mne.discourse.group/t/plotting-error-eeg-unit/5233/4 "2022-07-07T12:39:55Z")

</div>

Just multiply the dataframe by 1e-6 before creating the RawArray, that should do the trick.

Best wishes  
Richard

---

<div class="post-metadata">

**Author:** ![richard](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/richard/32/15_2.png) [@richard](https://mne.discourse.group/u/richard)\
**Post date:** [July 7, 2022, 12:56pm UTC](https://mne.discourse.group/t/plotting-error-eeg-unit/5233/6 "2022-07-07T12:56:54Z")

</div>

Hello @Star, great to see it’s working!

Can you please post your other question into a new topic? Thank you!

Richard

---

<div class="post-metadata">

**Author:** ![Star](https://avatars.discourse-cdn.com/v4/letter/s/ad7895/32.png) [@Star](https://mne.discourse.group/u/Star)\
**Post date:** [July 7, 2022, 1:03pm UTC](https://mne.discourse.group/t/plotting-error-eeg-unit/5233/7 "2022-07-07T13:03:57Z")

</div>

Thanks, Have posted it separately.

---

<div class="post-metadata">

**Author:** ![Star](https://avatars.discourse-cdn.com/v4/letter/s/ad7895/32.png) [@Star](https://mne.discourse.group/u/Star)\
**Post date:** [July 7, 2022, 1:26pm UTC](https://mne.discourse.group/t/plotting-error-eeg-unit/5233/8 "2022-07-07T13:26:03Z")

</div>

Sorry but now the event column in the data frame also gets multiplied with 1e-6. That why I asked the Event’s based classification question ([Event's based Classification](https://mne.discourse.group/t/events-based-classification/5237)) with this also.  
Could you help me with this @richard .

Thanks

---

<div class="post-metadata">

**Author:** ![richard](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/richard/32/15_2.png) [@richard](https://mne.discourse.group/u/richard)\
**Post date:** [July 7, 2022, 2:05pm UTC](https://mne.discourse.group/t/plotting-error-eeg-unit/5233/9 "2022-07-07T14:05:34Z")

</div>

You can exclude the last column from the multiplication by doing something like:

```python
dataframe.loc[
    :, # all rows
    dataframe.columns[:-1] # omit last column (events)
] *= 1e-6

```

Best wishes,  
Richard
