Login  Register

Re: Plot.getProcessor() vs. profile plot preferences

Posted by Michael Schmid on Oct 09, 2013; 8:46am
URL: http://imagej.273.s1.nabble.com/Plot-getProcessor-vs-profile-plot-preferences-tp5005082p5005090.html

Hi Pål,

the width and height in plot options refer to the area actually used for the plot, not to the full image.
Additional space is needed for the axis labels etc outside the plot area.

Michael
________________________________________________________________
On Oct 8, 2013, at 12:58, Pål Baggethun wrote:

> Plot.getprocessor() returns an ImageProcessor that has different dimensions from those defined in the profile plot preferences pp.with and pp.height. Is this intentional?
>
> The test plugin below writes the following to my log:
>
> Plot ImageProcessor:
>    getWith()=478
>    getHeight()=455
> Plot Options:
>    pp.width=400
>    pp.height=400
>
> Sincerely,
> Pål Baggethun
> Research Engineer
> Elkem Technology
>
> TEST PLUGIN:
>
> import ij.*;
> import ij.process.*;
> import ij.gui.*;
> import ij.plugin.*;
> import ij.plugin.frame.*;
>
> public class Test_Plot_PixelSize implements PlugIn {
>
>                public void run(String arg) {
>
>                                float[] Xval = new float[1];
>                                float[] Yval = new float[1];
>
>                                Plot p = new Plot( "Test Plot PixelSize", "X", "Y", Xval, Yval);
>                                ImageProcessor ip = p.getProcessor();
>
>                                IJ.log(
>                                                "\nPlot ImageProcessor:\n    getWith()="+ip.getWidth()+
>                                                "\n    getHeight()="+ip.getHeight()+
>                                                "\n \nPlot Options:\n    pp.width="+Prefs.getInt("pp.width",1)+
>                                                "\n    pp.height="+Prefs.getInt("pp.height",1)
>                                );
>
>                }
>
> }
>
> MY JAVA PROPERTIES:
>
>  java.version: 1.7.0_40
>  java.vendor: Oracle Corporation
>  os.name: Windows 7
>  os.version: 6.1
>  os.arch: amd64
>  file.separator: \
>  path.separator: ;
>  line.separator: <cr><lf>
> NOTICE: Please immediately e-mail back to sender if you are not the intended recipient. Thereafter delete the e-mail along with any attachments without making copies. The sender reserves all rights of privilege, confidentiality and copyright.
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html

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