What do you want to save?
Add Code snippet
New code examples
-
Python 2021-10-05 07:34:04
how to change the colour of axes in matplotlin
import matplotlib.pyplot as plt with plt.rc_context({'axes.edgecolor':'orange', 'xtick.color':'red', 'ytick.color':'green', 'figure.facecolor':'white'}): # Temporary rc parameters in effect fig, (ax1, ax2) = plt.subplots(1,2) ax1.plot(range(10... Add solution -
Python 2021-10-04 21:53:03
matplotlib title
import matplotlib.pyplot as plt plt.title('TITLE') Add solution -
Other 2021-10-03 21:09:05
show multiple matplotlib images
import numpy as np import matplotlib.pyplot as plt w = 10 h = 10 fig = plt.figure(figsize=(8, 8)) columns = 4 rows = 5 for i in range(1, columns*rows +1): img = np.random.randint(10, size=(h,w)) fig.add_subplot(rows, columns, i) plt.imshow(im... Add solution -
Other 2021-10-03 20:34:06
height and width of colorbar
import matplotlib.pyplot as plt from mpl_toolkits.axes_grid1 import make_axes_locatable import numpy as np plt.figure() ax = plt.gca() im = ax.imshow(np.arange(100).reshape((10,10))) # create an axes on the right side of ax. The width of cax will be 5% ... Add solution -
Python 2021-10-02 15:03:04
how to place a plot in a tkinter frame
from tkinter import * from pandas import * from math import sin import matplotlib.pyplot as plt from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg # Data for plot df = DataFrame({'A': range(20), 'B': [sin(i) for i in range(20... Add solution -
Python 2021-10-01 03:02:02
plot histogram python
import matplotlib.pyplot as plt data = [1.7,1.8,2.0,2.2,2.2,2.3,2.4,2.5,2.5,2.5,2.6,2.6,2.8, 2.9,3.0,3.1,3.1,3.2,3.3,3.5,3.6,3.7,4.1,4.1,4.2,4.3] #this histogram has a range from 1 to 4 #and 8 different bins plt.hist(data, range=(1,4), bins=8) plt... Add solution