converted plot to codemirror base