controlling limits on Plot

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

controlling limits on Plot

Kenneth Sloan-2
I'm having difficulty controlling the min/max x/y bounds of a Plot  (in a Java plugin).

My code looks like this:
 

        double plotMinX  = -3.5;
        double plotMaxX  =  3.5;
        double plotMinY  =  0.0;
        double plotMaxY  =  1.0;
        String rawDataShape = "circles";
        plot.add(rawDataShape,xValues,yValues);
        plot.setLimits(plotMinX, plotMaxX, plotMinX, plotMaxX);
        PlotWindow pw = plot.show();

and the Plot looks like this:



Now - I can use the manual controls to make it look like I want: (approimately)



But...I really, really, really want it to look that way without requiring the user
to manipulate the controls.

What am I doing wrong?



--
Kenneth Sloan
[hidden email]
Vision is the art of seeing what is invisible to others.






--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html

Screen Shot 2018-03-15 at 23.34.53 .png (86K) Download Attachment
Screen Shot 2018-03-15 at 23.36.52 .png (106K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: controlling limits on Plot

Michael Schmid
On 16/03/2018 05:39, Kenneth Sloan wrote:

I'm having difficulty controlling the min/max x/y bounds of a Plot  (in
a Java plugin).

My code looks like this:

        double plotMinX  = -3.5;
        double plotMaxX  =  3.5;
        double plotMinY  =  0.0;
         double plotMaxY  =  1.0;
         String rawDataShape =3D "circles";
         plot.add(rawDataShape,xValues,yValues);
         plot.setLimits(plotMinX, plotMaxX, plotMinX, plotMaxX);
         PlotWindow pw =3D plot.show();

________________________________________________________________

Hi Kenneth,

seems you rather want
         plot.setLimits(plotMinX, plotMaxX, plotMinY, plotMaxY);

(mind the difference between x & y)


Michael

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: controlling limits on Plot

Kenneth Sloan-2
Oops! Facepalm.

Many thanks.
On Fri, Mar 16, 2018 at 04:43 Michael Schmid <[hidden email]>
wrote:

> On 16/03/2018 05:39, Kenneth Sloan wrote:
>
> I'm having difficulty controlling the min/max x/y bounds of a Plot  (in
> a Java plugin).
>
> My code looks like this:
>
>         double plotMinX  = -3.5;
>         double plotMaxX  =  3.5;
>         double plotMinY  =  0.0;
>          double plotMaxY  =  1.0;
>          String rawDataShape =3D "circles";
>          plot.add(rawDataShape,xValues,yValues);
>          plot.setLimits(plotMinX, plotMaxX, plotMinX, plotMaxX);
>          PlotWindow pw =3D plot.show();
>
> ________________________________________________________________
>
> Hi Kenneth,
>
> seems you rather want
>          plot.setLimits(plotMinX, plotMaxX, plotMinY, plotMaxY);
>
> (mind the difference between x & y)
>
>
> Michael
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html