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.

One of the main things I really miss in pyvista is the ability to make 2D plots. Sometimes a 2D plot is much easier to read than a 3D plot.

I saw vtk method to do so namely vtk.vtkChartMatrix(). It’s not the main focus of VTK to be a 2D plotting toolbox, however they have tools and they have great performance in plotting thousands (even millions) of point, compared to matplotlib. I currently subclassed the pyvistaqt.BackgroundPlotter to mimic some behavior and replaced the central-widget.

I don’t know if 2D plotting is in the scope of the project, but I already made some working code what I would possibly like to share or even add to pyvista

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:1
  • Comments:14 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
Onandon11commented, Feb 9, 2022

Thanks for your great contribution! It’s a real nice addition I think to the pyvista codebase.

However when playing with the new code I discovered that the Charts are not like the BackgroundPlotter from the pyvistaqt library. Of course that’s a bit of a whishfull thinking, so maybe that will be delivered first step for me to implement.

Maybe some cool features to implement (as a minddump for myself)

  • Reset chart
  • Get selected data (right mouse button and drag)
  • Creating subplots (maybe with the vtkChartMatrix)
  • Set aspect ratio
  • Put the Chart into a PyQt window
1reaction
dcbrcommented, Jan 18, 2022

Hi @Onandon11, Now that #1432 is merged and released I wanted to ask if there’s still something you are missing in the current implementation? I had a quick look at both examples you posted last time:

  1. I don’t think this is possible yet (unless I misunderstand what you are doing)? This might be a nice method to add to Chart2D, e.g. something called set_aspect_ratio maybe?
  2. I think (but haven’t tried it) setting the x- and y-axis behavior to ‘auto’ should reset to the default view?

Feel free to open a new PR to add these (or other) functionalities 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Geogebra - 2D Graphing
Geogebra - 2D Graphing. Author: Scott R. Franklin, Ph.D. Topic: Function Graph. GeoGebra Applet Press Enter to start activity ...
Read more >
2-D line plot - MATLAB plot - MathWorks
This MATLAB function creates a 2-D line plot of the data in Y versus the corresponding values in X.
Read more >
2D Plotting - Python Numerical Methods
The basic plotting function is plot(x,y). The plot function takes in two lists/arrays, x and y, and produces a visual display of the...
Read more >
Graphing Calculator - Desmos
Explore math with our beautiful, free online graphing calculator. Graph functions, plot points, visualize algebraic equations, add sliders, animate graphs, ...
Read more >
2D Plotting in Matlab - YouTube
This tutorial illustrates how to generate 2D plots in Matlab. Topics and timestamps:0:00 – Introduction2:35 – Using the ' plot ' command4:26 ...
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