diff scripts/plot/colorbar.m @ 9281:02b16eeb3167

Fix yticklabels for log scale colorbar.
author Ben Abbott <bpabbott@mac.com>
date Thu, 28 May 2009 06:21:01 -0400
parents de255681c85f
children 0d9f925b9705
line wrap: on
line diff
--- a/scripts/plot/colorbar.m
+++ b/scripts/plot/colorbar.m
@@ -382,6 +382,11 @@
 
 %!demo
 %! clf
+%! contour(peaks())
+%! colorbar("west");
+
+%!demo
+%! clf
 %! subplot(2,2,1)
 %! contour(peaks())
 %! colorbar("east");
@@ -532,3 +537,16 @@
 %! colorbar ();
 %! colorbar ();
 
+%!demo
+%! clf
+%! imagesc (1./hilb(99));
+%! h = colorbar;
+%! set (h, 'yscale', 'log');
+
+%!demo
+%! clf
+%! imagesc (log10 (1 ./ hilb (99)));
+%! h = colorbar;
+%! ytick = get(h, "ytick");
+%! set (h, "yticklabel", sprintf ('10^{%g}|', ytick));
+