plots.util

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.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.check_fig_size(fig)
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.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, lims)

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.

plots.util.modify_suffix(inputCell)

Function modify_suffix()

Parameters:

inputCell – inputCell

Returns:

inputCell

plots.util.hatchfill2_demo

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

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.table2latex(tab, filename, special_col_spec, special_first_row)

Error detection and default parameters()

plots.util.unicode(codepoint)

codepoint is a character array representing the part after U+ in unicode(). u is a character that renders the unicode(), for i.e. graphics. This function handles the required difference between the way matlab handles 4-digit codepoints (on the “basic multilingual plane”) and 5- and 6-digit codepoints (on the “supplementary planes”). Example codepoints: ‘1f7c0’ for U+1F7C0 🟀, ‘1d54f’ for U+1D54F 𝕏, ‘2102’ for U+2102 ℂ

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(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.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.raster_text(ax, x, y, str, x_span, fontname)

creates a rasterized version of the specified text and places it on the given axes at (x,y) with the specified font. x_span controls the width of the text as a fraction of the axis width. This is useful for unicode() characters that may not render correctly in vector format. You should set the axis limits before calling this function to ensure correct scaling.