diff options
author | Norbert Preining <norbert@preining.info> | 2019-09-02 13:46:59 +0900 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2019-09-02 13:46:59 +0900 |
commit | e0c6872cf40896c7be36b11dcc744620f10adf1d (patch) | |
tree | 60335e10d2f4354b0674ec22d7b53f0f8abee672 /graphics/asymptote/doc/image.asy |
Initial commit
Diffstat (limited to 'graphics/asymptote/doc/image.asy')
-rw-r--r-- | graphics/asymptote/doc/image.asy | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/graphics/asymptote/doc/image.asy b/graphics/asymptote/doc/image.asy new file mode 100644 index 0000000000..37a2cf6017 --- /dev/null +++ b/graphics/asymptote/doc/image.asy @@ -0,0 +1,21 @@ +size(12cm,12cm); + +import graph; +import palette; + +int n=256; +real ninv=2pi/n; +real[][] v=new real[n][n]; + +for(int i=0; i < n; ++i) + for(int j=0; j < n; ++j) + v[i][j]=sin(i*ninv)*cos(j*ninv); + +pen[] Palette=BWRainbow(); + +picture bar; + +bounds range=image(v,(0,0),(1,1),Palette); +palette(bar,"$A$",range,(0,0),(0.5cm,8cm),Right,Palette, + PaletteTicks("$%+#.1f$")); +add(bar.fit(),point(E),30E); |