import matplotlib.pyplot as plt
import numpy as npn =1024
X = np.random.normal(0,1,n)
Y = np.random.normal(0,1,n)
T = np.arctan2(Y,X)#用于計算顏色plt.scatter(X,Y,s=75,c=T,alpha=0.5)#alpha是透明度#plt.scatter(np.arange(5),np.arange(5)) #一條線的散點圖plt.xlim((-1.5,1.5))
plt.ylim((-1.5,1.5))
plt.xticks(())#把x坐標刻度去掉
plt.yticks(())
plt.show()
import matplotlib.pyplot as plt
import numpy as npdeff(x,y):return(1+ x /2+ x**5+ y**3)*np.exp(-x**2-y**2)#隨機高度公式n =256
x = np.linspace(-3,3,n)
y = np.linspace(-3,3,n)
X,Y = np.meshgrid(x,y)#網格的輸入()等高線地圖是個網格plt.contourf(X,Y,f(X,Y),8,alpha =0.75,cmap = plt.cm.hot)#plt.cm.hot是將數值轉換為顏色,8代表背景分成n+2類
C = plt.contour(X,Y,f(X,Y),8,colors='black',linewidths=.5)#等高線的繪制,8代表分成n+2類(多少個等高線)
plt.clabel(C,inline=True,fontsize =10)#標簽plt.xticks(())
plt.yticks(())
plt.show()
3.4 image圖片
import matplotlib.pyplot as plt
import numpy as np# image data
a = np.array([0.313660827978,0.365348418405,0.423733120134,0.365348418405,0.439599930621,0.525083754405,0.423733120134,0.525083754405,0.651536351379]).reshape(3,3)plt.imshow(a, interpolation='nearest', cmap='bone', origin='lower')#lower是遞增,upper是遞減
plt.colorbar(shrink=.92)#壓縮了到原來的0.92plt.xticks(())
plt.yticks(())
plt.show()
3.5 3D數據
import matplotlib.pyplot as plt
import numpy as np
from mpl_toolkits.mplot3d import Axes3Dfig = plt.figure()
ax = Axes3D(fig)#3D坐標軸X = np.arange(-4,4,0.25)
Y = np.arange(-4,4,0.25)
X,Y = np.meshgrid(X,Y)
R = np.sqrt(X**2+Y**2)
Z = np.sin(R)ax.plot_surface(X,Y,Z,rstride=1,cstride=1,cmap=plt.get_cmap('rainbow'))"""
============= ================================================Argument Description============= ================================================*X*, *Y*, *Z* Data values as 2D arrays*rstride* Array row stride (step size), defaults to 10*cstride* Array column stride (step size), defaults to 10*color* Color of the surface patches*cmap* A colormap for the surface patches.*facecolors* Face colors for the individual patches*norm* An instance of Normalize to map values to colors*vmin* Minimum value to map*vmax* Maximum value to map*shade* Whether to shade the facecolors============= ================================================
"""
ax.contourf(X,Y,Z,zdir='z',offset=-2,cmap ='rainbow')#等高線
ax.set_zlim(-2,2)plt.show()
計算機科學必讀書籍Product categorization/product classification is the organization of products into their respective departments or categories. As well, a large part of the process is the design of the product taxonomy as a whole.產品分類/產品分類是將產品…
交替最小二乘矩陣分解pyspark上的動手推薦系統 (Hands-on recommender system on pyspark) Recommender System is an information filtering tool that seeks to predict which product a user will like, and based on that, recommends a few products to the users. For ex…
python 網頁編程The internet and the World Wide Web (WWW), is probably the most prominent source of information today. Most of that information is retrievable through HTTP. HTTP was invented originally to share pages of hypertext (hence the name Hypertext T…
火種 ctfOriginally published at https://www.linkedin.com on March 27, 2020 (data up to date as of March 20, 2020).最初于 2020年3月27日 在 https://www.linkedin.com 上 發布 (數據截至2020年3月20日)。 Day 3 of social distancing.社會疏離的第三天。 As I sit on…
data studioIn this guide, we describe both the theoretical and practical sides of reporting with Google Data Studio. You can use this guide as a comprehensive cheat sheet in your everyday marketing.在本指南中,我們描述了使用Google Data Studio進行…
人流量統計系統介紹Its very important to know about statistics . May you be a from a finance background, may you be data scientist or a data analyst, life is all about mathematics. As per the wiki definition “Statistics is the discipline that concerns the …
一、User: xx is not allowed to impersonate xxx 解決辦法:修改 core-site.xml 文件,加入下面的內容后重啟 hadoop。 <property><name>hadoop.proxyuser.xx.hosts</name><value>*</value>
</property><property…
樂高ev3 讀取外部數據When I was a kid, I used to love playing with Lego. My brother and I built almost all kinds of stuff with Lego — animals, cars, houses, and even spaceships. As time went on, our creations became more ambitious and realistic. There were…
數據科學 (Data Science) CitiBike is New York City’s famous bike rental company and the largest in the USA. CitiBike launched in May 2013 and has become an essential part of the transportation network. They make commute fun, efficient, and affordable — no…
r語言繪制雷達圖I’ve tried several different types of NBA analytical articles within my readership who are a group of true fans of basketball. I found that the most popular articles are not those with state-of-the-art machine learning technologies, but tho…
java 分裂數字As noted in my earlier Nightingale writings, color harmony is the process of choosing colors on a Color Wheel that work well together in the composition of an image. Today, I will step further into color theory by discussing the Split Compleme…