我用代码
绘制2D曲线c = 11
x = np.arange(0, 5, 0.1)
y = np.exp(c)/x
plt.plot(x,y)
如何在z轴为x,y
时绘制一系列c
曲线?第一行将更改为
c = np.arange(1, 70, 1)
如何沿x,y
轴绘制70条z
曲线?
答案 0 :(得分:2)
你可以使用matplotlibs val monthWithIndex = Seq("Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec").zipWithIndex.toMap
val monthSim = udf( (mon : String) => {
monthWithIndex( mon.substring( 0, 3))
})
val df = session.sparkContext.parallelize( Seq("Jan2016","Feb2016","Mar2016","Jun2016")).toDF("Month")
df.withColumn("newMonth", monthSim($"Month")).orderBy("newMonth").drop("newMonth").show
,可以找到一个教程here:
Axes3D
这给出了数字: