Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot use plot() on MacOS & Matlab R2016b #246

Open
tsdev opened this issue Feb 27, 2017 · 3 comments
Open

Cannot use plot() on MacOS & Matlab R2016b #246

tsdev opened this issue Feb 27, 2017 · 3 comments

Comments

@tsdev
Copy link

tsdev commented Feb 27, 2017

I am using python 3.6.0 and the latest version of pymatbrige with Matlab R2016b on MacOS 10.12.3. I can communicate with Matlab fine and execute commands, but when I call a plotting script I get the following output:
{'content': {'stdout': 'Unable to create output using specified size and resolution. Specify a smaller value for the PaperPosition property of the figure or specify a smaller resolution value.', 'datadir': '/private/tmp/MatlabData/'}, 'result': [], 'stack': [{'file': '/Applications/MATLAB_R2016b.app/toolbox/matlab/graphics/print.m', 'name': 'print', 'line': 102}, {'file': '/Applications/MATLAB_R2016b.app/toolbox/matlab/general/saveas.m', 'name': 'saveas', 'line': 168}, {'file': '/usr/local/lib/python3.6/site-packages/pymatbridge-0.6.dev0-py3.6.egg/pymatbridge/matlab/util/make_figs.m', 'name': 'make_figs', 'line': 14}], 'success': False}

Matlab is running with -nodesktop option. I tried to run it with the desktop by using:
from pymatbridge import Matlab
mlab = Matlab(startup_options=' -nosplash')
still the Matlab desktop didn't appear.

@tsdev tsdev changed the title Cannot plot figure Cannot use plot() on MacOS & Matlab R2016b Feb 27, 2017
@arokem
Copy link
Owner

arokem commented Feb 27, 2017

I have seen similar things and have not been able to debug this. I think this has to do with changes introduced in MatlabR2016a, but I am not sure how to get around this.

@tsdev
Copy link
Author

tsdev commented Feb 27, 2017

I could fix it, if I run Matlab with the -desktop option. However I found that plotting seems to be seriously lagging possibly due to the ZMQ code that keeps Matlab busy.
I would like to produce standard Matlab plot figures that the user can interact with. However, even after issuing the drawnow command, it takes forever until the plot draws. And it has a very long reaction time to user interaction (rotating the figure with the mouse, etc.).

Is this normal behaviour, since I have no experience with the ZMQ library? Is there a way to change the polling interval of ZMQ to give Matlab more time to refresh the figure?

@SirBenedick
Copy link

SirBenedick commented Feb 6, 2020

Had the same issue, on Ubuntu 18.04 with Matlab R2019b.

Running matlab.run_code("set(0, 'defaultfigureunits', 'pixels')") before the figure generating code fixed this problem for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants