Skip to content

Commit

Permalink
If no input or given I2 matrix, no need to plot input and output sepa…
Browse files Browse the repository at this point in the history
…rately
  • Loading branch information
jmshea committed Jan 5, 2024
1 parent 8151783 commit c1ea67a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion plotvec/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
All files in the package are distributed under the MIT License
'''

__version__ = '1.7.1'
__version__ = '1.7.2'

from .plotvec import plotvec, plotvecR
from .transforms import transform_unit_vecs, transform_field
6 changes: 5 additions & 1 deletion plotvec/transforms.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def transform_unit_vecs(matrix, num_vectors=16, colormap='plasma', show_input_ve
plt.ylim(-4,4);
plt.hlines(0,-4,4, 'k', linewidth=0.5)
if show_input_vecs:
plt.title('Output vectors when unit vectors\nare left-multiplied by matrix')
plt.title('vectors Output when unit vectors\nare left-multiplied by matrix')

plt.tight_layout()

Expand Down Expand Up @@ -99,6 +99,10 @@ def transform_field (matrix=np.eye(2), field_width=3, point_spacing=0.5,

assert matrix.shape == (2,2), "matrix argument must be a 2x2 array"

# No need to output 2 graphs of same thing
if np.all( matrix == np.eye(2) ):
show_input_vecs=False

cmap = mpl.colormaps[colormap]

xs = np.arange(-field_width, field_width + point_spacing,
Expand Down

0 comments on commit c1ea67a

Please sign in to comment.