Is there any way to create a color bar with the same spacing but with labels not value spaced equally? (picture as example)
Solved using:
void colorbar_label( PLINT axis, PLFLT value, char *label, PLINT length, PLPointer data ) { PLFLT * inputdata = (PLFLT *) data; snprintf( label, length, "%.2f", inputdata[(int)value] ); } .... const char *axis_opts[] = { "uwxno", }; PLFLT shedge[] = {0.4,1,2,4,10,20,40,100}; num_values[0] = 8; values[0] = new PLFLT[ns]; for (int i=0;i<ns;i++){ values[0][i] = i; } pls->colorbar( &colorbar_width, &colorbar_height, PL_COLORBAR_SHADE | PL_COLORBAR_SHADE_LABEL | PL_COLORBAR_BACKGROUND, PL_POSITION_BOTTOM , 0.0, 0.45,0.9,0.1, 0, 1, 1, 0.0, 0.0, cont_color, 2, n_labels, label_opts, labels, n_axis_opts, axis_opts, axis_ticks, axis_subticks, num_values, values );
Log in to post a comment.
Is there any way to create a color bar with the same spacing but with labels not value spaced equally? (picture as example)

Solved using: