fist version with matplotlib