Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to set set clip modes for gnuplot? #435

Open
1 of 5 tasks
LakshmiRagupathyMojow opened this issue Nov 30, 2024 · 0 comments
Open
1 of 5 tasks

How to set set clip modes for gnuplot? #435

LakshmiRagupathyMojow opened this issue Nov 30, 2024 · 0 comments

Comments

@LakshmiRagupathyMojow
Copy link

LakshmiRagupathyMojow commented Nov 30, 2024

Feature category

  • enhancement - build system
  • enhancement - backends
  • enhancement - build system
  • enhancement - documentation
  • enhancement - plot categories

The problem
Gnuplot by default has the clip mode set to clip one. This means line segments don't get rendered when both end points are not within the visible window. It is not possible to zoom in near the middle of a line segment and check the line.

Another bug is zooming in on a particular section causes plots far away from the zoomed area to get un-rendered. There is no way to get these plots back. Even re-plotting doesn't fix it. The only way to get the original plot is to run the code again. Enabling the other two clip options seems to fix this. Source

The solution I'd like
Would it be possible to add a convenience function to toggle this clip options? There are some functions declared void clipping(bool), but not defined in axes_type.h that were probably intended for this.

I added these commands to the void axes_type::run_commands() function and that makes the zoom function much cleaner.

//Resets all clipping rules to off
run_command("unset clip");
//Set all clipping rules to on. 
run_command("set clip points"); 
run_command("set clip one");
run_command("set clip two");

As far as I've tested, even with figures containing 100s of plots, I was able to zoom in/out, resize multiple times without losing any of the subplots.

Alternatives I've considered
I can call the axes_type::run_command() from the instantiated axes_handle() and set these variables. But, the final figure_type::show() command calls figure_type::run_figure_properties_command() which resets the figure, flushing all settings. Currently there is no way to modify clip settings from outside matplotplusplus.
Additional context

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant