import matplotlib.pyplot as plt from matplotlib import font_manager, rc f_name = font_manager.FontProperties(fname='C:/Windows/Fonts/HANBatangExt.ttf').get_name() rc('font', family=f_name) 뛰기운동
plt.plot(run_before, run_after, 'ro-') 걷기운동
plt.plot(walk_before, walk_after, 'bo-') plt.figure(figsize=((10,8))) plt.show() 3 Answers
It is not an error but the output you see is due to the fact that you have used
plt.figure(figsize=((10,8))) after plt.plot. Therefore, you first get a figure on you screen and a figure object is created by plt.figure. To get rid of it, you should first set the figure size before plotting, something like this:
plt.figure(figsize=((10,8))) plt.plot(run_before, run_after, 'ro-') plt.plot(walk_before, walk_after, 'bo-') plt.show() There are other ways to set the figure size after plotting but since your code is fine enough, you are good to go with the above modification.
0It's not an Error it shows your figure dimensions. If you want to get rid of it try using rcParams parameter
plt.rcParams["figure.figsize"] = (10,8) It is not the error just a message that an image file is returned
If you are using the VS_code then
- Click on the left side little code icon
- Select Image/Png option this will make your graph visible
If you havent seleced the Image/Png option then you might not be able to see the output
