graphs
¶
Module Contents¶
-
class
Data
(x: list, y: list, x_label='', y_label='', legend='', is_scattered=False, transfo_x=lambda selfData, x: x, transfo_y=lambda selfData, y: y, xlim=None, ylim=None, permutations=None, sort_output=False, color=None, symbol='o', symbolsize=8, fillsymbol=True, outlinesymbol=1.8, linestyle='-', width=2)[source]¶ This class is used to store informations necessary to plot a 2D graph. It has to be combined with a gui to be useful (ex. pyqtgraph)
-
get_plot_data
(self)[source]¶ Call this method to get the x and y coordinates of the points that have to be displayed. => After transformation, and after permutations.
Returns: x (list), y (list)
-
get_permutations
(self)[source]¶ Return the transformation ‘permutation’: xplot[i] = xdata[permutation[i]]
-
get_invert_permutations
(self)[source]¶ Return the inverse of permutations: xdata[i] = xplot[revert[i]]
-
get_dataIndex_from_graphIndex
(self, index_graph_point)[source]¶ From an index given in graph, recovers the index of the data.
Parameters: index_graph_point – Index in the graph Returns: index of the data
-
get_dataIndices_from_graphIndices
(self, index_graph_point_list)[source]¶ Same as get_dataIndex_from_graphIndex but with a list in entry. Can (?) improve performances for huge dataset.
Parameters: index_graph_point_list – List of Index in the graph Returns: List of index of the data
-
get_graphIndex_from_dataIndex
(self, index_data)[source]¶ From an index given in the data, recovers the index of the graph.
Parameters: index_data – Index in the data Returns: index of the graph
-
get_graphIndices_from_dataIndices
(self, index_data_list)[source]¶ Same as get_graphIndex_from_dataIndex but with a list in entry. Can (?) improve performances for huge dataset.
Parameters: index_data_list – List of Index in the data Returns: List of index of the graph
-
-
class
Graph
[source]¶ Simple graph container that contains several traces
-
add_trace
(self, data)[source]¶ Add a trace to the graph
Parameters: data – Data
Returns: id of the created trace
-
remove_trace
(self, idTrace)[source]¶ Delete a trace from the graph
Parameters: idTrace – id of the trace to delete
-
-
class
Graphs
[source]¶ Contains several
Graph
-
add_trace_firstGraph
(self, data, updateChildren=True)[source]¶ Same as add_trace, but only if graphs has only one id :param data: :param updateChildren: :return:
-
add_trace
(self, idGraph, data, updateChildren=True)[source]¶ Add a trace to the graph
Parameters: - idGraph – id of the graph
- data –
Data
- updateChildren – Automatically calls callback functions
Returns: id of the created trace
-
remove_trace
(self, idGraph, idTrace, updateChildren=True)[source]¶ Remove the trace from the graph
Parameters: - idGraph – id of the graph
- idTrace – id of the trace to remove
- updateChildren – Automatically calls callback functions
-
get_graph
(self, idGraph)[source]¶ Get graph object at idgraph
Parameters: idGraph – id of the graph to get Returns: Graph
-