# how to plot tfr topomap of epochs in local area like the attribute 'extrapolate' in evoked\_plot \_topomap

**URL:** <https://mne.discourse.group/t/how-to-plot-tfr-topomap-of-epochs-in-local-area-like-the-attribute-extrapolate-in-evoked-plot-topomap/3495>\
**Category:** Support & Discussions\
**Tags:** time-frequency, visualization\
**Created:** [August 5, 2021, 2:00pm UTC](https://mne.discourse.group/t/how-to-plot-tfr-topomap-of-epochs-in-local-area-like-the-attribute-extrapolate-in-evoked-plot-topomap/3495 "2021-08-05T14:00:07Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![QYR\_HME](https://avatars.discourse-cdn.com/v4/letter/q/3da27b/32.png) [@QYR\_HME](https://mne.discourse.group/u/QYR_HME)\
**Post date:** [August 5, 2021, 2:00pm UTC](https://mne.discourse.group/t/how-to-plot-tfr-topomap-of-epochs-in-local-area-like-the-attribute-extrapolate-in-evoked-plot-topomap/3495/1 "2021-08-05T14:00:08Z")

</div>

**If you have a question or issue with MNE-Python, please include the following info:**

- MNE-Python version: 0.23
- operating system: spyder  
Hi,  
In the evoked\_plot\_topomap function, we can plot amplitude value in the local area around certain montages, shown as the following example:  
[1628171612(1)|232x200](https://mne.discourse.group/uploads/short-url/bRE32kDReG1WT9NSbGF5aOrSfAt.png)  
but how to plot the power topomap of epochs like this?

---

<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:** [August 6, 2021, 8:00am UTC](https://mne.discourse.group/t/how-to-plot-tfr-topomap-of-epochs-in-local-area-like-the-attribute-extrapolate-in-evoked-plot-topomap/3495/2 "2021-08-06T08:00:24Z")

</div>

Hello @QYR_HME and welcome to the forum!

I cannot help you with this specific question, but I’m tagging @cbrnr who might have an idea!

Best wishes,  
Richard

---

<div class="post-metadata">

**Author:** ![mmagnuski](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/mmagnuski/32/153_2.png) [@mmagnuski](https://mne.discourse.group/u/mmagnuski)\
**Post date:** [August 6, 2021, 11:29am UTC](https://mne.discourse.group/t/how-to-plot-tfr-topomap-of-epochs-in-local-area-like-the-attribute-extrapolate-in-evoked-plot-topomap/3495/3 "2021-08-06T11:29:19Z")

</div>

You can plot values from raw numpy arrays with `mne.viz.plot_topomap`. So first you can get spectral power in a numpy array and then plot the desired frequency in this way:

```python
psd, freq = mne.time_frequency.psd_welch(epochs)
# the psd array has shape epochs x channels x frequencies, so we average
# the epochs dimension
psd_average = psd.mean(axis=0)

# lets say we want to plot 10 Hz
plot_freq = 10
# we find the index of this frequency
freq_idx = (np.abs(freq - plot_freq)).argmin()
# we plot the topography of power for the chosen frequency
mne.viz.plot_topomap(psd_average[:, freq_idx], epochs.info)

```
