Login  Register

Re: Plot.setJustification() problems....

Posted by Justin McGrath on Aug 16, 2007; 10:25pm
URL: http://imagej.273.s1.nabble.com/Plot-setJustification-problems-tp3698602p3698605.html

I think the "Simple Plot" macro here
http://rsb.info.nih.gov/ij/macros/ExamplePlots.txt will explain.
Center, left and right justified changes where the text is placed in
relation to the x coordinate in the addText function.  If you want the
text in the figure area, change the Y coordindate in the addText
function.

Justin

On 8/16/07, Rotella, Anthony M. (GRC)[] <[hidden email]> wrote:

> Hello all,
>
>         I have been working on plotting some data within my ImageJ
> macro, and I am having some problems. My code is:
>
> Plot.create("Total and Void Area vs. Slice Number", "Slice", "Void
> Area", aVoids);
> Plot.setColor("green");
> Plot.setLimits(1, aVoids.length, 0, 25000);
> Plot.add("line", aTot);
> Plot.setColor("orange");
> Plot.setJustification("right");
> Plot.addText("Total Area: Orange  Void Area: Green", 0, 0);
> Plot.show();
>
> One problem I am having is that the colors that my key says, are
> actually opposite of what it says. This may just be some problem with
> the order or my statements or something like this. The other problem I
> am having is that when I add in Plot.setJustification("center"), it
> actually moves my text left! It cuts it of to read something like, "otal
> Area: ....." and if I type Plot.setJustification("right"), it cuts off
> more! It reads "rea: Green". I am sure I am making some silly mistake.
> Does it center it about (0, 0)? Is there an elegant way to get the text
> somewhere into the body of the graph, or do I just have to do something
> like "                              \n\n\n Blah..." to get it there?
> Thanks a lot!
>
> Tony Rotella
>