Question: Creating a colorbar for a contour plot

Hi, I have not found a post that explains how to create a colorbar for a contour plot with or without filled regions.  At the moment, I manage to create a color bar manually as follows.

First, I plot some function like so,

plots[contourplot](i/(1-(1+i)^(-n)), n = 15 .. 30, i = 0.1e-1 .. .15, axes = frame, contours = [seq(0.1e-1*n, n = 5 .. 16)], filledregions = true, axis[1] = [location = low, gridlines = [10, majorlines = 1]], axis[2] = [location = low, gridlines = [10, majorlines = 1]], tickmarks = [10, 10], transparency = .4, legendstyle = [location = right]);

Then, I right click on the plot and select Legend->Show Legend

The option "legendstyle = [location = right]" put into the plot command causes the legend to be display a range of different colors each labeled "Polygons i", where i is some interger.   At this point I would manually change the labels to some appropriate numerical value.  However, everytime a refresh or modify the plot I must manually change the labels again.  This is especially troublesome when using a large number of contours.

My question is threefold.  

Is there a way of displaying the filled regions in the legend thorugh the plot command (not through the context sensitive menu)?

Is there a way of manually specifying the appropriate names in the plot command?

Lastly, is there a way of changing the color scheme of these filled regions?

 

Any help is much appreciated.  

 

 

 

Please Wait...