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

Method fromPlot

ij/src/main/java/ij/macro/Functions.java:2729–2756  ·  view source on GitHub ↗

Plot.useTemplate with 't', Plot.addFromPlot with 'a'

(Plot plot, char type)

Source from the content-addressed store, hash-verified

2727
2728 /** Plot.useTemplate with 't', Plot.addFromPlot with 'a' */
2729 double fromPlot(Plot plot, char type) {
2730 ImagePlus sourceImp = null;
2731 interp.getLeftParen();
2732 if (isStringArg()) {
2733 String title = getString();
2734 sourceImp = WindowManager.getImage(title);
2735 if (sourceImp==null)
2736 interp.error("Image \""+title+"\" not found");
2737 } else {
2738 int id = (int)interp.getExpression();
2739 sourceImp = WindowManager.getImage(id);
2740 if (sourceImp==null)
2741 interp.error("Image ID="+id+" not found");
2742 }
2743 Plot sourcePlot = (Plot)(sourceImp.getProperty(Plot.PROPERTY_KEY));
2744 if (sourcePlot==null)
2745 interp.error("No plot: "+sourceImp.getTitle());
2746 if (type == 'a') {
2747 int objectIndex = (int)getNextArg();
2748 if (objectIndex < 0 || objectIndex > plot.getNumPlotObjects())
2749 interp.error("Plot "+sourceImp.getTitle()+" has "+plot.getNumPlotObjects()+"items, no number "+objectIndex);
2750 plot.addObjectFromPlot(sourcePlot, objectIndex);
2751 plot.updateImage();
2752 } else
2753 plot.useTemplate(sourcePlot);
2754 interp.getRightParen();
2755 return Double.NaN;
2756 }
2757
2758 double addPlotLegend(Plot plot) {
2759 String labels = getFirstString();

Callers 1

doPlotMethod · 0.95

Calls 14

isStringArgMethod · 0.95
getStringMethod · 0.95
getImageMethod · 0.95
getPropertyMethod · 0.95
getTitleMethod · 0.95
getNextArgMethod · 0.95
getLeftParenMethod · 0.80
getExpressionMethod · 0.80
getNumPlotObjectsMethod · 0.80
useTemplateMethod · 0.80
getRightParenMethod · 0.80
errorMethod · 0.45

Tested by

no test coverage detected