Skip to content

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

@rolly-ng

Description

@rolly-ng

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions