In following example, sales is a dictionary showing sales figures of three products in three months. To render a vertical (or horizontal) stacked bar using vbar_stack() or hbar_stack() function, set stackers property to list of fields to stack successively and source property to a dict object containing values corresponding to each field. To show each bar in different colour, set color property of vbar() function to list of color values.Ĭols = įig.vbar(x = langs, top = students, color = cols,width=0.5) With following example, a simple bar plot is displayed showing number of students enrolled for various courses offered.įrom otting import figure, output_file, showįig.vbar(x = langs, top = students, width = 0.5) Langs = įig = figure(x_range = langs, plot_width = 300, plot_height = 300) For example, to use strings in the given list for x axis − In order to use categorical data along either of axes, we need to specify a FactorRange to specify categorical dimensions for one of them. In the examples so far, the Bokeh plots show numerical data along both x and y axes. The figure object can be so configured by defining extra_x_range and extra_y_range properties It may be needed to show multiple axes representing varying ranges on a single plot figure. If there exists a power law relationship between x and y data series, it is desirable to use log scales on both axes. The bokeh plots show numerical data along both x and y axes. In this chapter, we shall discuss about various types of axes.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |