Comments (22)
It seems to work fine this way
from pyvista-support.
I was experiencing the same issue. Tried researching a bit and used %matplotlib qt
before the scene. Works fine for me. I am quite new to Python so this may not be a great solution, but it works fine!
from pyvista-support.
I'll close this since it has been taken care of by pyvista/pyvista#502
The fix is now available in the version 0.23.0 of pyvista !
from pyvista-support.
Can you provide code to reproduce this?
Sent with GitHawk
from pyvista-support.
This is the code producing the error:
I tired restarting the kernal and the same thing happens every time...
@interact_calc(holes='Enter file path', blocks='Enter file path')
def selection(holes, blocks):
with out:
clear_output()
if blocks != 'Enter file path':
grid = pv.read(blocks+'.vtk')
H = pv.read(holes+'.vtk')
h = widgets.SelectMultiple(options=DH['Name'],description='Drillholes',disabled=False)
print('Specific Query')
@interact_calc(select=dh,regex='Enter selection')
def plot(select,regex):
with out:
clear_output()
if regex != 'Enter selection':
extracted = query(H,'Name',regex)
else:
extracted = query(H,'Name',select)
print(extracted)
@interact_calc(savename = 'Enter extracted drillholes name')
def plot(savename):
with out:
clear_output()
extracted.save(savename+'.vtk')
print('saved')
p = pv.Plotter()
surface = extracted.extract_surface() # Extract the outer surface
cells = surface.cell_centers() # Grabb the cell centers
p.add_mesh(extracted, show_edges=True)
p.add_point_labels(cells, cells.active_scalar_name)
p.remove_scalar_bar()
if blocks != 'Enter file path':
p.add_mesh(grid)
p.show()
from pyvista-support.
I have a feeling this has to do with the fact that you have two plot
functions in your namespace... try renaming the second one.
from pyvista-support.
So I fixed this, and still the same issue...
from pyvista-support.
I cannot reproduce anything from what you shared... can you provide a simplified, reproducible example?
Also, maybe screen captures of what you're experiencing? And a more detailed explanation of this phenomena...
from pyvista-support.
Here is a more simplified code where I receive the same issue...
I have attached a screen capture of the issue I am seeing. (I just realized)
import pyvista as pv
DH = pv.read('sample_drillholes.vtk')
p = pv.Plotter(notebook = False)
p.add_mesh(DH, show_edges=True)
p.remove_scalar_bar()
p.show()
from pyvista-support.
I just realized my gif didn't come out right...
from pyvista-support.
Huh that’s very strange. Can you share a report from that same notebook:
import pyvista as pv
print(pv.Report())
Sent with GitHawk
from pyvista-support.
See below:
--------------------------------------------------------------------------------
Date: Thu Aug 22 10:40:16 2019 Eastern Daylight Time
Windows : OS
4 : CPU(s)
AMD64 : Machine
64bit : Architecture
11.7 GB : RAM
Jupyter : Environment
Python 3.7.3 (default, Apr 24 2019, 15:29:51) [MSC v.1915 64 bit (AMD64)]
0.22.0 : pyvista
8.1.2 : vtk
1.16.4 : numpy
2.5.0 : imageio
1.4.3 : appdirs
0.4.3 : scooby
3.1.0 : matplotlib
Version unknown : PyQt5
7.6.1 : IPython
7.5.0 : ipywidgets
1.0.0 : colorcet
Intel(R) Math Kernel Library Version 2019.0.4 Product Build 20190411 for
Intel(R) 64 architecture applications
from pyvista-support.
And you noticed this only after upgrading to version 0.22.0
?
Sent with GitHawk
from pyvista-support.
This was never an issue until just recently...
from pyvista-support.
Would you please also run the same code from a Python interpreter on the command line to see if it happens there too?
Sent with GitHawk
from pyvista-support.
That's good to hear it is at least working from the command line.
I'll investigate a bit further to see if I can reproduce this - currently I have no idea why you are experiencing this issue in Jupyter notebooks.
In that same notebook where the issue appears, could you print the following:
import pyvista as pv
print('OFF_SCREEN: ', pv.OFF_SCREEN)
from pyvista-support.
I receive this:
OFF_SCREEN: False
I've tried creating new notebooks, reinstalling PyVista and I get the same issue every time
from pyvista-support.
very, very strange. Try this snippet as well just in case...
import pyvista as pv
DH = pv.read('sample_drillholes.vtk')
p = pv.Plotter(notebook=False, off_screen=False)
p.add_mesh(DH, show_edges=True)
p.remove_scalar_bar()
p.show()
from pyvista-support.
And then try this.... with the auto_close
flag
import pyvista as pv
DH = pv.read('sample_drillholes.vtk')
p = pv.Plotter(notebook=False, off_screen=False)
p.add_mesh(DH, show_edges=True)
p.remove_scalar_bar()
p.show(auto_close=False)
from pyvista-support.
In the first one, the same things happen. The second one works fine, although if I run the first one, and then run the second one after it crashes and the kernel dies.
from pyvista-support.
@laserman781, are you still experiencing this issue?
from pyvista-support.
Thanks, @rgangrade! That's a weird fix, so I'll have to take a look at what's going on there
from pyvista-support.
Related Issues (20)
- create uniform mesh HOT 3
- Change the orientation of a scalar bar's title
- Applying textures on models from .obj files HOT 6
- How to create an Unstructured grid from points and faces HOT 2
- Type of data, plotting with glyphs HOT 3
- Controlling the thickness and orientation of a slice in Pyvista HOT 3
- Controlling the image position in window, without any click
- Mask/Remove Voxels in Air (small intersection with surface) HOT 3
- custom slider parameters
- running pyvista on headless machine with Centos OS HOT 1
- Seismic Horizon with Pyvista HOT 8
- Algorithm in sample function?
- Automatically updates HOT 3
- Slow interaction HOT 1
- read from text HOT 4
- Uniform Grid thresholding question HOT 8
- Take data by an input x,y,x coordinate (csv file) from vtk data file HOT 4
- Program broke when creating a mesh using pv.PolyData() HOT 4
- ATTENTION: Please move questions to PyVista's Discussions HOT 1
- plotter.enable_terrain_style not working for me HOT 2
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-support.