EricG - 2017-11-22

Hi folks - I'm having some trouble getting good colorbar results for a contour plot. Either I have very coarse color steps, or I have way to many ticks & labels.

My colorbar call looks like this - it's straight out of example 16:

pls->colorbar(&colorbar_width, &colorbar_height,
               PL_COLORBAR_SHADE | PL_COLORBAR_SHADE_LABEL, 0,
               0.005, 0.0, 0.0375, 0.875, 0, 1, 1, 0.0, 0.0,
               cont_color, cont_width,
               n_labels, label_opts, labels,
               n_axis_opts, axis_opts,
               axis_ticks, axis_subticks,
               num_values, (const PLFLT * const *) values );

I'm using 50 shades to get a smooth contour, and if I use those same levels for the colorbar (values, numvalues), I get a matching smooth gradient in the colorbar. But way to many labels.

img1
plp_ratio_fine.png

If I change numvalues to 11, and change values accordingly, I get nicely spaced ticks, but a very coarse gradient in the colorbar:

img1
plp_ratio_coarse.png

The axisticks parameter doesn't appear to do anything - I've tried 0, 1, 100, 1000 with no apparent change.

So - any idea how I can get the color gradient of the first plot with the ticks from the second plot?

Apologies - I'm having trouble figuring out how to embed the images. Hopefully you can see them as attachments.

 

Last edit: EricG 2017-11-22