compatible version with KPlots.m