1 #ifndef GENESIS_UTILS_TOOLS_TICKMARKS_H_ 2 #define GENESIS_UTILS_TOOLS_TICKMARKS_H_ 91 static double step_size(
double interval_size,
size_t target_steps );
99 std::vector<double>
linear_ticks(
double min,
double max,
size_t target_steps );
109 std::vector<LabeledTick>
linear_labels(
double min,
double max,
size_t target_steps );
125 std::vector<LabeledTick>
logarithmic_labels(
double min,
double max,
double base = 10.0 );
165 #endif // include guard std::vector< double > linear_ticks(double min, double max, size_t target_steps)
Calculate a set of ticks that linearily span from min to max in approximately target_steps many steps...
LabeledTick(double rel_pos, double lab)
bool undershoot_at_min
Should the lowest value in the resulting list of ticks be below the provided min value (true) or not ...
double relative_epsilon
Relative epsilon used to exclude two tickmarks that are too close to each other.
Container namespace for all symbols of genesis in order to keep them separate when used as a library...
Tickmarks & operator=(Tickmarks const &)=default
static double step_size(double interval_size, size_t target_steps)
Calculate a step size that fills the interval_size in approximately target_steps many steps...
bool overshoot_at_max
Should the highest value in the resulting list of ticks be above the provided max value (true) or not...
std::vector< LabeledTick > linear_labels(double min, double max, size_t target_steps)
Return a set of labels with relative positions between min and max, where the labels correspond to th...
bool include_max
Should the provided max value be included in the resulting list of ticks or not.
bool include_min
Should the provided min value be included in the resulting list of ticks or not.
std::vector< LabeledTick > logarithmic_labels(double min, double max, double base=10.0)
Return a set of labels with relative positions between min and max, where the labels correspond to lo...
Helper class to find "nice" tickmark intervals for creating scales and axes.