torch / gnuplot

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

single colorbox legend in imagesc multiplot

thelinuxmaniac opened this issue · comments

Hi all,
I wish to create a imagesc multiplot with a common colorbox legend for all subplots. I know how to include a multiplot with colorbox for each subplot (as shown in the image below and the corresponding lua code attached below).
imagesc_multiplot

I would like to have a single colorbox legend with range [-1,+1] and the color of x1 and x2 updated according to this common colorbox legend. Any advice would be greatly appreciated.

require 'gnuplot'

x1 = torch.rand(100,100)
x2 = torch.rand(100,100)*2
x2:add(-1)

gnuplot.raw('unset xtics')
gnuplot.raw('unset ytics')
gnuplot.raw("set multiplot layout 1,2")

-- first subplot
gnuplot.raw("set title 'x1'")
gnuplot.imagesc(x1, 'color')

-- second subplot
gnuplot.raw("set title 'x2'")
gnuplot.imagesc(x2, 'color')

gnuplot.raw('unset multiplot')