What do you want to save?
Add Code snippet
New code examples
-
TypeScript 2021-09-25 14:45:07
add dots to line matplotlib
#Python, matplotlib from matplotlib import pyplot as plt #Create the regular line graph with plt.plot, then add the marker argument. plt.plot(df["col1"], marker='o') #Example of a few markers: - solid line style -- ... Add solution -
Python 2021-09-25 13:01:03
animate time series python
import numpy as np import matplotlib.pyplot as plt from matplotlib import animation dt = 0.01 tfinal = 1 x0 = 0 sqrtdt = np.sqrt(dt) n = int(tfinal/dt) xtraj = np.zeros(n+1, float) trange = np.linspace(start=0,stop=tfinal ,num=n+1) xtraj[0] = x0 for i ... Add solution -
Python 2021-09-24 23:31:02
matplotlib label axis
# Basic syntax: plt.xlabel("X axis label") # Add ", fontsize = #" to control fontsize plt.ylabel("Y axis label") # Example usage: plt.plot(range(5)) plt.xlabel("X axis label") plt.ylabel("Y axis label") p... Add solution -
Python 2021-09-22 14:23:04
how to plot a linear equation in matplotlib
import matplotlib.pyplot as plt import numpy as np x = np.linspace(-5,5,100) y = 2*x+1 plt.plot(x, y, '-r', label='y=2x+1') plt.title('Graph of y=2x+1') plt.xlabel('x', color='#1C2833') plt.ylabel('y', color='#1C2833') plt.legend(loc='upper left') plt.gri... Add solution -
Python 2021-09-21 12:42:03
ego vehicle coord system parallel to world z plane nuscenes
""" This code is to sort out a reply to https://github.com/nutonomy/nuscenes-devkit/issues/122 """ import numpy as np import matplotlib.pyplot as plt from pyquaternion import Quaternion from nuscenes import NuScenes GLOBA... Add solution -
Python 2021-09-21 03:02:02
how to make a scatter plot matrix iris flower dataset
import matplotlib.pyplot as plt from sklearn.datasets import load_iris import numpy as np #setting the shape of the figure in one line as opposed to creating 12 variables fig, subs = plt.subplots(4,3) #code given in Hyperion notes iris = load_iris() d... Add solution -
Python 2021-09-19 22:23:03
ax.legend place legend outside plot
import numpy as np import matplotlib.pyplot as plt #Define arrays x, y1, y2, y3 fig = plt.figure() ax = fig.add_axes((0.1,0.4,0.5,0.5)) ax.plot(x1,y1,linestyle='-',label='one') ax.plot(x1,y2,linestyle='--',label='two') ax.plot(x1,y3,linestyle='dotted',... Add solution