
But you can close a figure programmatically by callingĬlose.

When you work with the GUI you can close a figure by clicking on the x in the Only the number of the figure is frequently changed. The defaults can be specified in the resource file and will be used most of the There are several parameters thatĭetermine what the figure looks like: ArgumentĬolor of edge around the drawing background FiguresĪre numbered starting from 1 as opposed to the normal Python way startingįrom 0.
#MATPLOTLIB SUBPLOT SCATTER WINDOWS#
Xytext=(-90, -50), textcoords='offset points', fontsize=16,Īrrowprops=dict(arrowstyle="->", connectionstyle="arc3,rad=.2"))Ī figure is the windows in the GUI that has "Figure #" as title. The annotate command to display some text with an arrow.Īx.plot(, color ='blue', linewidth=1.5, linestyle="-")Īx.scatter(, 50, color ='blue')Īx.annotate(r'$\sin(\frac$', We'll firstĭraw a marker on the curve as well as a straight dotted line. We chose theĢπ/3 value and we want to annotate both the sine and the cosine. Let's annotate some interesting points using the annotate command. linspace ( - 1, 1, 5, endpoint = True )) # Save figure using 72 dots per inch # savefig("./figures/exercice_2.png",dpi=72) # Show result on screen plt.

set_ylim ( - 1.0, 1.0 ) # Set y ticks ax. linspace ( - 4, 4, 9, endpoint = True )) # Set y limits ax. set_xlim ( - 4.0, 4.0 ) # Set x ticks ax. plot ( X, S, color = "green", linewidth = 1.0, linestyle = "-" ) # Set x limits ax. plot ( X, C, color = "blue", linewidth = 1.0, linestyle = "-" ) # Plot sine using green color with a continuous line of width 1 (pixels) ax. sin ( X ) # Plot cosine using blue color with a continuous line of width 1 (pixels) ax. subplots ( figsize = ( 8, 6 ), dpi = 80 ) X = np. # Imports import numpy as np import matplotlib.pyplot as plt # Create a new figure of size 8圆 points, using 100 dots per inch fig, ax = plt. To explore their affect (see Line properties and Line styles below).

Set to their default values, but now you can interactively play with the values That influence the appearance of the plot. In the script below, we've instantiated (and commented) all the figure settings
