Re: JLINK and Outputting a Plot
- To: mathgroup at smc.vnet.net
- Subject: [mg36609] Re: [mg36596] JLINK and Outputting a Plot
- From: Todd Gayley <tgayley at wolfram.com>
- Date: Fri, 13 Sep 2002 23:33:07 -0400 (EDT)
- Sender: owner-wri-mathgroup at wolfram.com
At 12:14 AM 9/13/02, Blimbaum Jerry DLPC wrote:
>I have written the following in a JLink program:
>
>
>drawArea=JavaNew["com.wolfram.jlink.MathCanvas"];
>
>then I perform an analysis of some data with output of this form....
>
>plot = DisplayTogether[ListPlot[],ListPlot[].etc...];
>
>
>Unfortunately, at this point I dont know how to associate 'plot' with
>drawArea so that
>
>draw.Area@RepaintNow[]; repaints the math screen to show the plots I've
>computed...
>
>
>I've tried draw.Area@update[plot] and draw.Area@setImage[plot] but these
>dont work........how to fix?.........thanks.....
Jerry,
You use the MathCanvas.setMathCommand() method to specify the Mathematica
command that is used to generate the image to display:
drawArea.setMathCommand("plot");
You will find a very simple example of this in section 1.2.8.2 of the
J/Link User Guide (in the Help Browser hierarchy, this is found at
JLink/Part 1. Installable Java/Drawing and Displaying Images in Java
Windows/Showing Graphics and Typeset Expressions).
You do not need to use the repaintNow() method unless you are updating the
image continuously in response to a user action, like dragging a slider.
Todd Gayley
Wolfram Research