Error plotting heatmap

I am trying to plot heat map with 12 rows and 1 column matrix. I used the following commands:

gmt xyz2grd Try1.txt -Gtmp1.grd -I1 -R0/0/12/1
gmt grdimage tmp1.grd -R0/0/12/1 -CColor.cpt -JX10c/10c -Q -O >>

The file is created but it shows error while opening file:
Error: /undefined in A
Operand stack:
Execution stack:
%interp_exit .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push --nostringval-- --nostringval-- --nostringval-- false 1 %stopped_push 1977 1 3 %oparray_pop 1976 1 3 %oparray_pop 1960 1 3 %oparray_pop 1852 1 3 %oparray_pop --nostringval-- %errorexec_pop .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push --nostringval–
DictionarGPL Ghostscript 9.18: Unrecoverable error, exit code 1
y stack:
–dict:1198/1684(ro)(G)-- --dict:0/20(G)-- --dict:78/200(L)–
Current allocation mode is local
Current file position is 4

Are you appending the grdimage output to some earlier part of the plot with -O? -O means add another layer. If there is nothing before then no -O. But you are appending (>>) so unclear what you are doing, but sounds like there is no PostSCript header from a previous call.

Even after removing -O, the error still remains the same.

Maybe the problem is with -R.
The correct syntax is: -R xmin / xmax / ymin / ymax
So, you should try with -R0/12/0/1.

If you still have >> then you are screwed no matter what since you keep appending to the same file.