octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Colorbar function


From: John W. Eaton
Subject: Colorbar function
Date: Mon, 26 Nov 2007 11:11:51 -0500

On 22-Nov-2007, David Bateman wrote:

| Attached is a patch that adds the colorbar function. It doesn't do it
| matlab's way and suffers from a few issues to do with gnuplot's buggy
| colorbars. Matlab adds a colorbar as a separate axis to the plot. This
| means that there must be an exchange of information between the two set
| of axis, and this needs listener functions.
| 
| However, if the colorbar is made a property of the current axis, then no
| sharing of data is needed. However, this means that some of the addition
|  matlab functionality by using "set" on the axes handle of the colorbar
| is not available.
| 
| As for the gnuplot issues these are
| 
| * For colorbar positions inside the border of the plot, gnuplot appears
| to plot the colorbar in the background of the plot. Therefore it is
| often hidden by the plot itself. It would make more sense to always have
| it in the foreground.. For example try
| 
| contour(peak)
| colorbar("east")
| 
| * gnuplot gives no manner to place the colorbar directly inside/outside,
| etc in the same manner as the key. Furthermore for splot, only the
| screen coords can be used to place the colorbar. Therefore, I had to
| derive an empirical formula to position the colorbar correctly and to
| equaly do so for subplots. Therefore, don't expect the colorbar to
| always exactly line up with the plot itself..
| 
| * Gnuplots postscript driver gets the bounding box wrong when there is a
| colorbar.. The colorbar is there, just outside the bounding box, so a
| little hand editing, or negative cropping will get the colorbar back

| 2007-11-20  David Bateman  <address@hidden>
| 
|       * plot/colorbar.m: New function.
|       * plot/Makefile.in (SOURCES): Add it to the sources.
|       * plot/__go_draw_axes__.m: Calculate the colorbar position,
|       precalculate the clim, set pm3d except for mesh.
|       * plot/__contour__.m: Don't scale the contours to clim, but rather
|       save the real values so that colorbar corresponds to the contour
|       levels.
| 
| 2007-11-20  David Bateman  <address@hidden>
| 
|       * graphics.cc (class axes): Add __colorbar__ property.
|       * graphics.h.in (class axes): ditto.

Since it seems that this change will improve compatibility at least at
the level of providing the colorbar function, I'd say apply it.

Thanks,

jwe


reply via email to

[Prev in Thread] Current Thread [Next in Thread]