三维圆(散点)图

2024-04-29 03:21:09 发布

您现在位置:Python中文网/ 问答频道 /正文

你好,好朋友。你知道吗

我有PCA结果数据帧,我想做三维圆图使用博基赫。你知道吗

我可以很容易地做二维圆图。你知道吗

就像下面的代码。。你知道吗

  Bp_source = ColumnDataSource(data=df_PCA)

  Bp_tools = ['pan','box_select', 'wheel_zoom', 'hover', 'reset','save','help']

  Bp_TOOLTIPS = [
      ("SampleID", "@id"),
      ("(PCA1, PCA2)","(@PCA1, @PCA2)")    
              ]

  Bp_plot = figure(
      tools=Bp_tools, tooltips=Bp_TOOLTIPS,
      plot_width=500, plot_height=500,
      x_axis_label='PCA1', y_axis_label='PCA2'
  )
  Bp_plot.circle('PCA1', 'PCA2',
                 source=Bp_source,
                 size=9,
                 color='color',
                 alpha=0.3,
                 legend='legend'
                )

  show(Bp_plot)

附图为数据帧格式和二维图。 enter image description here

所以,我想用PCA1,2和3来绘制3d图。你知道吗

请分享你的精彩代码!你知道吗


Tags: 数据代码sourceplottoolslabelcolorbp