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


PHP PHPlot::SetXTickIncrement方法代码示例

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


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

示例1: make_plot

function make_plot($plot_type, $data_type, $nx, $ny)
{
    $plot = new PHPlot(1280, 1024);
    $plot->SetPrintImage(False);
    $plot->SetFailureImage(False);
    $plot->SetDataType($data_type);
    $plot->SetDataValues(make_data_array($plot_type, $data_type, $nx, $ny, 100));
    $plot->SetPlotType($plot_type);
    $plot->SetTitle("Serialize/Unserialize Tests\n{$plot_type} - {$data_type}");
    $plot->SetXTickIncrement(5);
    $plot->SetYTickIncrement(10);
    $plot->SetPlotBorderType('full');
    $plot->SetDrawXGrid(True);
    $plot->SetDrawYGrid(True);
    $plot->SetXTitle('X Axis Title');
    $plot->SetYTitle('Y Axis Title');
    # Select data labels or tick labels based on data type:
    if ($data_type == 'data-data') {
        $plot->SetXDataLabelPos('none');
        $plot->SetXTickLabelPos('plotdown');
        $plot->SetXTickPos('plotdown');
    } elseif ($data_type == 'text-data') {
        $plot->SetXDataLabelPos('plotdown');
        $plot->SetXTickLabelPos('none');
        $plot->SetXTickPos('none');
    } elseif ($data_type == 'data-data-yx') {
        $plot->SetYDataLabelPos('none');
        $plot->SetYTickLabelPos('plotleft');
        $plot->SetYTickPos('plotleft');
    } elseif ($data_type == 'text-data-yx') {
        $plot->SetYDataLabelPos('plotleft');
        $plot->SetYTickLabelPos('none');
        $plot->SetYTickPos('none');
    }
    return $plot;
}
开发者ID:myfarms,项目名称:PHPlot,代码行数:36,代码来源:serialize1.php

示例2: PHPlot

include "./data_date2.php";
include "../phplot.php";
$graph = new PHPlot(600, 400);
$graph->SetPrintImage(0);
//Don't draw the image yet
$graph->SetDataType("data-data-error");
//Must be called before SetDataValues
$graph->SetNewPlotAreaPixels(90, 40, 540, 190);
$graph->SetDataValues($example_data);
$graph->SetXLabelType("time");
$graph->SetXLabelAngle(90);
$graph->SetXTitle("");
$graph->SetYTitle("Price");
$graph->SetYTickIncrement(20);
$graph->SetXTickIncrement(2679000);
$graph->SetXTimeFormat("%b %y");
$graph->SetPlotType("lines");
$graph->SetErrorBarShape("line");
$graph->SetPointShape("halfline");
$graph->SetYScaleType("log");
$graph->SetLineWidths(array(1));
$graph->SetPlotAreaWorld(883634400, 1, 915095000, 140);
$graph->SetXDataLabelPos('none');
$graph->DrawGraph();
//Now do the second chart on the image
unset($example_data);
$graph->SetYScaleType("linear");
include "./data_date.php";
$graph->SetDataType("data-data");
//Must be called before SetDataValues
开发者ID:innomatic-libs,项目名称:phplotlib,代码行数:30,代码来源:example8.php

示例3: cos

#   Y2 = cos(x)
$end = M_PI * 2.0;
$delta = $end / 20.0;
$data = array();
for ($x = 0; $x <= $end; $x += $delta) {
    $data[] = array('', $x, sin($x), cos($x));
}
$plot = new PHPlot(800, 600);
$plot->SetImageBorderType('plain');
$plot->SetPlotType('lines');
$plot->SetDataType('data-data');
$plot->SetDataValues($data);
# Main plot title:
$plot->SetTitle('Line Plot, Sin and Cos');
# Make a legend for the 2 functions:
$plot->SetLegend(array('sin(t)', 'cos(t)'));
# Select a plot area and force ticks to nice values:
$plot->SetPlotAreaWorld(0, -1, 6.8, 1);
# Even though the data labels are empty, with numeric formatting they
# will be output as zeros unless we turn them off:
$plot->SetXDataLabelPos('none');
$plot->SetXTickIncrement(M_PI / 8.0);
$plot->SetXLabelType('data');
$plot->SetPrecisionX(3);
$plot->SetYTickIncrement(0.2);
$plot->SetYLabelType('data');
$plot->SetPrecisionY(1);
# Draw both grids:
$plot->SetDrawXGrid(True);
$plot->SetDrawYGrid(True);
$plot->DrawGraph();
开发者ID:myfarms,项目名称:PHPlot,代码行数:31,代码来源:lines2.php

示例4: elseif

