Pergunta

I'm using WebFigures in Matlab, and I have a simple function in matlab

function df = getFig

  f = openfig('C:\test1.fig');

  figure('Visible','Off')

  df = webfigure(f);
  close(f);
end

I'm calling this function from my java servlet. However this just sits for a while then I get this error:

{_Error using figure

UIJ_AreThereWindowShowsPending - timeout waiting for window to show up

Error in openfig (line 135)

Error in getFig (line 3)
}_ 

I have tried call the same function, except with a generated on the fly figure, like using plot or knot, and both work fine.

Also as a related question, is it possible to pass in a reference to a file to this function from java? like through a inputstream object? This is because the files I need to retrieve are actually retrieved from a URL.

Any ideas?

Foi útil?

Solução

I'm not sure exactly what the problem is, but one issue might be that the command figure('Visible','off') is not modifying your figure f, but rather creating a new, separate figure that is invisible.

I'm also not sure why you want the figure to be invisible (I think this may be the real issue of why it's not showing up within the Java servlet).

If you need it to be invisible you could try

openfig('filename.fig','new','invisible')

or, since openfig is really intended for GUIs rather than figures containing just graphics, use hgload instead, and then set the visibility directly.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top