# HG changeset patch # User jwe # Date 1194897116 0 # Node ID cfa0602094e9c67d412d74f6404f9bda95fb4a5d # Parent db85cf23875e79df79348e14f4e38163f95c8196 [project @ 2007-11-12 19:51:56 by jwe] diff --git a/scripts/ChangeLog b/scripts/ChangeLog --- a/scripts/ChangeLog +++ b/scripts/ChangeLog @@ -1,3 +1,8 @@ +2007-11-12 David Bateman + + * plot/__go_draw_axes.m: Allow arbitrary colormaps with gnuplot + 4.0 and surface plots. + 2007-11-12 Michael Goffioul * plot/__patch__.m: Fix computation of faces when patch is defined diff --git a/scripts/plot/__go_draw_axes__.m b/scripts/plot/__go_draw_axes__.m --- 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