DataConverter¶
-
class
visualife.core.DataConverter(plot, x_code, y_code)¶ Bases:
objectConverts plot data values to screen coordinates values
Also stores x and y ranges for class
Plotand has set_nice_range() method which provides automatic nice range for axesCreates a DataConverter object
Parameters: - plot (
Plot) – referance to plot to get axis to convert values - x_code (
string) – letter that defines a AxisX location - y_code (
string) – letter that defines a AxisY location
Attributes Summary
max_xReturns maximum of X data in screen coordinates max_yReturns maximum of Y data in screen coordinates min_xReturns minimum of X data in screen coordinates min_yReturns minimum of Y data in screen coordinates plotReturns a reference to a Plotthat this converter belongs toMethods Summary
convert_data(x_data, y_data)Converts x_data and y_data to screen coordinates set_min_and_max_data(dataset)Sets min and max for X and Y data of all this converter’s series in a Plotset_nice_range([what])Finds a nice tics ranges for PlotdataAttributes Documentation
-
max_x¶ Returns maximum of X data in screen coordinates
-
max_y¶ Returns maximum of Y data in screen coordinates
-
min_x¶ Returns minimum of X data in screen coordinates
-
min_y¶ Returns minimum of Y data in screen coordinates
-
plot¶ Returns a reference to a
Plotthat this converter belongs to
Methods Documentation
-
convert_data(x_data, y_data)¶ Converts x_data and y_data to screen coordinates
param x_data: x_data to convert type x_data: listparam y_data: y_data to convert type y_data: listreturn: tuplelike (x_screen_data,y_screen_data)
-
set_min_and_max_data(dataset)¶ Sets min and max for X and Y data of all this converter’s series in a
PlotThis values is neccesary to set_nice_range() method.
-
set_nice_range(what='xy')¶ Finds a nice tics ranges for
PlotdataUses min and max data stored in
self
- plot (