예제 #1
0
 def _prepare_plot_v(self, main_window=None):
     # TODO: La interfaz de cagraph no puede ser más enrevesada :(
     plot = CaGraph(main_window)
     xaxis = CaGraphXAxis(plot)
     xaxis.axis_style.side = "bottom"
     xaxis.axis_style.draw_labels = xaxis.axis_style.draw_tics = True
     yaxis = CaGraphYAxis(plot)
     yaxis.axis_style.label_format = "%d"
     plot.graph_style.draw_pointer = True
     plot.axiss.append(xaxis)
     plot.axiss.append(yaxis)
     # create and add top axis
     # top_axis = CaGraphXAxis(plot)
     # top_axis.axis_style.label_format = '%d'
     # top_axis.axis_style.side = 'top'
     # plot.axiss.append(top_axis)
     # Cuadrícula (no se puede habilitar solo horizontal)
     plot.grid = CaGraphGrid(plot, 0, 1)
     plot.grid.style.line_color = (0, 0.5, 0, 1)
     plot.grid.style.zero_line_color = (0, 0, 0, 0)
     # Series de datos
     plot.seriess.append(CaGraphSeriesBar(plot, 0, 1))
     plot.seriess[0].data = self._data
     plot.seriess[0].style.bar_width = 10
     plot.seriess.append(CaGraphSeriesLabels(plot, 0, 1))
     plot.seriess[1].data = self._labels
     plot.auto_set_range()
     plot.connect("motion-notify-event", self.motion_notify_vbar)
     return plot
예제 #2
0
 def _prepare_plot_h(self, main_window=None):
     plot = CaGraph(main_window)
     xaxis = CaGraphXAxis(plot)
     xaxis.axis_style.label_format = "%d"
     xaxis.axis_style.side = "bottom"
     yaxis = CaGraphYAxis(plot)
     yaxis.axis_style.draw_labels = yaxis.axis_style.draw_tics = False
     plot.graph_style.draw_pointer = True
     plot.axiss.append(xaxis)
     plot.axiss.append(yaxis)
     # create and add top axis
     top_axis = CaGraphXAxis(plot)
     top_axis.axis_style.label_format = "%d"
     top_axis.axis_style.side = "top"
     plot.axiss.append(top_axis)
     # Cuadrícula (no se puede habilitar solo horizontal)
     plot.grid = CaGraphGrid(plot, 0, 1)
     plot.grid.style.line_color = (0, 0.5, 0, 1.0)
     plot.grid.style.zero_line_color = (0, 0, 0, 0)
     # Series de datos
     plot.seriess.append(CaGraphSeriesHBar(plot, 0, 1))
     plot.seriess.append(CaGraphSeriesLabels(plot, 0, 1))
     plot.seriess[0].data = self._data
     # plot.seriess[0].style.bar_width = 10
     plot.seriess[1].data = self._labels
     plot.auto_set_range()
     plot.connect("motion-notify-event", self.motion_notify_hbar)
     return plot