What do you want to save?
Add Code snippet
New code examples
-
Python 2021-11-03 06:57:09
plot scatter python
# Import matplotlib import matplotlib.pyplot as plt # Set plot space as inline for inline plots and qt for external plots %matplotlib inline # Set the figure size in inches plt.figure(figsize=(10,6)) plt.scatter(x, y, label = "label_name" ) ... Add solution -
Python 2021-10-25 06:45:15
seaborn heatmap x labels horizontal
plt.figure(figsize=(10,10)) g = sns.heatmap( by_sport, square=True, cbar_kws={'fraction' : 0.01}, cmap='OrRd', linewidth=1 ) g.set_xticklabels(g.get_xticklabels(), rotation=45, horizontalalignment='right') g.set_yticklabels(g.get_yti... Add solution -
Python 2021-10-22 13:17:03
pandas creating multiple grid subplots
plt.figure(figsize=(10, 12)) # The first subplot plt.subplot(3, 2, 1) plt.plot(traffic_per_day['Monday']['Hour (Coded)'], traffic_per_day['Monday']['Slowness in traffic (%)']) plt.title('Monday') # The second subplot plt.subplot(3, 2, 2) plt.plo... Add solution -
Python 2021-10-19 09:15:16
scatter plot python
# Import matplotlib import matplotlib.pyplot as plt # Set plot space as inline for inline plots and qt for external plots %matplotlib inline # Set the figure size in inches plt.figure(figsize=(10,6)) plt.scatter(x, y, label = "label_name" ) ... Add solution -
Python 2021-10-18 17:13:10
how to plot labeled data with different colors
import matplotlib import matplotlib.pyplot as plt import numpy as np x = [4,8,12,16,1,4,9,16] y = [1,4,9,16,4,8,12,3] label = [0,1,2,3,0,1,2,3] colors = ['red','green','blue','purple'] fig = plt.figure(figsize=(8,8)) plt.scatter(x, y, c=label, cmap=matp... Add solution -
Python 2021-10-18 00:11:04
matplotlib bar3d
import numpy as np import matplotlib.pyplot as plt # setup the figure and axes fig = plt.figure(figsize=(8, 3)) ax1 = fig.add_subplot(121, projection='3d') ax2 = fig.add_subplot(122, projection='3d') # fake data _x = np.arange(4) _y = np.arange(5) _xx,... Add solution -
Python 2021-10-16 04:58:04
how to display the first 25 images from training dataset
plt.figure(figsize=(10,10))for i in range(25): plt.subplot(5,5,i+1) plt.xticks([]) plt.yticks([]) plt.grid(False) plt.imshow(train_images[i], cmap=plt.cm.binary) plt.xlabel(class_names[train_labels[i]])plt.show() Add solution