[Eeglablist] Generate jpg, png, gif formats through topoplot function without the need to save it manually

Andreas Widmann widmann at uni-leipzig.de
Wed Apr 13 02:03:17 PDT 2022


print( '-dpng', 'somefilename.png', '-r300‘ )
exports the current figure as png from the CLI (with 300 dpi resolution). Same principle for jpg, etc.

Adding a figure handle to the print command can be helpful if plotting and exporting multiple figures (e.g., in a loop):
figHandle = figure;
your_plot_command
print(figHandle, '-dpng', 'somefilename.png', '-r300‘)

Hope this helps! Best,
Andreas

> Am 12.04.2022 um 21:28 schrieb Victor Gimenez <victor.gimenez at ufabc.edu.br>:
> 
> Good Morning/Afternoon/Evening dear EEGLab community,
> 
> 
> 
> I am trying to return the data obtained from the execution of topoplot function directly to write a file in any of these image formats: .jpg, .gif, or .png (without the need to file > save_as blablabla) instead to only plot the data at the screen because I am looking for to save more image contents to generate a dataset of samples.
> 
> I already did: tp = topoplot(<EEG input data to be read>,EEG.chanlocs,'style','map'); but it returned me only a 1x1 surface type data that I can't able to open directly without EEGLab or execute functions as imread and ind2rgb to convert the image data into an rgb array.
> 
> Is there any way to save directly the topological map data in any type only through code??
> 
> 
> Thanks in advance,
> 
> Victor
> _______________________________________________
> Eeglablist page: http://sccn.ucsd.edu/eeglab/eeglabmail.html
> To unsubscribe, send an empty email to eeglablist-unsubscribe at sccn.ucsd.edu
> For digest mode, send an email with the subject "set digest mime" to eeglablist-request at sccn.ucsd.edu




More information about the eeglablist mailing list