A visualization of real function of two variables is often technically difficult. Visualization of complex-valued functions can be simplified by visualizing the real and imaginary parts of these functions. To approximate fast-growing or decreasing functions, often a uniform grid of nodes is not enough and it is necessary to use a special adaptive grid. Therefore, constructing an adaptive mesh of nodes that takes into account the behavior of the function of several variables is of considerable interest. In this paper, we propose one method for constructing an adaptive grid of nodes on a line. Such an adaptive grid can be used to approximate the functions of several variables. Formulae for constructing the adaptive grid of nodes and the results of numerical experiments are given. An approximation of real functions of one and two variables and complex-valued functions is constructed using polynomial and non-polynomial local splines of one variable. Approximations in a rectangular region in the plane are constructed using the tensor product. Formulae for approximations of real and complex-valued functions and examples of visualization of some functions are given.