Added option to switch between linear and logarithmic.