What do you want to save?
Add Code snippet
New code examples
-
Python 2021-11-16 05:52:28
python matplotlib hist set axis range
# Basic syntax: plt.ylim(min,max) plt.xlim(min,max) # Example usage: import matplotlib.pyplot as plt plt.plot(range(5)) plt.xlim(-5, 5) plt.ylim(-5, 5) # Note, this approach is more versatile than using range=[min,max] which # only works in some plots,... Add solution -
Python 2021-11-14 21:26:20
plotting graphs in keras
# Visualize training history from keras.models import Sequential from keras.layers import Dense import matplotlib.pyplot as plt import numpy # load pima indians dataset dataset = numpy.loadtxt("pima-indians-diabetes.csv", delimiter=","... Add solution -
Python 2021-11-14 14:49:14
simulate robot arm using python
import math import matplotlib.pyplot as plt l1 = 0.8 l2 = 0.5 n_theta = 10 # No of divisions theta_start = 0 # Starting angle theta_end = math.pi/2 # Ending angle theta1 = [] theta2 = [] for i in range(0,n_theta): theta1.append(theta_start+ (theta_e... Add solution -
Python 2021-11-12 09:42:20
pandas plot heatmap
import matplotlib.pyplot as plt import seaborn as sns # optional: resize images from now on plt.rcParams["figure.figsize"] = (16, 12) # numeric_only_columns is a list of columns of the DataFrame # containing numerical data only # annot = True ... Add solution -
Python 2021-11-12 01:57:14
second y axis matplotlib
import numpy as np import matplotlib.pyplot as plt x = np.arange(0, 10, 0.1) y1 = 0.05 * x**2 y2 = -1 *y1 fig, ax1 = plt.subplots() ax2 = ax1.twinx() ax1.plot(x, y1, 'g-') ax2.plot(x, y2, 'b-') ax1.set_xlabel('X data') ax1.set_ylabel('Y1 data', color='... Add solution