问题描述
我正在尝试制作一个三元轮廓图,如下图所示,该轮廓图上带有标记的轮廓线和侧面的标签:
。到目前为止,我已经能够使用Plotly来制作带有色标和标记角的三元图(请参见图片),但是对于我的论文和演示文稿,我需要使其更易于解释(因此,我想要在侧面以及/而不是在角落使用标签)并且更加精确(我觉得色标不像标签轮廓那样简单)。
我是python的新手,所以我不知道我是否只是在documentation中丢失了一些显而易见的东西,或者该库是否不可能/直接。
当我搜索“ python三元图,以轮廓标记的轮廓”时,结果中会显示我要执行的操作的缩略图,并将我链接到带有additional documentation的页面,但是图片无处可寻可以在页面上找到,有关如何标记轮廓的说明要少得多(除非我以某种方式错过了它)。
# Importing Libraries
import numpy as np
import pandas as pd
import plotly.figure_factory as ff
# Lists to be used in Plotly function
# List for each axis,made into arrays
L1 = [0.2,0.4,0.5,0.6,0.8,0.2,0.33,0.3,1,0]
L2 = [0.8,0]
L3 = [0,0.34,1]
A1 = np.asarray(A1)
A2 = np.asarray(A2)
A3 = np.asarray(A3)
# List for contour values associated with 3 axis,made into an array
L4 = [24.7,6.3,4.1,2.9,1.8,15.4,4.4,3.05,7.07,7.9,9.5,17.8,4.6,5.3,16.8,21.3,1.3,1.5,2.3,3.2,18.9,2.4,0]
A4 = np.asarray(L4)
# Ploting the data with ff.create_ternary_plot from Plotly Library
fig = ff.create_ternary_contour(np.array([A1,A2,A3]),A4,pole_labels=['A1','A2','A3'],interp_mode='cartesian',ncontours= 10,colorscale='Viridis',showscale=True,title='Example figure')
fig.show()
我愿意为不同的图书馆提供建议;我选择这个库是因为它对像我这样的初学者来说非常直观。
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)