Creating histograms with Danfo.js
A histogram, as we explained earlier, is a representation of the spread of data. The hist
function exposed by the plot namespace can be used to make histograms from DataFrames or Series, as we'll demonstrate in the following section.
Creating a histogram from a Series
In order to create a histogram from a Series, you can call the hist
function on the Series, or if plotting on a DataFrame, you can subset the DataFrame with the column name, as shown in the following example:
var layout = { Â Â Â title: "Histogram on a Series data", } var config = { Â Â layout } new_df["AAPL.Open"].plot(this_div()).hist(config)
Running the preceding code cell gives the following output:
Next, we'll make a histogram for more than one column in a DataFrame at a time.
Creating a histogram from multiple columns
If you want to make...