Difference between revisions of "Xfig plot image (xfig example)"
Jump to navigation
Jump to search
(Replaced content with " Category:SLxfig to be deleted, wrong Linkname") |
m (Obst moved page Example: Xfig plot image to Xfig plot image (xfig example) without leaving a redirect) |
||
(3 intermediate revisions by one other user not shown) | |||
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]] | ||
− |
Latest revision as of 11:26, 17 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");