epezent / implot

Immediate Mode Plotting
MIT License
4.65k stars 517 forks source link

Centre Screen #398

Closed aDioS786 closed 2 years ago

aDioS786 commented 2 years ago

Hi, I've been trying to do a centre screen on another key press, so far if double click is it, it automatically move plot focus to centre. Do we have a api call which we can call to focus/move to centre of screen? Thanks

epezent commented 2 years ago
// Set an upcoming axis to auto fit to its data.
IMPLOT_API void SetNextAxisToFit(ImAxis axis);

// Sets all upcoming axes to auto fit to their data.
IMPLOT_API void SetNextAxesToFit();

You can use these functions to trigger a fit for the upcomming plot. Call before BeginPlot if the user presses the desired key.

aDioS786 commented 1 year ago
SetNextAxisToFit

Many Thanks, epezent, is there a way to reset the axis/axes to fit to given plotted coordinates? Say we have plotted several data on graph and i scroll right of graph say 2150, 1850 (x,y), from that point if I like to move the graph or focus on to Data 1 (which is plotted somewhere 250,250 coordinates, do we have any api to do this? Thanks