Skip to content

Commit

Permalink
fix matplotlib error by changing 'none' to (0,0,0,0) as color & facec…
Browse files Browse the repository at this point in the history
…olor
  • Loading branch information
vanwynch committed Jul 22, 2020
1 parent 692ac5d commit 6a18e25
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 16 deletions.
8 changes: 4 additions & 4 deletions example_rmds.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,18 +64,18 @@
ax_ls.set_title("least-square (smacof)")

ax_ls.scatter(*solver_ls.x_aligned.T, marker='x', facecolor='RoyalBlue',
color='none', s=35, linewidths=1.5, label='r estimated')
color=(0, 0, 0, 0), s=35, linewidths=1.5, label='r estimated')

ax_ls.scatter(*solver_ls.x_ref_centered.T, marker='o', facecolor='none',
ax_ls.scatter(*solver_ls.x_ref_centered.T, marker='o', facecolor=(0, 0, 0, 0),
color='RoyalBlue', s=35, linewidths=1.5, label='r source')

ax_oa = fig.add_subplot(122, projection='3d')
ax_oa.set_title("outlier-aware")

ax_oa.scatter(*solver_oa.x_aligned.T, marker='x', facecolor='RoyalBlue',
color='none', s=35, linewidths=1.5, label='r estimated')
color=(0, 0, 0, 0), s=35, linewidths=1.5, label='r estimated')

ax_oa.scatter(*solver_oa.x_ref_centered.T, marker='o', facecolor='none',
ax_oa.scatter(*solver_oa.x_ref_centered.T, marker='o', facecolor=(0, 0, 0, 0),
color='RoyalBlue', s=35, linewidths=1.5, label='r source')

plt.savefig("example_rmds_geometries.pdf")
Expand Down
17 changes: 8 additions & 9 deletions example_toa.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
from mpl_toolkits.mplot3d.art3d import juggle_axes

from rcbox.rmds import RMDU
from rcbox.utils import make_TOA
Expand Down Expand Up @@ -68,35 +67,35 @@
ax_ls = fig.add_subplot(121, projection='3d')
ax_ls.scatter(*toa_solver.x_aligned[0:toa_solver.Nr, :].T,
marker='x', facecolor='RoyalBlue',
color='none', s=35, linewidths=1.5, label='r estimated')
color=(0, 0, 0, 0), s=35, linewidths=1.5, label='r estimated')

ax_ls.scatter(*toa_solver.x_aligned[toa_solver.Nr::, :].T,
marker='x', facecolor='red',
color='none', s=35, linewidths=1.5, label='r estimated')
color=(0, 0, 0, 0), s=35, linewidths=1.5, label='r estimated')

ax_ls.scatter(*toa_solver.x_ref_centered[0:toa_solver.Nr, :].T, marker='o',
facecolor='none',
facecolor=(0, 0, 0, 0),
color='RoyalBlue', s=35, linewidths=1.5, label='r source')

ax_ls.scatter(*toa_solver.x_ref_centered[toa_solver.Nr::, :].T, marker='o',
facecolor='none',
facecolor=(0, 0, 0, 0),
color='red', s=35, linewidths=1.5, label='r source')

ax_oa = fig.add_subplot(122, projection='3d')
ax_oa.scatter(*rtoa_solver.x_aligned[0:rtoa_solver.Nr, :].T,
marker='x', facecolor='RoyalBlue',
color='none', s=35, linewidths=1.5, label='r estimated')
color=(0, 0, 0, 0), s=35, linewidths=1.5, label='r estimated')

ax_oa.scatter(*rtoa_solver.x_aligned[rtoa_solver.Nr::, :].T,
marker='x', facecolor='red',
color='none', s=35, linewidths=1.5, label='r estimated')
color=(0, 0, 0, 0), s=35, linewidths=1.5, label='r estimated')

ax_oa.scatter(*rtoa_solver.x_ref_centered[0:rtoa_solver.Nr, :].T, marker='o',
facecolor='none',
facecolor=(0, 0, 0, 0),
color='RoyalBlue', s=35, linewidths=1.5, label='r source')

ax_oa.scatter(*rtoa_solver.x_ref_centered[rtoa_solver.Nr::, :].T, marker='o',
facecolor='none',
facecolor=(0, 0, 0, 0),
color='red', s=35, linewidths=1.5, label='r source')

plt.savefig("example_toa_geometries.pdf")
Expand Down
7 changes: 4 additions & 3 deletions rcbox/rtdoa.py
Original file line number Diff line number Diff line change
Expand Up @@ -269,13 +269,13 @@ def Plot_result(self, r_gt=None, show_init=False,

# Plot final
ax.scatter(*self.r.T, marker='x', facecolor='RoyalBlue',
color='none',
color=(0, 0, 0, 0),
s=35, linewidths=1.5, label='r estimated')

# Plot initial guess
if show_init:
ax.scatter(*self.r_iters[0, :, :].T, marker='s', color='RoyalBlue',
facecolor='none',
facecolor=(0, 0, 0, 0),
s=35, linewidths=1.5, label='r inital')

# Plot microphone paths across iterations
Expand All @@ -285,7 +285,8 @@ def Plot_result(self, r_gt=None, show_init=False,

# Plot ground truth if given
if r_gt is not None:
ax.scatter(*r_gt.T, marker='o', color='red', facecolor='none',
ax.scatter(*r_gt.T, marker='o', color='red',
facecolor=(0, 0, 0, 0),
s=35, linewidths=1.5, label='r ground truth')

for l in range(self.L):
Expand Down

0 comments on commit 6a18e25

Please sign in to comment.