75 return std::map<double, Color>{};
81 std::map<double, Color> result;
82 for(
size_t i = 0; i < map.
size(); ++i ) {
83 auto const offset =
static_cast<double>( i ) /
static_cast<double>( map.
size() - 1 );
96 std::map<double, Color> result;
107 auto const scale = 2.0 /
static_cast<double>( map.
size() - 1 );
110 for(
size_t i = 0; i < map.
size() / 2; ++i ) {
111 auto const offset =
scale * frac_lower *
static_cast<double>( i );
116 if( map.
size() % 2 == 0 ) {
117 auto const mid_idx = map.
size() / 2;
119 map.
color( mid_idx - 1 ), map.
color( mid_idx ), 0.5
121 result[ frac_lower ] = mid_color;
125 for(
size_t i = map.
size() / 2; i < map.
size(); ++i ) {
128 auto const step =
static_cast<double>( map.
size() - i - 1 );
131 auto const offset = 1.0 - (
scale * frac_upper * step );
140 std::map<double, Color> result;
145 auto const len = max - min;
147 for(
auto const& bound : norm.
boundaries() ) {
148 result[ ( bound - min ) / len ] = map( norm, bound );
179 return std::map<double, std::string>{};
184 std::map<double, std::string> result;
186 auto const tm_labels = tm.linear_labels( norm.
min_value(), norm.
max_value(), num_ticks );
187 for(
auto const& tm_label : tm_labels ) {
188 result[ tm_label.relative_position ] =
to_string_nice( tm_label.label );
195 std::map<double, std::string> result;
202 for(
auto const& tm_label : tm_labels_u ) {
205 std::log( tm_label.label ) / std::log( norm.
base() )
209 result[ tm_label.relative_position ] = label;
217 std::map<double, std::string> result;
226 if( frac_lower <= 0.0 || frac_upper <= 0.0 ) {
227 throw std::runtime_error(
"Invalid color normalization for calculating tickmarks." );
231 tm.include_max =
false;
232 auto const tm_labels_l = tm.linear_labels(
235 for(
auto const& tm_label : tm_labels_l ) {
236 auto const pos = frac_lower * tm_label.relative_position;
245 if( tm_labels_l.size() > 0 && tm_labels_l.back().relative_position == 1.0 ) {
246 tm.include_min =
false;
250 tm.include_max =
true;
251 auto const tm_labels_u = tm.linear_labels(
254 for(
auto const& tm_label : tm_labels_u ) {
255 auto const pos = frac_lower + frac_upper * tm_label.relative_position;
270 auto const len = max - min;
272 std::map<double, std::string> result;
273 for(
auto const& bound : norm.
boundaries() ) {