plots.util

plots.util.arrow(p1, p2, ax)

arrow() from p1 to p2: see https://www.mathworks.com/matlabcentral/answers/160487-how-can-i-draw-a-line-with-arrow()-head-between-2-data-points-in-a-plot#answer_365407

plots.util.improvePlot()

Function improvePlot()

Plot parameters() MATLAB treats mac and PC displays differently which can create weird looking graphs. Here we handle system differences

plots.util.bluewhitered(m, white_number, flip, full_color)
[DOCS AUTOGENERATED]

Function bluewhitered()

param m:

m

param white_number:

white_number

returns:

newmap

BLUEWHITERED Blue, white, and red color map.

BLUEWHITERED(M) returns an M-by-3 matrix containing a blue to white to red colormap, with white corresponding to the CAXIS value closest to zero. This colormap is most useful for images and surface plots with positive and negative values. BLUEWHITERED, by itself, is the same length as the current colormap.

white_number (default zero) is the number to correspond to white. (Sometimes this is set to 1 if plotting a ratio). flip (default false) is a boolean for whether to use red-white-blue instead of blue-white-red. full_color (default false) is a boolean for whether the entire range of blue and red shades should be shown even if it results in uneven color gradient. for example, numerical limits of [-1,100] will have colors of [nearly-white-pale-blue, full-red] when full_color is false and [full-blue, full-red] when full_color is true.

plots.util.hatchfill2(A, varargin)

Function hatchfill2()

Parameters:
  • A – A

  • varargin – varargin

Returns:

H

v3.0.0.0 https://www.mathworks.com/matlabcentral/fileexchange/53593-hatchfill2()

plots.util.color_each_element(matrix)

Function color_each_element()

Parameters:

matrix – matrix

Returns:

f

plots.util.check_fig_size(fig)
plots.util.signed_log(Z_data, C, levels, X_data, Y_data, contour_on)

Function signed_log()

Parameters:
  • Z_data – Z_data

  • C – C

  • levels – levels

  • X_data – X_data

  • Y_data – Y_data

modified from the following https://www.mathworks.com/matlabcentral/answers/1700655-symmetric-diverging-log-color-scale#answer_1380451

plots.util.remove_underscores(cell_str_in)

Function remove_underscores()

param cell_str_in:

cell_str_in

returns:

cell_str_out

REMOVE_UNDERSCORES Replaces underscores with spaces and capitalizes each word

plots.util.write_vars_to_tex(varargin)

Function write_vars_to_tex()

Parameters:

varargin – varargin

plots.util.modify_suffix(inputCell)

Function modify_suffix()

Parameters:

inputCell – inputCell

Returns:

inputCell

plots.util.table2latex(tab, filename, special_col_spec, special_first_row)

Error detection and default parameters()

plots.util.save_fig_with_diagnostic(fig, fig_name, pdf_prefix)

Function save_fig_with_diagnostic()

Parameters:
  • fig – Figure handle

  • fig_name – fig_name

  • pdf_prefix – pdf_prefix

Returns:

diagnostic

saves a pdf of a figure, robustly handling cases of gobjects, deleted handles, and invalid figures

plots.util.imrange(inpict)

Function imrange()

Parameters:

inpict – inpict

Returns:

minval

Returns:

maxval [min max] = IMRANGE(INPICT)

returns the global min and max pixel values in INPICT

INPICT can be a vector or array of any dimension or class

plots.util.contourx(X, Y, Z, varargin)

wrapper around contourf that avoids “contour not rendered for constant zdata” warning by using imagesc when Z is constant

plots.util.hatchfill2_demo

HATCHFILL2_DEMO Demonstration script for HATCHFILL2 function 4 examples from original HATCHFILL by Neil Tandon a bar plot example