def plot_box(a:ndarray,b:ndarray,ax:pyplot=None,figsize=FIGSIZE,grid:bool=False, facecolor=None,edgecolor=None,alpha=0.15,label=None,zorder=None): # plot the box from intervals a and b ''' INPUTS a: 1x2 ndarray x-interval b: 1x2 ndarray y-interval ''' fig=None if ax is None: fig,ax = pyplot.subplots(figsize=figsize) if grid: ax.grid() ax.fill_between(x=[a[0],a[1]], y1=[b[0],b[0]], y2=[b[1],b[1]],facecolor=facecolor,edgecolor=edgecolor,alpha=alpha,label=label,zorder=zorder) return fig,ax
def plot_ecdf(x_:ndarray,ax:pyplot=None,figsize:tuple=FIGSIZE,fontsize:int=FONTSIZE,grid:bool=False, xlabel:str='x', ylabel:str='y', lw:int=1,color:str=None,dots_marker:str=None,dots_color:str='red',dots_size:float=10, zorder:float=None, plot_data_ticks:bool=True, plot_data_dots:bool=True) -> pyplot: x = dataseries(x_).value fig=[] if ax is None: fig,ax = pyplot.subplots(figsize=figsize) if grid: ax.grid() ax.set_xlabel(xlabel,fontsize=fontsize) ax.set_ylabel(ylabel,fontsize=fontsize) ax.tick_params(direction='out', grid_alpha=0.5, labelsize='large') x1,y1 = stairs(x) ax.plot(x1,y1,color=color,zorder=zorder,lw=lw) if plot_data_ticks: ax.scatter(x,[0]*len(x),marker='|',s=200) # https://matplotlib.org/stable/api/markers_api.html x2,p=ecdf(x) if plot_data_dots: ax.scatter(x2,p,s=dots_size,color=dots_color,marker=dots_marker,zorder=zorder) return fig, ax
def _set_grid(cls, p: plt) -> plt: p.grid(True)