Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

plt.scatter background color

# plt background color
# make data
import matplotlib.pyplot as plt
from sklearn.datasets import make_blobs
X, y = make_blobs(n_samples=50, n_features=2, random_state=0)
y = y.reshape((y.shape[0], 1))

# plot
plt.style.use('dark_background')
plt.scatter(X[:,0], X[:, 1], c=y, cmap='summer')
plt.show()
Comment

plt.scatter set color in rgb

X = [0, 1, 2]
Y = [0, 1, 2]
Z = [0, 1, 2]
C = np.array([[255, 0, 0], [0, 255, 0], [0, 0, 255]])
fig = plt.figure()
ax = fig.add_subplot(111, projection = '3d')

ax.scatter(X, Y, Z, c = C/255.0)
plt.show()
Comment

plt.scatter background color

import matplotlib.pyplot as plt

a = random(100)*10
b = range(100)
fig = plt.figure(1)
ax = fig.add_subplot(111, axisbg='black')
ax.scatter(a,b)
fig.canvas.draw()
Comment

PREVIOUS NEXT
Code Example
Python :: pip install 
Python :: how to step or only print every two element of list python 
Python :: how to draw dendrogram in python 
Python :: python requests insecure request warning 
Python :: flask add_url_rule 
Python :: python pandas dataframe conditional subset 
Python :: exception handling in tkinter 
Python :: how to remove last item from list python 
Python :: float python 
Python :: insert function in list 
Python :: mac big sur and python3 problems 
Python :: normalizer in sklearn 
Python :: image hashing 
Python :: pandas sum group by 
Python :: generate table python 
Python :: torch.stack 
Python :: how to make simple login in python 
Python :: ValueError: only one element tensors can be converted to Python scalars 
Python :: get midnight of current day python 
Python :: from random input python 
Python :: Python DateTime Date Class Example 
Python :: python count how many times a word appears in a string 
Python :: global array python 
Python :: pandas find fifth caracter in field and change cell based on that number 
Python :: pip vs conda 
Python :: Python NumPy delete Function Syntax 
Python :: python function create null matrix 
Python :: convert hex rgb to matplotlib color 
Python :: How to Access Items in a Set in Python 
Python :: docstring in python 
ADD CONTENT
Topic
Content
Source link
Name
8+8 =