From 6a18e25694f8e15e125dbd93e1145d39d6d88ef6 Mon Sep 17 00:00:00 2001 From: vanwynch Date: Wed, 22 Jul 2020 19:39:05 +0200 Subject: [PATCH] fix matplotlib error by changing 'none' to (0,0,0,0) as color & facecolor --- example_rmds.py | 8 ++++---- example_toa.py | 17 ++++++++--------- rcbox/rtdoa.py | 7 ++++--- 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/example_rmds.py b/example_rmds.py index f289c03..b1aabff 100644 --- a/example_rmds.py +++ b/example_rmds.py @@ -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") diff --git a/example_toa.py b/example_toa.py index ea5e1cf..dfc1ce9 100644 --- a/example_toa.py +++ b/example_toa.py @@ -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 @@ -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") diff --git a/rcbox/rtdoa.py b/rcbox/rtdoa.py index 17866ce..c80a20a 100644 --- a/rcbox/rtdoa.py +++ b/rcbox/rtdoa.py @@ -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 @@ -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):