Note that there are some explanatory texts on larger screens.

plurals
  1. POImage from Mathematica to Java
    primarykey
    data
    text
    <p>i try to get an Image out of Mathematica. I try to evaluate some Mathematica Code that uses Methods in Packages to generate Graphics. If i paste the Code to a Mathematica Notebook the Graphic is generated correctly.</p> <p>So my Question:</p> <p>How do I get this graphics to Java ???</p> <p>Here is my Sample Code: </p> <pre><code>ml = MathLinkFactory.createKernelLink("-linkmode launch -linkname 'F:\\APPS\\Wolfram Research\\Mathematica\\7.0\\mathkernel.exe'"); ml.addPacketListener(new MyPacketListener()); ml.discardAnswer(); PacketListener stdoutPrinter = new PacketPrinter(System.out); ml.addPacketListener(stdoutPrinter); // In stringList there is all the INPUT for Mathematica for (int i = 0; stringList.size() &gt; i; i++) { System.out.println("Input" + "[" + i + "]" + stringList.get(i)); ml.evaluate(stringList.get(i)); ml.discardAnswer(); } ml.close(); class MyPacketListener implements PacketListener { public boolean packetArrived(PacketArrivedEvent evt) throws MathLinkException { if (evt.getPktType() == MathLink.TEXTPKT) { KernelLink ml = (KernelLink) evt.getSource(); System.out.println(ml.getString()); } return true; } </code></pre> <p>The Output is: </p> <pre><code>&lt;&lt;CIP`ExperimentalData` &lt;&lt;CIP`MLR` dataSet = CIP`ExperimentalData`GetQSPRDataSet02[]; CIP`Graphics`ShowDataSetInfo[{"IoPairs", "InputComponents", "OutputComponents"}, dataSet]; Number of IO pairs = 2169 Number of input components = 130 Number of output components = 1 mlrInfo = CIP`MLR`FitMlr[dataSet]; mlrInfoInInputForm = InputForm[mlrInfo]; pointSize = 0.025; CIP`MLR`ShowMlrSingleRegression[{"ModelVsDataPlot", "CorrelationCoefficient"}, dataSet, mlrInfo, GraphicsOptionPointSize -&gt; pointSize]; (*-Graphics-*) (* Out 1 : Correlation coefficient = 0.999373 *) pointSize = 0.01; CIP`MLR`ShowMlrSingleRegression[{"AbsoluteSortedResidualsPlot", "AbsoluteResidualsStatistics", "RMSE"}, dataSet, mlrInfo, GraphicsOptionPointSize -&gt; pointSize]; (*-Graphics- Definition of 'Residual (absolute)': Data - Model -1 Out 1 : Residual (absolute): Mean/Median/Maximum Value = 1.4 / 9.84 × 10 / 1 &gt; 1.79 × 10 Root mean squared error (RMSE) = 2.063 *) </code></pre> <p>How do I get these -Graphics- ?</p> <p>Thanks for the Help!</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload