当前位置: 首页>>代码示例>>PHP>>正文


PHP PHPlot::SetXTickAnchor方法代码示例

本文整理汇总了PHP中PHPlot::SetXTickAnchor方法的典型用法代码示例。如果您正苦于以下问题:PHP PHPlot::SetXTickAnchor方法的具体用法?PHP PHPlot::SetXTickAnchor怎么用?PHP PHPlot::SetXTickAnchor使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PHPlot的用法示例。


在下文中一共展示了PHPlot::SetXTickAnchor方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: prif

# Printing helper
function prif($name, &$var, $before = '')
{
    return "{$before} {$name}=" . (isset($var) ? $var : "n/a");
}
# Auto title:
$title = 'X/Y Tick Anchors' . (empty($subtitle) ? "\n" : " - {$subtitle}\n") . prif('X tick anchor', $x_tick_anchor) . prif('Y tick anchor', $y_tick_anchor, ',') . prif('X tick inc.', $x_tick_step, ',') . prif('Y tick inc.', $y_tick_step, ',');
$data = array();
for ($x = $start; $x <= $stop; $x += $delta) {
    $data[] = array('', $x, $x);
}
$plot = new PHPlot(800, 600);
$plot->SetTitle($title);
$plot->SetPlotType('lines');
$plot->SetDataType('data-data');
$plot->SetDataValues($data);
$plot->SetDrawXGrid(True);
$plot->SetDrawYGrid(True);
if (isset($x_tick_step)) {
    $plot->SetXTickIncrement($x_tick_step);
}
if (isset($y_tick_step)) {
    $plot->SetYTickIncrement($y_tick_step);
}
if (isset($x_tick_anchor)) {
    $plot->SetXTickAnchor($x_tick_anchor);
}
if (isset($y_tick_anchor)) {
    $plot->SetYTickAnchor($y_tick_anchor);
}
$plot->DrawGraph();
开发者ID:myfarms,项目名称:PHPlot,代码行数:31,代码来源:tickanchor.php

示例2: array

    $tp = array();
}
$tp = array_merge(array('c' => 10, 't' => 1, 'ar' => FALSE), $tp);
require_once 'phplot.php';
# Extract all test parameters as local variables:
extract($tp);
$title = "Log/Log Axis Test\nPlotting: XY = {$c}\n" . "Tick step: " . (empty($t) ? "Auto" : $t) . ", " . "Range: " . ($ar ? "Auto" : "Manually set");
# Plot X*Y=C
$data = array();
for ($x = 1; $x <= $c; $x++) {
    $data[] = array('', $x, $c / $x);
}
$p = new PHPlot(800, 600);
$p->SetDataType('data-data');
$p->SetDataValues($data);
$p->SetTitle($title);
$p->SetXScaleType('log');
$p->SetYScaleType('log');
if (empty($t)) {
    $p->SetXTickIncrement($t);
    $p->SetYTickIncrement($t);
}
if (!$ar) {
    $p->SetPlotAreaWorld(0, 1, $c + 1, $c + 1);
}
$p->SetXTickAnchor(0);
$p->SetYTickAnchor(0);
$p->SetDrawXGrid(True);
$p->SetDrawYGrid(True);
$p->SetPlotType('lines');
$p->DrawGraph();
开发者ID:myfarms,项目名称:PHPlot,代码行数:31,代码来源:range-log.php

示例3: reduce_data

{
    $n = count($row);
    $p = $k * ($n - 1);
    if ($p == (int) $p) {
        return $row[$p];
    }
    return ($row[(int) $p] + $row[(int) ($p + 1)]) / 2;
}
# Convert the experimental results to a PHPlot data array.
function reduce_data($results)
{
    $data = array();
    foreach ($results as $label => $row) {
        $n_samples = count($row);
        sort($row);
        $data[] = array("{$label}\n({$n_samples} Samples)", $row[0], kpercentile($row, 0.25), kpercentile($row, 0.5), kpercentile($row, 0.75), $row[$n_samples - 1]);
        // Maximum
    }
    return $data;
}
$plot = new PHPlot(800, 600);
$plot->SetTitle('Box Plot (without outliers)');
$plot->SetDataType('text-data');
$plot->SetDataValues(reduce_data($results));
$plot->SetPlotType('boxes');
# These 2 lines make tick marks line up with text-data data points:
$plot->SetXTickIncrement(1);
$plot->SetXTickAnchor(0.5);
$plot->SetImageBorderType('plain');
// Improves presentation in the manual
$plot->DrawGraph();
开发者ID:myfarms,项目名称:PHPlot,代码行数:31,代码来源:ex-boxplot1.php

示例4: PHPlot

    $range = "{$xmin} : {$xmax}";
}
$title = "Date/time X Auto-Range Test: [{$range}]";
if (isset($mintick)) {
    $title .= "\nX Min Ticks = {$mintick}";
}
if (isset($xtickinc)) {
    $title .= "\nX Tick Increment = {$xtickinc}";
}
if (isset($tickanchor)) {
    $title .= "\nX Tick Anchor = {$tickanchor}";
}
$p = new PHPlot(800, 800);
$p->SetTitle($title);
$p->SetDataType('data-data');
$p->SetDataValues($data);
$p->SetXDataLabelPos('none');
$p->SetPlotType('lines');
# Format labels as date/time:
$p->SetXLabelType('time', $dtformat);
$p->SetXLabelAngle(90);
if (isset($mintick)) {
    $p->TuneXAutoTicks($mintick);
}
if (isset($tickanchor)) {
    $p->SetXTickAnchor($tickanchor);
}
if (isset($xtickinc)) {
    $p->SetXTickIncrement($xtickinc);
}
$p->DrawGraph();
开发者ID:myfarms,项目名称:PHPlot,代码行数:31,代码来源:range-datex.php

示例5: points

<?php

# $Id$
# Testing phplot - Tick marks at data points (requires phplot >= 5.4.0)
require_once 'phplot.php';
$data = array();
for ($i = 0; $i < 20; $i++) {
    $data[] = array("Pt:{$i}", $i * $i);
}
$p = new PHPlot(800, 600);
$p->SetTitle('X Tick Mark and Data Label Alignment');
$p->SetDataType('text-data');
$p->SetDataValues($data);
$p->SetPlotType('lines');
$p->SetXTickIncrement(1);
$p->SetXTickAnchor(0.5);
$p->SetDrawXGrid(True);
$p->SetPlotAreaWorld(0.5);
$p->DrawGraph();
开发者ID:myfarms,项目名称:PHPlot,代码行数:19,代码来源:ticksatdata.php


注:本文中的PHPlot::SetXTickAnchor方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。