Example #1
0
TEST(FloodPlot, MatrixFloodPlotDataCountourLevels)
{
  Matrix matrix(10,10);
  for (unsigned i = 0; i < 10; ++i){
    for (unsigned j = 0; j < 10; ++j){
      matrix(i,j) = 10*i+j;
    }
  }
  Vector contourLevels(5);
  contourLevels(0) = 0;
  contourLevels(1) = 25;
  contourLevels(2) = 50;
  contourLevels(3) = 75;
  contourLevels(4) = 100;

  MatrixFloodPlotData::Ptr data = MatrixFloodPlotData::create(matrix);
  data->interpMethod(LinearInterp);

  FloodPlot::Ptr fp = FloodPlot::create();
  fp->floodPlotData(data);
  fp->contourLevels(contourLevels);
  fp->colorMapRange(45,75);
  fp->showContour(true);
  
  fp->generateImage(toPath("testMatrixFloodPlotDataCountourLevels.png"));

  // passes the visual test
  EXPECT_TRUE(true);
};
Example #2
0
TEST(FloodPlot, MatrixFloodPlotData)
{
  Matrix matrix(10,10);
  for (unsigned i = 0; i < 10; ++i){
    for (unsigned j = 0; j < 10; ++j){
      matrix(i,j) = 10*i+j;
    }
  }

  MatrixFloodPlotData::Ptr data = MatrixFloodPlotData::create(matrix);

  FloodPlot::Ptr fp = FloodPlot::create();
  fp->floodPlotData(data);
  fp->generateImage(toPath("testMatrixFloodPlotData.png"));

  // passes the visual test
  EXPECT_TRUE(true);
};
Example #3
0
TEST(FloodPlot, EricDataPlot)
{
  Vector x(3); x(0) = 3; x(1) = 4; x(2) = 5;
  Vector y(3); y(0) = 0.25; y(1) = 0.5; y(2) = 0.75;
  
  Matrix m(3,3);
  m(0,0) = 1.01328e+011; m(0,1) = 1.25153e+011; m(0,2) = 1.48116e+011;
  m(1,0) = 1.06746e+011; m(1,1) = 1.32534e+011; m(1,2) = 1.52106e+011;
  m(2,0) = 1.11509e+011; m(2,1) = 1.39306e+011; m(2,2) = 1.5545e+011;
  
  MatrixFloodPlotData::Ptr data = MatrixFloodPlotData::create(x,y,m);
  //MatrixFloodPlotData::Ptr data = MatrixFloodPlotData::create(m); // this one works (still has weird solid pixel in upper right)
  data->interpMethod(LinearInterp);

  FloodPlot::Ptr fp = FloodPlot::create();
  fp->floodPlotData(data);
  fp->generateImage(toPath("testEricData.png"));

  // does not pass the visual test
  EXPECT_TRUE(true);
};
Example #4
0
TEST(FloodPlot, MatrixFloodPlotData2)
{
  Matrix matrix(10,10);
  for (unsigned i = 0; i < 10; ++i){
    for (unsigned j = 0; j < 10; ++j){
      matrix(i,j) = 10*i+j;
    }
  }

  Vector xVector(linspace(-100, 0, 10));
  Vector yVector(linspace(0, 100, 10));
  MatrixFloodPlotData::Ptr data = MatrixFloodPlotData::create(xVector, yVector, matrix);
  data->interpMethod(LinearInterp);

  FloodPlot::Ptr fp = FloodPlot::create();
  fp->floodPlotData(data);
  fp->bottomAxisTitle("X axis");
  fp->leftAxisTitle("Y axis");
  fp->generateImage(toPath("testMatrixFloodPlotData2.png"));

  // passes the visual test
  EXPECT_TRUE(true);
};