LabVIEW MathScript RT Module

cancel
Showing results for 
Search instead for 
Did you mean: 

Mathscript contourf function produces strange results

the code "contourf(magic(8))" typed into the mathscripts window produces a different result from the same single line in matlab.  The resolution and colormap differences don't bother me, but the line fragments are clearly incorrect.  This is a simple example of a problem I'm having in my data.  Further, if I'd like to plot the contour line myself, the "hold on" function does not seem to work with the contour.  Any help would be much appreciated.  A simple example demonstrating both problems:

 

clf
colormap(jet)
contourf(magic(8));
hold on
plot(1:8,1:8,'r*')
shg

 

piyrwq

Download All
0 Kudos
Message 1 of 3
(6,597 Views)
Hello,

Unfortunately, it looks like you have discovered some bugs in MathScript.  I have filed bug reports for the unsupported contour map (i.e. jet), the line fragment issue, and the contour plot not recognizing the hold function.  I don't know of any workarounds to these problems, but we will evaluate fixing them in a future version.

Grant M.
Staff Software Engineer | LabVIEW Math & Signal Processing | National Instruments
0 Kudos
Message 2 of 3
(6,584 Views)
Hello,

I have looked into this issue some more.  I talked to the developer who wrote the colormap function and it turns out we do have all the colormaps.  However, their use is not documented.  They are passed to the function as an option, e.g. colormap('jet').

In addition, the order of calls matters.  The colormap only applies to the current plot.  If you generate a new one, the colormap disappears.  Consequently, reverse the order of your colormap and contourf calls as follows:
contourf(magic(8));
colormap('jet')


Grant M.
Staff Software Engineer | LabVIEW Math & Signal Processing | National Instruments
0 Kudos
Message 3 of 3
(6,565 Views)