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

Method scaleXtoPxl

ij/src/main/java/ij/gui/Plot.java:1965–1974  ·  view source on GitHub ↗

Converts calibrated coordinates to pixel coordinates. In contrast to the image calibration, also works with log x axis and inverted x axis

(double x)

Source from the content-addressed store, hash-verified

1963 /** Converts calibrated coordinates to pixel coordinates. In contrast to the image calibration, also
1964 * works with log x axis and inverted x axis */
1965 public double scaleXtoPxl(double x) {
1966 if (xMin == xMax) {
1967 if (x==xMin) return xBasePxl;
1968 else return x>xMin ? Double.POSITIVE_INFINITY : Double.NEGATIVE_INFINITY;
1969 }
1970 if (logXAxis)
1971 return xBasePxl+(Math.log10(x)-xMin)*xScale;
1972 else
1973 return xBasePxl+(x-xMin)*xScale;
1974 }
1975
1976 /** Converts calibrated coordinates to pixel coordinates. In contrast to the image calibration, also
1977 * works with log y axis */

Callers 10

toUnscaledMethod · 0.95
scaleXMethod · 0.95
zoomMethod · 0.95
getCoordinatesMethod · 0.95
drawPlotObjectMethod · 0.80
drawBarChartMethod · 0.80
countPlotPointsInRectMethod · 0.80
drawVerticalErrorBarsMethod · 0.80
drawFloatPolylineMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected