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 can I show two CvPlot windows at the same time? #38

Open
rolly-ng opened this issue Nov 1, 2023 · 0 comments
Open

How can I show two CvPlot windows at the same time? #38

rolly-ng opened this issue Nov 1, 2023 · 0 comments

Comments

@rolly-ng
Copy link

rolly-ng commented Nov 1, 2023

Hi, I am trying to show two windows at the same time, one is for the data and the other is for the histogram of data. Now I can only show the first window and if I close the first, then the second window appears. Thanks!

auto axes_1 = CvPlot::makePlotAxes();
axes_1.create<CvPlot::Series>(xdata, cv_tdata, "-g").setName("Data");	
sprintf(windowname, "Pixel phase at (v%ld, h%ld)", tdata_v, tdata_h);	
axes_1.title(windowname);
axes_1.create<Legend>()._parentAxes = &axes_1;
cv::Mat mat_1 = axes_1.render(300, 400); //plot to a cv::Mat
CvPlot::show("Sensorgram", axes_1);       //or show the 1st with interactive viewer

auto axes_2 = CvPlot::makePlotAxes();
axes_2.create<CvPlot::Series>(hdata_range, hdata_count, "-b").setName("Histogram");	
sprintf(windowname, "Pixel histogram at (v%ld, h%ld)", tdata_v, tdata_h);	
axes_2.title(windowname);
axes_2.create<Legend>()._parentAxes = &axes_2;
cv::Mat mat_2 = axes_2.render(700, 400); //plot to a cv::Mat
CvPlot::show("Historgram", axes_2);         //or show the 2nd with interactive viewer
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