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

Python stalls and throws a Java exception whenever plotting functions are called. #244

Open
cosmojg opened this issue Aug 16, 2016 · 12 comments

Comments

@cosmojg
Copy link

cosmojg commented Aug 16, 2016

As the title states, plotting doesn't seem to work on my system whatsoever. I am running Ubuntu 16.04 with MATLAB R2016a and Python 3.5 installed via Anaconda. I've updated IPython to version 5.1 as well, and zeromq is version 4.1.4.

The error can be replicated by attempting to run either example notebook (matlab_magic.ipynb or pymatbridge.ipynb) or by simply trying to run matlab.plot(x), matlab.bar(x), or any other plotting command after starting a MATLAB server.

Here's the exception:

!!!!!!!!
java.lang.Exception: Stack trace
    at java.lang.Thread.dumpStack(Unknown Source)
    at com.mathworks.hg.util.OutputHelperProcessingException.<init>(OutputHelperProcessingException.java:17)
    at com.mathworks.hg.util.HGRasterOutputHelper.generateOutput(HGRasterOutputHelper.java:170)
!!!!!!!!
@trummelbummel
Copy link

trummelbummel commented Aug 17, 2016

same here unfortunately! Any ideas on other similar options that don't throw these errors are appreciated as well. I'd need the plots, but I have the feeling that this is my best bet with the new matlab version. I have seen this issue being mentioned as related to the matlab version 2016a. Maybe downgrading matlab is a possibility for now.

Things other than plotting work well for me.

Anaconda , Ubuntu 14.04 , Matlab 2016a.

@arokem
Copy link
Owner

arokem commented Aug 17, 2016

Yes - I now have Matlab2016 and I am seeing the same issues with plotting.

The MatlabInterpreterError that gets thrown says:

"Images must contain fewer than 2^32 - 1 bytes of data."

It looks like images are getting generated at some unreasonably high
resolution, or something like that:

http://stackoverflow.com/questions/34113784/saving-a-
very-large-image-in-matlab

I am not sure why that's happening, though.

On Wed, Aug 17, 2016 at 5:36 AM, trummelbummel [email protected]
wrote:

same here unfortunately! I just bought matlab because the spectrogram
function in python mlab was not giving me the correct results. Any ideas on
other similar options that don't throw these errors are appreciated as
well. I'd need the plots, but I have the feeling that this is my best bet
with the new matlab version. I have seen this issue being mentioned as
related to the matlab version 2016a. Maybe downgrading matlab is a
possibility for now.


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#244 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAHPNiALhNop2OLclTokDuNrqLum7pw3ks5qgwAygaJpZM4JlsAM
.

@cosmojg
Copy link
Author

cosmojg commented Aug 17, 2016

@arokem How are you viewing that MatlabInterpreterError?

@arokem
Copy link
Owner

arokem commented Aug 17, 2016

It gets raised by cell 3 in this notebook:

https://github.com/arokem/python-matlab-bridge/blob/master/pymatbridge/examples/matlab_magic.ipynb

On Wed, Aug 17, 2016 at 12:12 PM, Cosmo [email protected] wrote:

@arokem https://github.com/arokem How are you viewing that
MatlabInterpreterError?


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#244 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAHPNkfxbBx3unrC6gCIdweBQpuwLwmdks5qg10ugaJpZM4JlsAM
.

@cosmojg
Copy link
Author

cosmojg commented Aug 17, 2016

@arokem All I see is this:

screenshot from 2016-08-17 15-39-17

@arokem
Copy link
Owner

arokem commented Aug 17, 2016

I see that first, but then after a short wait:

On Wed, Aug 17, 2016 at 12:44 PM, Cosmo [email protected] wrote:

@arokem https://github.com/arokem All I see is this:
http://i.imgur.com/mO2Yu8b.png


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#244 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAHPNiMPFlR_UECF-fSSg7X-FY0B4oQlks5qg2SCgaJpZM4JlsAM
.

@arokem
Copy link
Owner

arokem commented Aug 17, 2016

screen shot 2016-08-17 at 3 17 23 pm

@cosmojg
Copy link
Author

cosmojg commented Aug 17, 2016

@arokem Ahh, I see. I guess I should have let the code run a bit longer. What are your thoughts on how to fix it? I've only just started diving into your program so I don't yet have any grand ideas of my own.

@arokem
Copy link
Owner

arokem commented Aug 17, 2016

One possible place that might be causing this is the setting of plot
properties:

https://github.com/arokem/python-matlab-bridge/blob/master/pymatbridge/pymatbridge.py#L332-L341

If the API of this changed in Matlab 2016, something in there might cause
plots to blow up.

On Wed, Aug 17, 2016 at 4:38 PM, Cosmo [email protected] wrote:

@arokem https://github.com/arokem Ahh, I see. I guess I should have let
the code run a bit longer. What are your thoughts on how to fix it? I've
only just started diving into your program so I personally don't have any
grand ideas yet.


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#244 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAHPNlIx50j1j2wgWvAyYH-Aher35WHrks5qg5tegaJpZM4JlsAM
.

@trummelbummel
Copy link

I am not quite sure why the size of the image would be relevant if I'd save my images within the matlab script and do not pass them back to python? Whereas I would like to pass back the computed values to python.

@arokem
Copy link
Owner

arokem commented Aug 18, 2016

I think that something in this setup is causing Matlab to create images
that are unreasonably large when plot is called (see the link to SO
above).

On Wed, Aug 17, 2016 at 11:48 PM, trummelbummel [email protected]
wrote:

I am not quite sure why the size of the image would be relevant if I'd
save my images within the matlab script and do not pass them back to
python? Whereas I would like to pass back the computed values to python.


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#244 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAHPNuOG4p-pvuKGJxC317lWLRYW9eoFks5qhAAzgaJpZM4JlsAM
.

@trummelbummel
Copy link

Ah thank you! I didn't see that.

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