def createFigures(months, times): monthList = [ "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" ] hourList = [] for hour in range(0, 24): hour = str(hour) hourList.append(hour) figmonths = figure(x_range=monthList) figmonths.vbar(x=monthList, top=months, width=0.8) output_file("Frequency of messages.html") show(figmonths) figtimes = figure(x_range=hourList) figtimes.vbar(x=hourList, top=times, width=0.8) output_file("Times of messages.html") show(figtimes)
def test_with_args(self, mock_output_file): kwargs = dict(title="title", mode="cdn", root_dir="foo") bio.output_file("foo.html", **kwargs) assert mock_output_file.call_count == 1 assert mock_output_file.call_args[0] == ("foo.html", ) assert mock_output_file.call_args[1] == kwargs
def test_no_args(self, mock_output_file): default_kwargs = dict(title="Bokeh Plot", mode="cdn", root_dir=None) bio.output_file("foo.html") assert mock_output_file.call_count == 1 assert mock_output_file.call_args[0] == ("foo.html", ) assert mock_output_file.call_args[1] == default_kwargs
def test_with_args(self, mock_output_file): kwargs = dict(title="title", mode="cdn", root_dir="foo") bio.output_file("foo.html", **kwargs) assert mock_output_file.call_count == 1 assert mock_output_file.call_args[0] == ("foo.html",) assert mock_output_file.call_args[1] == kwargs
def test_no_args(self, mock_output_file): default_kwargs = dict(title="Bokeh Plot", mode="cdn", root_dir=None) bio.output_file("foo.html") assert mock_output_file.call_count == 1 assert mock_output_file.call_args[0] == ("foo.html",) assert mock_output_file.call_args[1] == default_kwargs
from bokeh.io.output import output_file from bokeh.plotting import figure, output_file, show if __name__ == "__main__": output_file('gaficado_simple.html') fig = figure() total_vals = int(input('Cuantos valores quieres graficar? ')) x_vals = list(range(total_vals)) y_vals = [] for i in x_vals: val = int(input(f'Valor Y para {i}')) y_vals.append(val) fig.line(x_vals, y_vals, line_width=2) show(fig)