extract values from figures


Sorry if this have been already explained. Do you know how to extract the values from the figures?
Let’s say I have a psd figure or a topomap saved in fig. Do you know how can I get the corresponding array with channels and values? Is it possible or are there other functions I should call instead of trying to do this. It seems the most immediate functions are plot_psd() and plot_topomap() so I don’ know if there are equivalent ones to get the actual values that produce them.


I am not sure how to extract values from figures, although i assume it’s possible using matplotlib. But for the example you provide you could compute the values using something like psd_welch mne.time_frequency.psd_welch — MNE 0.23.4 documentation

Does this help? Or do you specifically want the figure values?

Thanks @rob-luke ! I initially tried the psd_welch funtion, and then try to plot by myself but I’m having some other issues like ploting on the layout, small differences in values due to the different methods, etc. So I was maybe considering using the other approach and just extract the values I got from mne figures. But maybe it’s not a common one?