octave-maintainers
[Top][All Lists]
Advanced

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

Re: legend on contour plot


From: Petr Mikulik
Subject: Re: legend on contour plot
Date: Sun, 10 Feb 2008 20:22:30 +0100 (CET)

> >> There is no way yet to label the contour lines.. The only legend
> >> possible at the moment is with "colorbar()". See
> >>
> >> contour(peaks)
> >> colorbar
> > 
> > I see... nothing. White empty room is created on the right, but no color 
> bar.
> drawnow("x11","/dev/null",false,"debug.gp")

Looking into debug.gp, the reason gets clear: gnuplot does not show colorbar 
because there is no plot using the palette. All the contours are plot "with 
lines linecolor rgb xxxxxx", i.e. with a hardcoded colour. The colorbox 
would appear if at least one line is drawn "with lines|points|... linetype 
palette cb|frac ...." (or matrix "with image").

Could Octave use "with lines palette frac|cb"?

Otherwise, it could add one dummy "contour line" with just a single point 
outside x,y ranges and draw with a command like
"-" using ($1):($2) title "" with dots lt pal frac 0


Gnuplot does automatically decide whether to put or not the colorbox. Until 
now, there was no need for a command like "set colorbox auto|always". Mainly 
because of the fact that a human would not "set cbrange" if there is no plot 
for it.


> However the fact that the colorbar doesn't appear is. This is very
> strange and I just noticed it as well. This worked before the Octave
> 3.0.0 release and no longer works.

Most probably there was "(s)plot ... with line palette".


> There is a secondary issue in that the cbtics seemed to have disappeared
> somewhere before 3.0 as well and so the axes of the colorbar aren't
> displayed either (or would be for contours if teh colorbox was displayed)

Can you write a demo script for this?

---
PM


reply via email to

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