blob: d804ae6fa6a0f2615ae42730c3b74ac70461aad8 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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)
|