示例#1
0
文件: Graph.cpp 项目: rrnntt/plugins
void Graph::setYAxisScale(double min, double max, bool keepRatio)
{
  setAxisScale(yLeft,min,max);
  setAxisScale(yRight,min,max);
  if (keepRatio)
  {
    double dx = getXEnd() - getXStart();
    double dy = getYEnd() - getYStart();
    double ratio = dy / dx;
    dy = max - min;
    dx = dy / ratio / 2;
    double x = (getXEnd() + getXStart()) / 2;
    setXAxisScale(x - dx, x + dx, false);
  }
}
示例#2
0
文件: Graph.cpp 项目: rrnntt/plugins
void Graph::setXAxisScale(double min, double max, bool keepRatio)
{
  setAxisScale(xBottom,min,max);
  setAxisScale(xTop,min,max);
  if (keepRatio)
  {
    double dx = getXEnd() - getXStart();
    double dy = getYEnd() - getYStart();
    double ratio = dy / dx;
    dx = max - min;
    dy = dx * ratio / 2;
    double y = (getYEnd() + getYStart()) / 2;
    setXAxisScale(y - dy, y + dy, false);
  }
} 
示例#3
0
double AlnusPhyolgeticBranch::getXChild() const
{
    return getXEnd();
}