question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

slight change in surface opacity changes image completely

See original GitHub issue

I need to adjust the opacity of a surface, so I can overlay two surfaces on top of each other (not sure how else to do that). But on a very small change from 1 to slightly below the look of the plot changes a lot.

opacity=1 image

opacity=0.99999 image

import numpy as np
from plotly.graph_objs import Figure, Surface

x = np.array(
    [
        [0, 0, 0, 0, 0, 0, 0, 0, 0],
        [
            7.07106781e-01,
            0.5,
            4.32978028e-17,
            -0.5,
            -7.07106781e-01,
            -0.5,
            -1.29893408e-16,
            0.5,
            7.07106781e-01,
        ],
        [
            1,
            7.07106781e-01,
            6.12323400e-17,
            -7.07106781e-01,
            -1,
            -7.07106781e-01,
            -1.83697020e-16,
            7.07106781e-01,
            1,
        ],
        [
            7.07106781e-01,
            0.5,
            4.32978028e-17,
            -0.5,
            -7.07106781e-01,
            -0.5,
            -1.29893408e-16,
            0.5,
            7.07106781e-01,
        ],
        [
            1.22464680e-16,
            8.65956056e-17,
            7.49879891e-33,
            -8.65956056e-17,
            -1.22464680e-16,
            -8.65956056e-17,
            -2.24963967e-32,
            8.65956056e-17,
            1.22464680e-16,
        ],
    ]
)
y = np.array(
    [
        [0, 0, 0, 0, 0, -0, -0, -0, 0],
        [0, 0.5, 7.07106781e-01, 0.5, 8.65956056e-17, -0.5, -7.07106781e-01, -0.5, 0],
        [
            0,
            7.07106781e-01,
            1,
            7.07106781e-01,
            1.22464680e-16,
            -7.07106781e-01,
            -1,
            -7.07106781e-01,
            0,
        ],
        [0, 0.5, 7.07106781e-01, 0.5, 8.65956056e-17, -0.5, -7.07106781e-01, -0.5, 0],
        [
            0,
            8.65956056e-17,
            1.22464680e-16,
            8.65956056e-17,
            1.49975978e-32,
            -8.65956056e-17,
            -1.22464680e-16,
            -8.65956056e-17,
            0,
        ],
    ]
)
z = np.array(
    [
        [1, 1, 1, 1, 1, 1, 1, 1, 1],
        [
            7.07106781e-01,
            7.07106781e-01,
            7.07106781e-01,
            7.07106781e-01,
            7.07106781e-01,
            7.07106781e-01,
            7.07106781e-01,
            7.07106781e-01,
            7.07106781e-01,
        ],
        [
            6.12323400e-17,
            6.12323400e-17,
            6.12323400e-17,
            6.12323400e-17,
            6.12323400e-17,
            6.12323400e-17,
            6.12323400e-17,
            6.12323400e-17,
            6.12323400e-17,
        ],
        [
            -7.07106781e-01,
            -7.07106781e-01,
            -7.07106781e-01,
            -7.07106781e-01,
            -7.07106781e-01,
            -7.07106781e-01,
            -7.07106781e-01,
            -7.07106781e-01,
            -7.07106781e-01,
        ],
        [-1, -1, -1, -1, -1, -1, -1, -1, -1],
    ]
)
data = [Surface(x=x, y=y, z=z, surfacecolor=np.ones(x.shape), opacity=0.99999)]
fig = Figure(data=data)
fig.show()

sorry about the numbers, they’ve been generated by some external library

my actual use case is like this where there are weird lines appearing on the plot by setting opacity image

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
archmojcommented, Aug 6, 2020

This could possibly be fixed/improved by https://github.com/plotly/plotly.js/pull/4643. But at the moment I don’t see that PR being merged in near feature.

1reaction
archmojcommented, Aug 6, 2020

@paddyroddy could you please set the opacity to 0.25 or 0.5 and share new screenshots?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Make a picture transparent - Microsoft Support
Insert a picture in your document. On the Picture Tools Format tab, select Transparency. The Transparency menu includes seven levels of opacity to...
Read more >
Changing Transparency of Images, Patches or Surfaces
This example shows how to modify transparency of images, patches and surfaces.
Read more >
Add transparency effects to objects in Adobe InDesign
Add transparency effects to objects using opacity and blends, overlap objects, or knock out shapes behind objects in InDesign.
Read more >
Problem with reference image - Changes to alpha does not ...
Change opacity in the data properties panel transparency subpanel. enter image description here Change from object properties to data ...
Read more >
InDesign changing opacity for an unselected item
I am trying to place a slightly opaque rectangle over an image but when I select to lower the opacity on the rectangle,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found