Dear all:
I am struggling with plotting a histogram with a cumulative frequency line overlaid.
I want to use twinx()
to display the second y axis, but my code does not work.
using Plots
# some doing for data
scores = floor.(Int64, rand(10)*100)
freq = fit(Histogram, english_scores, 0:10:100)
rel_freq = freq.weights ./ sum(freq.weights)
cum_reql_freq = cumsum(rel_freq)
# plot
histogram(scores, bins = 0:10:100)
subplt = twinx()
plot!(subplt,5:10:95 , cum_reql_freq)
This only gives (both in GR and PyPlot backends):