import sys from pathlib import Path import numpy as np import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt sys.path.insert(0, str(Path(__file__).resolve().parent.parent/'research')) from exact_ranks import NINE, nine_polynomial_scan plt.rcParams.update({'font.family':'DejaVu Sans','font.size':9,'pdf.fonttype':42}) fig=plt.figure(figsize=(7.05,2.5),layout='constrained') gs=fig.add_gridspec(1,2,width_ratios=(.88,1.48)) ax=fig.add_subplot(gs[0]) # Orthographic view down the (1,1,1) diagonal, with a common scale removed. project=np.array([[-np.sqrt(3)/2,-.5],[np.sqrt(3)/2,-.5],[0.,1.]]) for direction, label in zip(project, ('x','y','z')): axis=np.outer([-3.22,2.33],direction) ax.plot(*axis.T,color='#748d97',lw=.95) ax.text(*(2.64*direction),label,color='#203547',fontsize=9,ha='center',va='center') for val,color in [(-3,'#ad542c'),(1,'#147f78'),(2,'#174a63')]: dots=val*project ax.scatter(*dots.T,s=35,color=color,edgecolors='white',linewidths=.6,zorder=3) ax.set(xlim=(-3.2,3.2),ylim=(-3.4,3.0),aspect='equal') ax.set_axis_off() ax.set_title('Nine centered points',fontweight='bold',fontsize=10,loc='left',color='#16374b',pad=5) ax2=fig.add_subplot(gs[1]) rows=nine_polynomial_scan() xs=np.array([r['degree'] for r in rows]) ys=np.array([r['missing'] for r in rows]) ax2.bar(xs,ys,width=.67,color='#197d79') ax2.set(xlim=(-.6,24.6),ylim=(0,2.3),xlabel='Harmonic degree',ylabel='Missing dimensions',xticks=[0,3,6,9,12,15,18,21,24],yticks=[0,1,2]) ax2.set_title('Defect of all two-point mixtures',fontweight='bold',fontsize=10,loc='left',color='#16374b',pad=6) ax2.spines[['top','right']].set_visible(False) ax2.spines[['left','bottom']].set_color('#9ca9ae') ax2.grid(axis='y',color='#e3e8ea',linewidth=.6); ax2.set_axisbelow(True) fig.savefig(Path(__file__).resolve().parent/'witness.pdf',bbox_inches='tight',pad_inches=.02)