comparison scripts/plot/colorbar.m @ 9297:0d9f925b9705

colorbar.m: Colorbar 'handlevisibility' should be 'on'. Add additional demos which illustrate problems with the present implementation.
author Ben Abbott <bpabbott@mac.com>
date Wed, 03 Jun 2009 10:54:36 -0400
parents 02b16eeb3167
children 2884758e265b
comparison
equal deleted inserted replaced
9296:b41a7b2bd6fc 9297:0d9f925b9705
111 [pos, cpos, vertical, mirror, aspect] = ... 111 [pos, cpos, vertical, mirror, aspect] = ...
112 __position_colorbox__ (loc, obj, ancestor (ax, "figure")); 112 __position_colorbox__ (loc, obj, ancestor (ax, "figure"));
113 set (ax, "activepositionproperty", "position", "position", pos); 113 set (ax, "activepositionproperty", "position", "position", pos);
114 114
115 cax = __go_axes__ (get (ax, "parent"), "tag", "colorbar", 115 cax = __go_axes__ (get (ax, "parent"), "tag", "colorbar",
116 "handlevisibility", "off", 116 "handlevisibility", "on",
117 "activepositionproperty", "position", 117 "activepositionproperty", "position",
118 "position", cpos); 118 "position", cpos);
119 addproperty ("location", cax, "radio", 119 addproperty ("location", cax, "radio",
120 "eastoutside|east|westoutside|west|northoutside|north|southoutside|south", 120 "eastoutside|east|westoutside|west|northoutside|north|southoutside|south",
121 loc); 121 loc);
548 %! imagesc (log10 (1 ./ hilb (99))); 548 %! imagesc (log10 (1 ./ hilb (99)));
549 %! h = colorbar; 549 %! h = colorbar;
550 %! ytick = get(h, "ytick"); 550 %! ytick = get(h, "ytick");
551 %! set (h, "yticklabel", sprintf ('10^{%g}|', ytick)); 551 %! set (h, "yticklabel", sprintf ('10^{%g}|', ytick));
552 552
553 %!demo
554 %! clf
555 %! n=5;x=linspace(0,5,n);y=linspace(0,1,n);
556 %! imagesc(1./hilb(n)); axis equal; colorbar
557
558 %!demo
559 %! clf
560 %! n=5;x=linspace(0,5,n);y=linspace(0,1,n);
561 %! imagesc(x,y,1./hilb(n)); axis equal; colorbar
562
563 %!demo
564 %! clf
565 %! n=5;x=linspace(0,5,n);y=linspace(0,1,n);
566 %! imagesc(y,x,1./hilb(n)); axis equal; colorbar
567 ## This requires that the axes position be properly determined for "axes equal"
568
569 %!demo
570 %! clf
571 %! axes
572 %! colorbar
573 %! hold on
574 %! contour(peaks)
575 %! hold off
576
577 %!demo
578 %! clf
579 %! plot([0, 2])
580 %! colorbar ("east")
581 %! axis square
582
583 %!demo
584 %! clf
585 %! plot([0, 2])
586 %! colorbar ("eastoutside")
587 %! axis square
588
589 %!demo
590 %! clf
591 %! plot([0, 2])
592 %! colorbar ("east")
593 %! axis equal
594
595 %!demo
596 %! clf
597 %! plot([0, 2])
598 %! colorbar ("eastoutside")
599 %! axis equal