plotly / plotly/plotly.py

rendering problems with mesh3d and logarithmic zaxis

オープン
#3,674 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

bug P3
主要言語
Python
スター
18.8k
フォーク
2.8k
平均マージ
16時間 26分
マージ済み PR(30日)
21

説明

I'm trying to visualize a 3D bar chart, in which I need a logarithmic z-axis. However, I've stumbled upon a rendering problem: only the top size of the cube is rendered.

import numpy as np
import plotly.graph_objects as go

Percentage_Differences_1 = np.array([ [7.94*(10**-10),7.94*(10**-9),7.94*(10**-8),7.94*(10**-7),7.94*(10**-6),7.94*(10**-5)],
                                [7.92*(10**-12),7.92*(10**-11),7.92*(10**-10),7.92*(10**-9),7.92*(10**-8),7.92*(10**-7)],
                                [7.72*(10**-14),7.72*(10**-13),7.72*(10**-12),7.72*(10**-11),7.72*(10**-10),7.72*(10**-9)],
                                [5.66*(10**-16),5.66*(10**-15),5.66*(10**-14),5.66*(10**-13),5.66*(10**-12),5.66*(10**-11)],
                                [1.49*(10**-17),1.49*(10**-16),1.49*(10**-15),1.49*(10**-14),1.49*(10**-13),1.49*(10**-12)],
                                [2.21*(10**-18),2.21*(10**-17),2.21*(10**-16),2.21*(10**-15),2.21*(10**-14),2.21*(10**-13)] ])

bar_verts = np.array([[0, 0, 0, 1],
[1, 0, 0, 1],
[1, 1, 0, 1],
[0, 1, 0, 1],
[0, 0, 1, 1],
[1, 0, 1, 1],
[1, 1, 1, 1],
[0, 1, 1, 1]], dtype=float).T
def translate(x, y, z):
    d = np.eye(4, dtype=float)
    d[:, -1] = [x, y, z, 1]
    return d
def scale(sx, sy, sz):
    d = np.eye(4, dtype=float)
    d[np.diag_indices(4)] = [sx, sy, sz, 1]
    return d

meshes = []
for xc in range(1,6):
    for yc in range(1,6):
        verts = np.matmul(translate(xc, yc, 0), bar_verts)
        verts = np.matmul(scale(1, 1, Percentage_Differences_1[xc][yc]), verts)

        x = verts[0, :]
        y = verts[1, :]
        z = verts[2, :]
        
        meshes.append(
            go.Mesh3d(
                x=x, y=y, z=z,
                # i, j and k give the vertices of triangles
                i = [7, 0, 0, 0, 4, 4, 6, 6, 4, 0, 3, 2],
                j = [3, 4, 1, 2, 5, 6, 5, 2, 0, 1, 6, 3],
                k = [0, 7, 2, 3, 6, 7, 1, 1, 5, 5, 7, 6],
                flatshading = True
            )
        )
fig = go.Figure(data=meshes, layout={
    "scene": {
        "zaxis": {
            "type": "log"
        }
    }
})
fig

Here is a screenshot: on the left, linear z axis. On the right, logarithmic z axis.
newplot

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

提供された Python 例を plotly.graph_objects.Mesh3d で再現し、線形 z-axis と対数 z-axis の描画を比較します。まず、対数の scene axes を使用した Mesh3d のレンダリングを追跡します。3D バーの完全なセットが対数 z-axis で正しくレンダリングされ、線形軸の動作が維持されていれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
python
領域
data-visualization
issue の種類
バグ
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
35/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。