<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">On 23/07/2013 12:59, Larissa Schultze
wrote:<br>
</div>
<blockquote
cite="mid:trinity-6653d91c-602c-4fb2-b527-4ac7ab87d027-1374577155924@3capp-gmx-bs05"
type="cite">
<pre wrap="">Hello Samuel and to all,
thank you, Samuel, for the hint!
I have now an idea on how to proceed using this cdata_mapping. The problem is:
when I use this command, error 144 ("Undefined operation for the given
operands.") appears. What am I doing wrong this time? Man, It can be pretty
annoying... :/</pre>
</blockquote>
Well the error here is that you have 'e=gce' instead of 'e=gce()': e
is now a function pointer (that is its a new name for function gce)
and it is not the return value from the function gce();<br>
<br>
To go back to your problem, I can give you several solutions and
here is my favorite one: use 'contourf'.<br>
Here is a sample script:<br>
<br>
/////////////////////////////<br>
data=[ %nan 0. 20. 60. 100. 140. 180.
200.;..<br>
0. %nan 0. %nan %nan %nan %nan
%nan;..<br>
5. %nan 68. 73. 61. 63. 67. %nan;..<br>
40. %nan 17. 9. 10. 12. 17. %nan;..<br>
75. %nan 14. 7. 6. 6. 12. %nan;..<br>
110. %nan 15. 6. 4. 6. 21. %nan;..<br>
145. %nan 21. 28. 26. 20. 34. %nan;..<br>
150. %nan %nan %nan %nan %nan %nan
%nan];<br>
<br>
x=data(1,2:8);<br>
y=data(2:8,1);<br>
z=data(2:8,2:8);<br>
xx = linspace(0,200,200);<br>
yy = linspace(0,150,200);<br>
[xp,yp] = ndgrid(xx,yy);<br>
zp = linear_interpn(xp,yp, x, y, z);<br>
h=scf(0);<br>
clf(0)<br>
<br>
//these values are common to all your plots<br>
allzmin=-5;//or 6 if you want<br>
allzmax=130;// or 1300 if you want<br>
ncolors=128;//number of colorsteps<br>
<br>
contourf(xx,yy,zp,linspace(allzmin,allzmax,ncolors));<br>
a=gca();<br>
a.data_bounds=[min(x),min(y);max(x),max(y)];<br>
a.zoom_box=[min(x),min(y),max(x),max(y)];<br>
h.color_map=jetcolormap(ncolors);<br>
colorbar(allzmin,allzmax);<br>
/////////////////////////////<br>
<br>
Alternatively, you can use Sgrayplot with a colormap as large as the
span of values of z across all the plots and for each plot use only
a subset of the colormap:<br>
<br>
///////////////////////////////////////<br>
ncolors=1300;<br>
h=scf();<br>
h.color_map=jetcolormap(ncolors);<br>
Sgrayplot(xx,yy,zp);<br>
e=gce();<br>
e.children.color_range=[min(zp),max(zp)];<br>
colorbar(1,1300);<br>
////////////////////////////////////<br>
<br>
Hope it helps,<br>
<br>
Antoine<br>
<br>
<blockquote
cite="mid:trinity-6653d91c-602c-4fb2-b527-4ac7ab87d027-1374577155924@3capp-gmx-bs05"
type="cite">
<pre wrap="">
At surface_properties it says that the cdata_mapping command ist specific to
fac3d handles. But this fac3d is obsolete. So I tried to plot my graph with the
plot3d, plot3d1 and surf to see if any of this works, but no, they don't ...i
keep getting this error mesage 144.
Here are again the commands I am using:
[fd,SST,Sheetnames,Sheetpos] = xls_open('E:\LI_messungen_alle.xls');
Sheets = readxls('E:\LI_messungen_alle.xls');
typeof(Sheets);
s1=Sheets(1);
data=s1.value;
x=data(1,2:8);
y=data(2:8,1);
z=data(2:8,2:8);
xx = linspace(0,200,200);
yy = linspace(0,150,200);
[xp,yp] = ndgrid(xx,yy);
zp = linear_interpn(xp,yp, x, y, z);
clf()
surf(xx,yy,zp)
e=gce
e.cdata_mapping='direct'
e.color_map=jetcolormap(512);
e.color_flag=2;
e.data.color=[1+modulo(1:1300,512),1+modulo(1:1300,512)];
h.color_flag=3;
colorbar(1,1300)
And this is, again, my table:
Nan 0. 20. 60. 100. 140. 180. 200.
0. Nan 0. Nan Nan Nan Nan Nan
5. Nan 68. 73. 61. 63. 67. Nan
40. Nan 17. 9. 10. 12. 17. Nan
75. Nan 14. 7. 6. 6. 12. Nan
110. Nan 15. 6. 4. 6. 21. Nan
145. Nan 21. 28. 26. 20. 34. Nan
150. Nan Nan Nan Nan Nan Nan Nan
Do you have any idea of what is wrong?
Thank you again,
Larissa
*Gesendet:* Dienstag, 23. Juli 2013 um 03:37 Uhr
*Von:* "Samuel Gougeon" <a class="moz-txt-link-rfc2396E" href="mailto:sgougeon@free.fr"><sgougeon@free.fr></a>
*An:* "International users mailing list for Scilab." <a class="moz-txt-link-rfc2396E" href="mailto:users@lists.scilab.org"><users@lists.scilab.org></a>
*Betreff:* Re: [Scilab-users] Colorbar_same color code, different graphs
Hello Larissa,
After surf(..), you may do
e = gce();
e.cdata_mapping = 'direct';
// and have a look at
help "surface properties"
HTH
Samuel
_______________________________________________
users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:users@lists.scilab.org">users@lists.scilab.org</a>
<a class="moz-txt-link-freetext" href="http://lists.scilab.org/mailman/listinfo/users">http://lists.scilab.org/mailman/listinfo/users</a>
</pre>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:users@lists.scilab.org">users@lists.scilab.org</a>
<a class="moz-txt-link-freetext" href="http://lists.scilab.org/mailman/listinfo/users">http://lists.scilab.org/mailman/listinfo/users</a>
</pre>
</blockquote>
<br>
<br>
</body>
</html>