Calling Python from within Matlab
Show older comments
I was just playing around with the python py import within MATLAB. Should this work? The problem is with the plt.show() command. Other lines seem fine. No real reason why I would want to do this, just interested.
plt = py.importlib.import_module('matplotlib.pyplot');
plt.plot([1, 2, 3, 4]);
% plt.show(); % CRASHES MATLAB
plt.savefig('test.pdf', pyargs('dpi', 100, 'facecolor', 'b')); % WORKS
Mac OS 10.10.4 Matlab 2015a
Answers (0)
Categories
Find more on Call Python from MATLAB in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!