![](/profiles/wavemetrics/themes/wavemetrics/logo.png)
ModifyImage error
![](/sites/default/files/styles/thumbnail/public/default_images/Artboard%201_1.png?itok=jeHOCIXy)
J-E Petit
When plotting a new image from a user defined function, I get a ModifyImage error, saying "expected the name of an image in the top graph".
here is the function:
Function RectangularPlot(MxToPlot,PlotName) wave MxToPlot string PlotName SetDataFolder root:NWR:graph_variables:rectangle wave angle_ticklocator,angle_ticklabel NVar Radial_res=root:NWR:variables:Radial_res Display/N=NWRgraph as PlotName;AppendImage MxToPlot ModifyGraph/W=NWRgraph userticks(bottom)={angle_ticklocator,angle_ticklabel} ModifyImage/W=NWRgraph MxToPlot ctab= {*,*,Rainbow,1} ModifyGraph/W=NWRgraph axisEnab(bottom)={0,0.9} ModifyGraph/W=NWRgraph fStyle(bottom)=1,fSize(bottom)=14,fStyle(left)=1,fSize(left)=14 //ColorScale/W=NWR_graph/C/N=cb_NWR/F=0/A=RC/X=-9.61/Y=0.51 heightPct=110,image=MxToPlot //ColorScale/W=NWR_graph/C/N=cb_NWR "concentration" SetScale/P y 0,Radial_res,"Wind speed (km/h)", MxToPlot End Function
I don't get any errors if I do it all manually, so I'm probably missing something....
thanks for your help!
I think it's because ModifyImage expects a name of a wave but you are providing a wave reference. I know two ways around it, maybe there are others:
April 10, 2015 at 03:52 am - Permalink
April 10, 2015 at 05:33 am - Permalink
That's not quite right.
You can use a wave reference wherever Igor expects a wave name. However ModifyImage does not expect a wave name - it expects an image name. To understand the difference, execute this:
This creates a graph with two images, mat and mat#1. mat is equivalent to mat#0.
This is analogous to the difference between wave names and trace names, which is explained here:
April 10, 2015 at 07:12 pm - Permalink
Thanks for clarifying!
April 11, 2015 at 02:43 am - Permalink