What do you want to save?
Add Code snippet
New code examples
-
Python 2021-10-29 16:50:16
how to read iris data in python
print(__doc__) # Code source: Gaël Varoquaux # Modified for documentation by Jaques Grobler # License: BSD 3 clause import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D from sklearn import datasets from sklearn.decomposition imp... Add solution -
TypeScript 2021-10-29 06:02:17
multiple scatter plots in python
import matplotlib.pyplot as plt fig = plt.figure() ax1 = fig.add_subplot(111) ax1.scatter(x1, y1, s = 10, c = 'b', label = 'elbow') ax1.scatter(x2, y2, s = 10, c = 'r', label = 'shoulder') plt.legend(loc='upper left'); plt.show() Add solution -
Python 2021-10-29 02:35:14
python scatter plot legend
# credit to the Stack Overflow user in the source link import matplotlib.pyplot as plt from numpy.random import random colors = ['b', 'c', 'y', 'm', 'r'] lo = plt.scatter(random(10), random(10), marker='x', color=colors[0]) ll = plt.scatter(random(10),... Add solution -
Other 2021-10-27 20:12:06
sklearn decision tree regressor
Import the necessary modules and libraries import numpy as np from sklearn.tree import DecisionTreeRegressor import matplotlib.pyplot as plt # Create a random dataset rng = np.random.RandomState(1) X = np.sort(5 * rng.rand(80, 1), axis=0) y = np.sin(X).... Add solution -
Python 2021-10-24 13:47:15
matplotlib units of scatter size
star = MarkerStyle('*') bbox = star.get_path().transformed(star.get_transform()).get_extents() star_unit_width = bbox.width star_unit_height = bbox.height plt.scatter(0, -1, marker='s', s=(xscale*desired_data_width/star_unit_width)**2) Add solution -
Python 2021-10-22 00:54:09
plot a pandas dataframe matplotlib
import pandas as pd import matplotlib.pyplot as plt df = pd.Dataframe(Data) df.plot(kind='bar',x="dataframe_1",y="dataframe_2") # bar can be replaced by # scatter or line or even left as default plt.show() Add solution
Best helpers
Ranking is empty