colorbar, again

David Bateman David.Bateman at motorola.com
Fri Sep 12 02:15:24 CDT 2008


Francesco Potorti` wrote:
>> Sorry I didn't make it clear in my previous e-mail why this issue 
>> exists.. The 3.0.x version of colorbar is a light wrapper around a 
>> gnuplot colorbox. The position of the colorbox is calculated manually by 
>> Octave, and due to the manner that __go_draw_axes__ uses the axis 
>> outerposition to set the position of the plot an empirically derived 
>> formula for the colorbar size is used. Therefore something like
>>
>> imagesc(peaks); colorbar()
>>
>> will give the right colorbar size. Now pcolor is in fact a surface and 
>> so is a 3D plot that just has a 2-D view and the size of the window is 
>> different than the 2-D gnuplot windows.
>>
>> The fix is to get the colorbar size calculated from the window size 
>> itself. This is what I've done in a patch for 3.1.51+ that is pending. 
>> However, I'm not sure that will even fix the issue for gnuplot as the 
>> manner in which it scales 3D plots relative to the size and the margins 
>> set by Octave is not clear.
>>     
>
> In fact, I have your patch to __go_draw_axes__ applied to 3.0, but
> little has changed.  So the current workaround is to use imagesc, am I
> right?
>   
At this point yes, using imagesc would fix the issue, as that doesn't 
use a gnuplot "splot" command.

D.



More information about the Bug-octave mailing list