74 return std::map<double, Color>{};
80 std::map<double, Color> result;
81 for(
size_t i = 0; i < map.
size(); ++i ) {
82 auto const offset =
static_cast<double>( i ) /
static_cast<double>( map.
size() - 1 );
95 std::map<double, Color> result;
106 auto const scale = 2.0 /
static_cast<double>( map.
size() - 1 );
109 for(
size_t i = 0; i < map.
size() / 2; ++i ) {
110 auto const offset =
scale * frac_lower *
static_cast<double>( i );
115 if( map.
size() % 2 == 0 ) {
116 auto const mid_idx = map.
size() / 2;
118 map.
color( mid_idx - 1 ), map.
color( mid_idx ), 0.5
120 result[ frac_lower ] = mid_color;
124 for(
size_t i = map.
size() / 2; i < map.
size(); ++i ) {
127 auto const step =
static_cast<double>( map.
size() - i - 1 );
130 auto const offset = 1.0 - (
scale * frac_upper * step );
139 std::map<double, Color> result;
144 auto const len = max - min;
146 for(
auto const& bound : norm.
boundaries() ) {
147 result[ ( bound - min ) / len ] = map( norm, bound );
178 return std::map<double, std::string>{};
183 std::map<double, std::string> result;
185 auto const tm_labels = tm.linear_labels( norm.
min_value(), norm.
max_value(), num_ticks );
186 for(
auto const& tm_label : tm_labels ) {
187 result[ tm_label.relative_position ] =
to_string_nice( tm_label.label );
194 std::map<double, std::string> result;
201 for(
auto const& tm_label : tm_labels_u ) {
204 std::log( tm_label.label ) / std::log( norm.
base() )
208 result[ tm_label.relative_position ] = label;
216 std::map<double, std::string> result;
225 if( frac_lower <= 0.0 || frac_upper <= 0.0 ) {
226 throw std::runtime_error(
"Invalid color normalization for calculating tickmarks." );
230 tm.include_max =
false;
231 auto const tm_labels_l = tm.linear_labels(
234 for(
auto const& tm_label : tm_labels_l ) {
235 auto const pos = frac_lower * tm_label.relative_position;
244 if( tm_labels_l.size() > 0 && tm_labels_l.back().relative_position == 1.0 ) {
245 tm.include_min =
false;
249 tm.include_max =
true;
250 auto const tm_labels_u = tm.linear_labels(
253 for(
auto const& tm_label : tm_labels_u ) {
254 auto const pos = frac_lower + frac_upper * tm_label.relative_position;
269 auto const len = max - min;
271 std::map<double, std::string> result;
272 for(
auto const& bound : norm.
boundaries() ) {