GT::Graphics::Scale

A scale converts local data (numbers) into coordinate ready to be displayed.

Can use linear scale or logarithmic ones.

linear : X = a * x + b logarithmic : X = ln(x - b + 1) * a

$s->set_vertical_linear_mapping($y1, $y2, $ty1, $ty2)

Parameterize the scale to elaborate a mapping of [$y1,$y2] => [$ty1,$ty2] on the vertical axis.

$s->set_horizontal_linear_mapping($x1, $x2, $tx1, $tx2)

Parameterize the scale to elaborate a mapping of [$x1,$x2] => [$tx1,$tx2] on the horizontal axis.

$s->set_vertical_logarithmic_mapping($y1, $y2, $ty1, $ty2)

Parameterize the scale to elaborate a logarithmic mapping of [$y1,$y2] => [$ty1,$ty2] on the vertical axis.

$s->set_horizontal_logarithmic_mapping($x1, $x2, $tx1, $tx2)

Parameterize the scale to elaborate a logarithmic mapping of [$x1,$x2] => [$tx1,$tx2] on the horizontal axis.

($nx, $ny) = $s->convert_to_coordinate($x, $y)

Returns the coordinate of the ($x, $y) point with the scale modification applied.

$nx = $s->convert_to_x_coordinate($x)

Returns the X coordinate of the $X value with the scale modification applied.

$ny = $s->convert_to_y_coordinate($y)

Returns the Y coordinate of the $y value with the scale modification applied.

($x, $y) = $s->get_value_from_coordinate($nx, $ny)

Returns the value corresponding to the given coordinate.

$s->copy_horizontal_scale($other)

$s->copy_vertical_scale($other)

Copy the horizontal/vertical scale defined in the $other scale object.