-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #199 from jenshnielsen/fix_rgba_error
Fix rgba error
- Loading branch information
Showing
2 changed files
with
33 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import matplotlib.pyplot as plt | ||
import numpy as np | ||
from plottr.plot.mpl.plotting import PlotType, colorplot2d | ||
|
||
|
||
def test_colorplot2d_scatter_rgba_error(): | ||
""" | ||
Check that scatter plots are not trying to plot 1x3 and 1x4 | ||
z arrays as rgb(a) colors. | ||
""" | ||
fig, ax = plt.subplots(1, 1) | ||
x = np.array([[0.0, 11.11111111, 22.22222222, 33.33333333]]) | ||
y = np.array( | ||
[ | ||
[ | ||
0.0, | ||
0.0, | ||
0.0, | ||
0.0, | ||
] | ||
] | ||
) | ||
z = np.array([[5.08907021, 4.93923391, 5.11400073, 5.0925613]]) | ||
colorplot2d(ax, x, y, z, PlotType.scatter2d) | ||
|
||
x = np.array([[0.0, 11.11111111, 22.22222222]]) | ||
y = np.array([[0.0, 0.0, 0.0]]) | ||
z = np.array([[5.08907021, 4.93923391, 5.11400073]]) | ||
colorplot2d(ax, x, y, z, PlotType.scatter2d) |