# data computed in mne.viz.plot\_topomap \[Edit in plot\_topomap\]

**URL:** <https://mne.discourse.group/t/data-computed-in-mne-viz-plot-topomap-edit-in-plot-topomap/4739>\
**Category:** Support & Discussions\
**Tags:** time-frequency, visualization\
**Created:** [April 20, 2022, 7:36am UTC](https://mne.discourse.group/t/data-computed-in-mne-viz-plot-topomap-edit-in-plot-topomap/4739 "2022-04-20T07:36:04Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![daddz17](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/daddz17/32/1373_2.png) [@daddz17](https://mne.discourse.group/u/daddz17)\
**Post date:** [April 20, 2022, 7:36am UTC](https://mne.discourse.group/t/data-computed-in-mne-viz-plot-topomap-edit-in-plot-topomap/4739/1 "2022-04-20T07:36:04Z")

</div>

- MNE version: 1.0.2
- operating system: Windows 10

Dear all, thanks a lot for your work in this forum, all thread is very usefull for person like me that is approaching for the first time at mne library.  
My question (I suppose) is very easy for you:

i’m using the mne.viz.plot\_topomap to visualize datas interpolated after computing PSD with Welch’s Method for each channel. My question is:

it is possible to store datas computed in function plot\_topomap, in addition to printing the image?  
i want to compute values between channels and append to 2d matrix but i can’t find anything to do that.  
Thanks a lot for helping me, and i’m sorry if my english is not perfect, i’m studying also to improve it.

best regards

---

<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:** [April 20, 2022, 8:04am UTC](https://mne.discourse.group/t/data-computed-in-mne-viz-plot-topomap-edit-in-plot-topomap/4739/2 "2022-04-20T08:04:56Z")

</div>

Hello @daddz17 and welcome to the forum!

> [@daddz17](#):
>
> i’m using the mne.viz.plot\_topomap to visualize datas interpolated after computing PSD with Welch’s Method for each channel. My question is:
> 
> it is possible to store datas computed in function plot\_topomap, in addition to printing the image?  
> i want to compute values between channels and append to 2d matrix but i can’t find anything to do that.  
> Thanks a lot for helping me, and i’m sorry if my english is not perfect, i’m studying also to improve it.

Are you sure you’re actually using [`mne.viz.plot_topomap()`](https://mne.tools/stable/generated/mne.viz.plot_topomap.html), or are you rather using one of the `.plot_topomap()` methods?

I’m asking because `mne.viz.plot_topomap()` expects as its first argument the actual data you wish to plot, in the form of an array. So if you’re using this function, you **already** have the data you’re looking for!

Or am I missing something?

It can also be helpful to share some of your code – might make it easier for others to follow what you intend to do!

Best wishes,  
Richard

---

<div class="post-metadata">

**Author:** ![daddz17](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/daddz17/32/1373_2.png) [@daddz17](https://mne.discourse.group/u/daddz17)\
**Post date:** [April 20, 2022, 8:38am UTC](https://mne.discourse.group/t/data-computed-in-mne-viz-plot-topomap-edit-in-plot-topomap/4739/3 "2022-04-20T08:38:37Z")

</div>

no you are right i’m sorry, i’m using plot\_topomap. So i want to extract value interpolated that method uses to plot value inside head, because i have data from channels. My goal is to have a square matrix with the interpolated values inside the scalp, which can then be plotted if desired.

thanks a lot for your answer!

---

<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:** [April 20, 2022, 8:50am UTC](https://mne.discourse.group/t/data-computed-in-mne-viz-plot-topomap-edit-in-plot-topomap/4739/4 "2022-04-20T08:50:41Z")

</div>

Hello @daddz17, there’s currently no easy way to extract the interpolated data. This magic happens in the private `_plot_topomap()` function:

> <https://github.com/mne-tools/mne-python/blob/419ecdbf4ee0ac7cdfd2d71d3d001f77ec5d9840/mne/viz/topomap.py#L936-L948>

You might be able to step through this code and figure out what and why it does how, but I’m afraid it’s not **super** trivial ☹

---

<div class="post-metadata">

**Author:** ![daddz17](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/daddz17/32/1373_2.png) [@daddz17](https://mne.discourse.group/u/daddz17)\
**Post date:** [April 20, 2022, 8:53am UTC](https://mne.discourse.group/t/data-computed-in-mne-viz-plot-topomap-edit-in-plot-topomap/4739/5 "2022-04-20T08:53:03Z")

</div>

Thanks a lot, yes i have already seen the code and i have understand that it will be not easy things to do! but i will try! I take this opportunity to ask you: if I were to be able to create a function that does this, could I share it with the community?

---

<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:** [April 20, 2022, 9:45am UTC](https://mne.discourse.group/t/data-computed-in-mne-viz-plot-topomap-edit-in-plot-topomap/4739/6 "2022-04-20T09:45:10Z")

</div>

Yes, of course! Feel free to share anything you have if you think it could be useful to others!
