Mercurial > hg > octave-terminal
changeset 7161:cfa0602094e9
[project @ 2007-11-12 19:51:56 by jwe]
author | jwe |
---|---|
date | Mon, 12 Nov 2007 19:51:56 +0000 |
parents | db85cf23875e |
children | f2ba4aa9a5f9 |
files | scripts/ChangeLog scripts/plot/__go_draw_axes__.m |
diffstat | 2 files changed, 17 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/scripts/ChangeLog +++ b/scripts/ChangeLog @@ -1,3 +1,8 @@ +2007-11-12 David Bateman <dbateman@free.fr> + + * plot/__go_draw_axes.m: Allow arbitrary colormaps with gnuplot + 4.0 and surface plots. + 2007-11-12 Michael Goffioul <michael.goffioul@gmail.com> * plot/__patch__.m: Fix computation of faces when patch is defined
--- a/scripts/plot/__go_draw_axes__.m +++ b/scripts/plot/__go_draw_axes__.m @@ -765,7 +765,18 @@ fwrite (plot_stream, palette_data, "float32"); endif else - fputs (plot_stream, "set palette defined (0 \"dark-blue\", 1 \"blue\", 2 \"cyan\", 3 \"yellow\", 4 \"red\" , 5 \"dark-red\");\n"); + fputs (plot_stream, "set palette defined ("); + for i = 1: columns(palette_data) + col = floor(palette_data(2:end,i).' * 255); + if (i == 1) + fputs (plot_stream, sprintf("%d \"#%02X%02X%02X\"", i - 1, + col(1), col(2), col(3))); + else + fputs (plot_stream, sprintf(", %d \"#%02X%02X%02X\"", i - 1, + col(1), col(2), col(3))); + endif + endfor + fputs (plot_stream, ");\n"); endif fputs (plot_stream, "unset colorbox;\n"); endif