diff options
Diffstat (limited to 'doc/plotmatrix.md')
-rw-r--r-- | doc/plotmatrix.md | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/doc/plotmatrix.md b/doc/plotmatrix.md new file mode 100644 index 0000000..d804ae6 --- /dev/null +++ b/doc/plotmatrix.md @@ -0,0 +1,20 @@ +<a name="gnuplot.image.dok"></a> +## Plotting Matrices ## + +A given matrix can be plotted using 2D contour plot on a surface. + +<a name="gnuplot.imagesc"></a> +### gnuplot.imagesc(z, ['color' or 'gray']) ### + +Plot surface ` z ` using contour plot. The second argument defines +the color palette for the display. By default, grayscale colors are +used, however, one can also use any color palette available in +`Gnuplot`. + +```lua +x = torch.linspace(-1,1) +xx = torch.Tensor(x:size(1),x:size(1)):zero():addr(1,x,x) +xx = xx*math.pi*6 +gnuplot.imagesc(torch.sin(xx),'color') +``` +![](plot_imagesc.png) |