cosmicfish_pylib.utilities.nice_number

cosmicfish_pylib.utilities.nice_number(num, mode=0)[source]

This function returns a nice number built with num. This is useful to build the axes of a plot. The nice number is built by taking the first digit of the number.

Parameters:
  • num (float or int) – input number
  • mode (int) –

    (optional) operation to use to build the nice number

    0 – use ceil
    1 – use round
    2 – use floor
Returns:

a nice number!

Return type:

float