Comments (6)
This looks suspicious to me as well. It seems like it is a bug in higher level design to me since this function takes in an ndarray
rather than a str
, so it cannot figure out whether the data is originally point or cell data in this ambiguous case. I suspect we have to pass in a definitive use_points
or similar and have logic in the calling function or a separate helper function to decide.
This bit of logic feels suspect to me:
pyvista/pyvista/plotting/mapper.py
Lines 455 to 460 in 7636dc7
from pyvista.
pyvista/pyvista/plotting/plotter.py
Lines 3492 to 3501 in e84354e
This part of the code is executed before the _configure_scalar_mode
in the mapper
gets called in the example given in the issue. One potential solution might be to reset the preference
in this part of the code based on the scalar array found. I'm also wary about the comment in this part of the code, so that is another avenue to explore
from pyvista.
I think the crux of this is that c.n_points == c.n_cells
which is somewhat of an edge case.
It looks like there is a genuine bug here. After plotting, if we repr the mesh in a Jupyter cell it looks like something in the plotting routine got confused and set a new point_data array because the length matched (which is incorect):
As an aside, this feels related to #1897
from pyvista.
This bit of logic feels suspect to me:
pyvista/pyvista/plotting/mapper.py
Lines 455 to 460 in 7636dc7
I think preference
defaults to 'point'
and this bit of logic then thinks the scalars should be on the points... some further digging is needed
from pyvista.
"This should be refactored by 0.36.0"
🤣
from pyvista.
One potential solution might be to reset the preference in this part of the code based on the scalar array found.
I think this could work! Nice find!
from pyvista.
Related Issues (20)
- add_composite temporarily rendering actor before properties applied
- Suggestion: document support for jupyter_backend='html' within Colab HOT 3
- Codespaces + Jupyter + Pyvista. No plots HOT 11
- `opacity` and `n_colors` don't work together as expected in `add_volume` HOT 4
- It would have been better to make `progress_bar` a keyword only argument everywhere HOT 3
- When drawing a scatter points spread over multiple areas, the coordinates of gird are incorrect. HOT 2
- Rendering Error with enumerated Actor Names HOT 2
- JS Error related to vue2 using Trame in Pyvista HOT 4
- Testing against VTK master branch is failing HOT 8
- Add support for pandas and polars dataframes HOT 19
- spurious `v3.0.0` tag HOT 10
- Sporadically Incorrect Registration of Clicked Points in Pyvista's "enable_surface_point_picking" Function HOT 1
- Cannot install `pyvista` with Python 3.8 on macOS with Apple silicon HOT 3
- Numpy 2.0 compatibility HOT 11
- A way to 'register' new `Theme` classes HOT 2
- ImageData.x, returns unexpected value when non-zero extent is set. HOT 1
- Change vtkCutter in slice wigets HOT 2
- Running `mypy pyvista` reports 144 type errors which are not caught by `pre-commit run mypy`
- issue with show_bounds and link_views HOT 1
- Change Active Scalars in Trame Live Plot
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pyvista.