MCPcopy Create free account
hub / github.com/AstroImageJ/astroimagej / getPlot

Method getPlot

ij/src/main/java/ij/gui/ProfilePlot.java:123–143  ·  view source on GitHub ↗

Returns the profile plot as a Plot object.

()

Source from the content-addressed store, hash-verified

121
122 /** Returns the profile plot as a Plot object. */
123 public Plot getPlot() {
124 if (profile==null)
125 return null;
126 String xLabel = "Distance ("+units+")";
127 int n = profile.length;
128 if (xValues==null) {
129 xValues = new float[n];
130 for (int i=0; i<n; i++)
131 xValues[i] = (float)(i*xInc);
132 }
133 float[] yValues = new float[n];
134 for (int i=0; i<n; i++)
135 yValues[i] = (float)profile[i];
136 boolean fixedYScale = fixedMin!=0.0 || fixedMax!=0.0;
137 Plot plot = new Plot("Plot of "+getShortTitle(imp), xLabel, yLabel, xValues, yValues);
138 if (fixedYScale) {
139 double[] a = Tools.getMinMax(xValues);
140 plot.setLimits(a[0],a[1],fixedMin,fixedMax);
141 }
142 return plot;
143 }
144
145 String getShortTitle(ImagePlus imp) {
146 String title = imp.getTitle();

Callers 2

getPlotMethod · 0.95
createWindowMethod · 0.95

Calls 3

getShortTitleMethod · 0.95
getMinMaxMethod · 0.95
setLimitsMethod · 0.95

Tested by

no test coverage detected