Specifying edges and missing values for barplots

Source code Author Update time

using Plots
gaston()

In bar(x, y), x may be the same length as y to specify bar centers, or one longer to specify bar edges.

plot(bar(-5:5, randn(10)), bar(-2:2, [2, -2, NaN, -1, 1], color = 1:5), legend = false)
Gnuplot Produced by GNUPLOT 5.4 patchlevel 2 -1.5 -1.0 -0.5 0.0 0.5 -4 -2 0 2 4 y1 gnuplot_plot_2a gnuplot_plot_3a gnuplot_plot_4a gnuplot_plot_5a gnuplot_plot_6a gnuplot_plot_7a gnuplot_plot_8a gnuplot_plot_9a gnuplot_plot_10a gnuplot_plot_11a -2 -1 0 1 2 -2 -1 0 1 2 y1 gnuplot_plot_2b gnuplot_plot_3b gnuplot_plot_4b gnuplot_plot_5b gnuplot_plot_6b gnuplot_plot_7b gnuplot_plot_8b

This page was generated using DemoCards.jl and Literate.jl.