# Need to set the font for TTF even if legendfont isn't given, to get the size.
if ($tp['use_ttf']) {
    if (isset($tp['legendfont'])) {
        $p->SetFont('legend', $tp['legendfont'], $tp['ttfsize']);
    } else {
        $p->SetFont('legend', $tp['ttfont'], $tp['ttfsize']);
    }
} elseif (isset($tp['legendfont'])) {
    $p->SetFont('legend', $tp['legendfont']);
}
$p->SetLegend($tp['text']);
$p->SetDataType('data-data');
$p->SetDataValues($data);
$p->SetPlotType('lines');
$p->SetXDataLabelPos('none');
$p->SetXTickIncrement(1.0);
$p->SetYTickIncrement(1.0);
if (isset($tp['textalign'])) {
    if (isset($tp['colorboxalign'])) {
        $p->SetLegendStyle($tp['textalign'], $tp['colorboxalign']);
    } else {
        $p->SetLegendStyle($tp['textalign']);
    }
}
if (isset($tp['px']) && isset($tp['py'])) {
    $p->SetLegendPixels($tp['px'], $tp['py']);
}
if (isset($tp['wx']) && isset($tp['wy'])) {
    $p->SetLegendWorld($tp['wx'], $tp['wy']);
}
if (isset($tp['cbwa'])) {
开发者ID:myfarms,项目名称:PHPlot,代码行数:31,代码来源:legend_--.php

示例5: 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

示例6: array

<?php

# Typical bars with labels, for manual.
require_once 'phplot.php';
$data = array(array('First', 10), array('Second', 20), array('Third', 30));
$p = new PHPlot(400, 300);
$p->SetDataType('text-data-yx');
$p->SetDataValues($data);
$p->SetPlotType('bars');
$p->SetTitle('Horizontal Bar Plot With Labels');
$p->SetXTitle('Dependent Variable');
$p->SetYTitle('Independent Variable');
$p->SetYDataLabelPos('plotleft');
$p->SetYTickPos('none');
$p->SetXDataLabelPos('plotin');
$p->SetPlotAreaWorld(0, NULL, 40, NULL);
$p->SetXTickIncrement(5);
$p->SetImageBorderType('plain');
$p->DrawGraph();
开发者ID:myfarms,项目名称:PHPlot,代码行数:19,代码来源:labels-horizbar.php

示例7: 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

示例8: 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

示例9: array

<?php

# $Id$
# PHPlot test: Return image encoded as raw
require_once 'phplot.php';
$data = array();
for ($i = 0; $i <= 360; $i += 15) {
    $theta = deg2rad($i);
    $data[] = array('', $i, cos($theta), sin($theta));
}
$p = new PHPlot(800, 600);
$p->SetPrintImage(False);
$p->SetFailureImage(False);
$p->SetTitle('PHPlot Test - Raw Image Encoding');
$p->SetDataType('data-data');
$p->SetDataValues($data);
$p->SetXDataLabelPos('none');
$p->SetXTickIncrement(90);
$p->SetYTickIncrement(0.2);
$p->SetPlotAreaWorld(0, -1, 360, 1);
$p->SetDrawXGrid(True);
$p->SetDrawYGrid(True);
$p->SetPlotType('lines');
$p->DrawGraph();
$data = $p->EncodeImage('raw');
// fwrite(STDERR, "EncodeImage('raw') size = " . strlen($data) . "\n");
echo $data;
开发者ID:myfarms,项目名称:PHPlot,代码行数:27,代码来源:encodeimg2.php

示例10: my_format

<?php

# $Id$
# Test types of label formatting 2 (custom, data:3)
require_once 'phplot.php';
function my_format($val, $arg)
{
    $m = (int) ($val / 60);
    $h = (int) ($m / 60);
    $m %= 60;
    return sprintf("%dH%dM", $h, $m);
}
$data = array();
for ($i = 0; $i < 10; $i++) {
    $data[] = array('', 4000 * $i, 1234 * $i);
}
$p = new PHPlot(800, 600);
$p->SetTitle("Label Format Test 2");
$p->SetDataType('data-data');
$p->SetDataValues($data);
$p->SetXDataLabelPos('none');
$p->SetXTickIncrement(2000);
$p->SetYTickIncrement(1000);
$p->SetPlotType('lines');
$p->SetXLabelType('custom', 'my_format');
$p->SetXTitle("X: custom H:M");
$p->SetYLabelType('data', 3);
$p->SetYTitle("Y: data, prec=3");
$p->DrawGraph();
开发者ID:myfarms,项目名称:PHPlot,代码行数:29,代码来源:labelformats2.php

示例11: plot_guifi

function plot_guifi()
{
    include drupal_get_path('module', 'guifi') . '/contrib/phplot/phplot.php';
    $result = db_query("select COUNT(*) as num, MONTH(FROM_UNIXTIME(timestamp_created)) as mes, YEAR(FROM_UNIXTIME(timestamp_created)) as ano from {guifi_location} where status_flag='Working' GROUP BY YEAR(FROM_UNIXTIME(timestamp_created)),MONTH(FROM_UNIXTIME(timestamp_created)) ");
    $inicial = 5;
    $nreg = $inicial;
    $tot = 0;
    $ano = 2004;
    $mes = 5;
    $items = 2004;
    $label = "";
    while ($record = db_fetch_object($result)) {
        if ($record->ano >= 2004) {
            if ($mes == 12) {
                $mes = 1;
                $ano++;
            } else {
                $mes++;
            }
            while ($ano < $record->ano || $mes < $record->mes) {
                $nreg++;
                if ($mes == 6) {
                    $label = $ano;
                } else {
                    $label = '';
                }
                $data[] = array("{$label}", $nreg, $tot, '');
                if ($mes == 12) {
                    $mes = 1;
                    $ano++;
                } else {
                    $mes++;
                }
            }
            $tot += $record->num;
            $nreg++;
            if ($mes == 6) {
                $label = $ano;
            } else {
                $label = '';
            }
            $data[] = array("{$label}", $nreg, $tot, '');
        } else {
            $tot += $record->num;
        }
    }
    while ($mes < 12) {
        $nreg++;
        $mes++;
        if ($mes == 6) {
            $label = $ano;
        } else {
            $label = '';
        }
        $data[] = array("{$label}", $nreg, "");
    }
    $items = ($ano - $items + 1) * 12;
    if ($tot % 1000 < 30) {
        $data[$nreg - $inicial - 1][3] = $tot;
        $vt = floor($tot / 1000) * 1000;
        $vtitle = $vt . " " . t('Nodes') . "!!!";
        $tcolor = 'red';
    } else {
        $vtitle = t('Working nodes');
        $tcolor = 'DimGrey';
    }
    $shapes = array('none', 'circle');
    $plot = new PHPlot(200, 150);
    $plot->SetPlotAreaWorld(0, 0, $items, NULL);
    $plot->SetFileFormat('png');
    $plot->SetDataType("data-data");
    $plot->SetDataValues($data);
    $plot->SetPlotType("linepoints");
    $plot->SetYTickIncrement(2000);
    $plot->SetXTickIncrement(12);
    $plot->SetSkipBottomTick(TRUE);
    $plot->SetSkipLeftTick(TRUE);
    $plot->SetXAxisPosition(0);
    $plot->SetPointShapes($shapes);
    $plot->SetPointSizes(10);
    $plot->SetTickLength(3);
    $plot->SetDrawXGrid(TRUE);
    $plot->SetTickColor('grey');
    $plot->SetTitle($vtitle);
    $plot->SetDrawXDataLabelLines(FALSE);
    $plot->SetXLabelAngle(0);
    $plot->SetXLabelType('custom', 'Plot1_LabelFormat');
    $plot->SetGridColor('red');
    $plot->SetPlotBorderType('left');
    $plot->SetDataColors(array('orange'));
    $plot->SetTextColor('DimGrey');
    $plot->SetTitleColor($tcolor);
    $plot->SetLightGridColor('grey');
    $plot->SetBackgroundColor('white');
    $plot->SetTransparentColor('white');
    $plot->SetXTickLabelPos('none');
    $plot->SetXDataLabelPos('plotdown');
    $plot->SetIsInline(TRUE);
    $plot->DrawGraph();
}
开发者ID:itorres,项目名称:drupal-guifi,代码行数:100,代码来源:guifi_cnml.inc.php

示例12: array

<?php

# PHPlot Example - Horizontal Stacked Bars
require_once 'phplot.php';
$column_names = array('Beef', 'Fish', 'Pork', 'Chicken', 'Butter', 'Cheese', 'Ice Cream');
//                   |       |       |       |       |       |       |
$data = array(array('1910', 48.5, 11.2, 38.2, 11.0, 18.4, 3.9, 1.9), array('1930', 33.7, 10.2, 41.1, 11.1, 17.6, 4.7, 9.699999999999999), array('1950', 44.6, 11.9, 43.0, 14.3, 10.9, 7.7, 17.4), array('1970', 79.59999999999999, 11.7, 48.1, 27.4, 5.4, 11.4, 17.8), array('1990', 63.9, 14.9, 46.4, 42.4, 4.0, 24.6, 15.8));
$plot = new PHPlot(800, 500);
$plot->SetImageBorderType('plain');
// Improves presentation in the manual
$plot->SetTitle("U.S. Annual Per-Capita Consumption\n" . "of Selected Meat and Dairy Products");
$plot->SetLegend($column_names);
#  Move the legend to the lower right of the plot area:
$plot->SetLegendPixels(700, 300);
$plot->SetDataValues($data);
$plot->SetDataType('text-data-yx');
$plot->SetPlotType('stackedbars');
$plot->SetXTitle('Pounds Consumed Per Capita');
#  Show data value labels:
$plot->SetXDataLabelPos('plotstack');
#  Rotate data value labels to 90 degrees:
$plot->SetXDataLabelAngle(90);
#  Format the data value labels with 1 decimal place:
$plot->SetXDataLabelType('data', 1);
#  Specify a whole number for the X tick interval:
$plot->SetXTickIncrement(20);
#  Disable the Y tick marks:
$plot->SetYTickPos('none');
$plot->DrawGraph();
开发者ID:jcmwc,项目名称:fleet,代码行数:29,代码来源:test.php

示例13: graph

# $Id$
# Testing phplot - "SAR Data" (whatever that is), from a posting on Help
# "What I would like to see is ALL the data in the graph (all ticks), but only
# X-axis labels for every four hours,ie. 04:00, 08:00, 12:00, 16:00, 20:00
# and 00:00."
require_once 'phplot.php';
# Random data for 24 hours at 10 minute intervals, with dummy 0,0 entry:
$data[0] = array('00:00', 0, NULL);
for ($i = 1; $i < 48 * 6; $i++) {
    $data[] = array(sprintf("%02d:%02d", $i / 6, $i % 6 * 10), $i, 10.0 + 10.0 * sin($i * M_PI / 50.0));
}
# Wipe all labels except every 4 hours:
$n = count($data);
for ($i = 0; $i < $n; $i++) {
    if ($i % 24 != 0) {
        $data[$i][0] = '';
    }
}
$p = new PHPlot(1024, 768);
$p->SetTitle('Test: intermittent X labels');
$p->SetDataType('data-data');
$p->SetDataValues($data);
# Use data labels along with tick marks. Needs SetPlotAreaWord(0,0) to get them
# to line up.
$p->SetXTickLabelPos('none');
$p->SetXTickIncrement(6);
$p->SetYTickIncrement(5);
#$p->SetDrawXGrid(true);
$p->SetPlotAreaWorld(0, 0);
$p->SetPlotType('points');
$p->DrawGraph();
开发者ID:myfarms,项目名称:PHPlot,代码行数:31,代码来源:sar.php

示例14: array

<?php

# $Id$
# Test types of label formatting 1 (data:2, printf:%e)
require_once 'phplot.php';
$data = array();
for ($i = 0; $i < 10; $i++) {
    $data[] = array('', 500 * $i, 1234 * $i);
}
$p = new PHPlot(800, 600);
$p->SetTitle("Label Format Test 1");
$p->SetDataType('data-data');
$p->SetDataValues($data);
$p->SetXDataLabelPos('none');
$p->SetXTickIncrement(1000);
$p->SetYTickIncrement(1000);
$p->SetPlotType('lines');
$p->SetXTitle("X: data, prec=2");
$p->SetXLabelType('data', 2);
$p->SetYTitle("Y: printf %8.2e");
$p->SetYLabelType('printf', '%8.2e');
$p->DrawGraph();
开发者ID:myfarms,项目名称:PHPlot,代码行数:22,代码来源:labelformats1.php

示例15: PHPlot

require 'mem_image.php';
$graph = new PHPlot(500, 300);
$graph->SetDataType('data-data');
//Specify some data
$data = array(array('', 2000, 750), array('', 2010, 1700), array('', 2015, 2000), array('', 2020, 1800), array('', 2025, 1300), array('', 2030, 400));
$graph->SetDataValues($data);
//Specify plotting area details
$graph->SetPlotType('lines');
$graph->SetTitleFontSize('2');
$graph->SetTitle('Social Security trust fund asset estimates, in $ billions');
$graph->SetMarginsPixels(null, null, 40, null);
$graph->SetPlotAreaWorld(2000, 0, 2035, 2000);
$graph->SetPlotBgColor('white');
$graph->SetPlotBorderType('left');
$graph->SetBackgroundColor('white');
$graph->SetDataColors(array('red'), array('black'));
//Define the X axis
$graph->SetXLabel('Year');
$graph->SetXTickIncrement(5);
//Define the Y axis
$graph->SetYTickIncrement(500);
$graph->SetPrecisionY(0);
$graph->SetLightGridColor('blue');
//Disable image output
$graph->SetPrintImage(false);
//Draw the graph
$graph->DrawGraph();
$pdf = new PDF_MemImage();
$pdf->AddPage();
$pdf->GDImage($graph->img, 30, 20, 140);
$pdf->Output();
开发者ID:rusli-nasir,项目名称:ERP_Accounting_Indonesia,代码行数:31,代码来源:PDF_plot.php


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