pwc_plot_1d
Plot Piecewise Constant Data


pwc_plot_1d, a MATLAB library which plots piecewise constant data.

Suppose you want to plot a piecewise constant function as N bars of varying heights and widths. This is NOT quite a bar plot, and it's not quite a histogram, and MATLAB doesn't seem to make it easy to plot. This library assumes the function is defined as N+1 breakpoints X and N values Y. It converts this data into a string of 2*N+2 or 3*N+1 plot points which, if given to MATLAB's plot() command, will display the corresponding piecewise constant function.

Licensing:

The computer code and data files described and made available on this web page are distributed under the GNU LGPL license.

Languages:

pwc_plot_1d is available in a Matlab version.

Related Data and Programs:

BOX_DISPLAY, a MATLAB program which displays a box plot, over integer pairs of data, of a function defined by two formulas.

BOX_PLOT, a MATLAB program which displays a box plot of data that consists of pairs of integers;

CC_DISPLAY, a MATLAB program which displays the points used in a 2D Clenshaw-Curtis quadrature rule;

CIRCLE_GRID_DISPLAY, a MATLAB program which reads a matrix of integers, and draws a corresponding grid of circles filled with color.

GRF_DISPLAY, a MATLAB program which reads a GRF file defining a mathematical graph and displays it in the MATLAB graphics window.

GRID_DISPLAY, a MATLAB program which reads a file of points on a grid or sparse grid, displays the grid and saves the image in a Portable Network Graphics (PNG) file;

HISTOGRAM_DISPLAY, a MATLAB program which makes a bar plot of a set of data stored as columns in a file; the first column is the X values, and all the other columns are Y values to be shown as a stack of bars;

pwc_plot_1d_test

pwc_plot_2d, a MATLAB library which converts the definition of a piecewise constant function of a 2D argument into plottable data.

Source Code:


Last revised on 07 April 2019.