Xfig plot image (xfig example): Difference between revisions
Jump to navigation
Jump to search
m Niu moved page Isis:slxfig:2d map saa to Example: xfig plot image |
No edit summary |
||
| Line 1: | Line 1: | ||
=== xfig plot image 'xfig_plot_image' === | |||
[[File:plotimage1.png]] | |||
<pre> | |||
% Example 1: logscale | |||
variable x = [PI:10*PI:#100]; | |||
variable y = [PI:5*PI:#80]; | |||
variable IMG = sin(x) # transpose(cos(y)); | |||
variable xf = xfig_plot_image( IMG, x*180/PI, y*180/PI; | |||
padx=0.025, pady=0.025, | |||
dx=-.5, | |||
xlog, ylog, | |||
fill=20 | |||
); | |||
xf.render("/tmp/test.pdf"); | |||
</pre> | |||
[[File:plotimage2.png]] | |||
<pre> | |||
% Example 2: image of Example 1 but with gaps | |||
variable tmp = [[1:30],[35:65],[75:115]]; | |||
variable x = struct{ lo = tmp/11.5*PI, hi = (tmp+1)/11.5*PI }; | |||
tmp = [[1:40],[50:90]]; | |||
variable y = struct{ lo = tmp/18.*PI, hi = (tmp+1)/18.*PI }; | |||
variable IMG = sin(x.lo) # transpose(cos(y.lo)); | |||
variable xf = xfig_plot_image( IMG, x, y ; cmap="drywet"); | |||
xf.render("/tmp/test.pdf"); | |||
</pre> | |||
[[Category:SLxfig]] | [[Category:SLxfig]] | ||
Revision as of 16:47, 13 April 2018
xfig plot image 'xfig_plot_image'
% Example 1: logscale
variable x = [PI:10*PI:#100];
variable y = [PI:5*PI:#80];
variable IMG = sin(x) # transpose(cos(y));
variable xf = xfig_plot_image( IMG, x*180/PI, y*180/PI;
padx=0.025, pady=0.025,
dx=-.5,
xlog, ylog,
fill=20
);
xf.render("/tmp/test.pdf");
% Example 2: image of Example 1 but with gaps
variable tmp = [[1:30],[35:65],[75:115]];
variable x = struct{ lo = tmp/11.5*PI, hi = (tmp+1)/11.5*PI };
tmp = [[1:40],[50:90]];
variable y = struct{ lo = tmp/18.*PI, hi = (tmp+1)/18.*PI };
variable IMG = sin(x.lo) # transpose(cos(y.lo));
variable xf = xfig_plot_image( IMG, x, y ; cmap="drywet");
xf.render("/tmp/test.pdf");

