Commit 664bf029 authored by Chris Smith's avatar Chris Smith
Browse files

New plot function

Adds loop parameters to existing axes from plot_loop_guess_fit
parent 64ed8e53
......@@ -239,8 +239,33 @@ def plot_loop_guess_fit(vdc, ds_proj_loops, ds_guess, ds_fit, title=''):
return fig, axes
###############################################################################
def _add_loop_parameters(axes, switching_coef_vec):
"""
Add the loop parameters for the given loop to a list of axes
Parameters
----------
axes : list of matplotlib.pyplo.axes
Plot axes to add the coeffients to
switching_coef_vec : 1D numpy.ndarray
Array of loop parameters arranged by position
Returns
-------
axes : list of matplotlib.pyplo.axes
"""
positions = np.linspace(0, switching_coef_vec.shape[0] - 1, len(axes.flat), dtype=np.int)
for ax, pos in zip(axes.flat, positions):
ax.axvline(switching_coef_vec[pos]['V+'], c='k', label='V+')
ax.axvline(switching_coef_vec[pos]['V-'], c='r', label='V-')
ax.axvline(switching_coef_vec[pos]['Nucleation Bias 1'], c='k', ls=':', label='Nucleation Bias 1')
ax.axvline(switching_coef_vec[pos]['Nucleation Bias 2'], c='r', ls=':', label='Nucleation Bias 2')
ax.axhline(switching_coef_vec[pos]['R+'], c='k', ls='-.', label='R+')
ax.axhline(switching_coef_vec[pos]['R-'], c='r', ls='-.', label='R-')
return axes
def rainbow_plot(ax, ao_vec, ai_vec, num_steps=32, cmap=plt.cm.jet, **kwargs):
"""
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment