| 54 | } |
| 55 | |
| 56 | void Plot1DWidget::recalculateAxes_() |
| 57 | { |
| 58 | // set names |
| 59 | x_axis_->setLegend(string(canvas()->getMapper().getDim(DIM::X).getDimName())); |
| 60 | y_axis_->setLegend(string(canvas()->getMapper().getDim(DIM::Y).getDimName())); |
| 61 | |
| 62 | // determine which is the gravity axis (usually equals intensity axis (for LOG mode)) |
| 63 | AxisWidget* other_axis = x_axis_; |
| 64 | AxisWidget* int_axis = y_axis_; |
| 65 | // in the unusual case: gravity is on X axis |
| 66 | if (canvas()->getGravitator().getGravityAxis() == DIM::X) |
| 67 | { |
| 68 | swap(other_axis, int_axis); |
| 69 | //vis_area_xy.swapDimensions(); |
| 70 | //all_area_xy.swapDimensions(); |
| 71 | } |
| 72 | // from now on, we can assume X-dim = data; Y-dim = gravity=intensity |
| 73 | |
| 74 | // deal with log scaling for intensity axis |
| 75 | int_axis->setLogScale(canvas()->getIntensityMode() == PlotCanvas::IM_LOG); |
| 76 | |
| 77 | // use visible area. Its the only authority! |
| 78 | const auto& xy_ranges = canvas()->getVisibleArea().getAreaXY(); |
| 79 | |
| 80 | x_axis_->setAxisBounds(xy_ranges.minX(), xy_ranges.maxX()); |
| 81 | y_axis_->setAxisBounds(xy_ranges.minY(), xy_ranges.maxY()); |
| 82 | |
| 83 | // assume flipped-y-axis is identical |
| 84 | flipped_y_axis_->setLegend(y_axis_->getLegend()); |
| 85 | flipped_y_axis_->setLogScale(y_axis_->isLogScale()); |
| 86 | flipped_y_axis_->setAxisBounds(y_axis_->getAxisMinimum(), y_axis_->getAxisMaximum()); |
| 87 | } |
| 88 | |
| 89 | Plot1DWidget::~Plot1DWidget() |
| 90 | { |
nothing calls this directly
no test coverage detected