PHPLot如何过滤y轴标签

时间:2015-11-09 05:49:00

标签: php phplot

我有这段代码:

$plot = new PHPlot();

//Define some data
$example_data = array(
     array('Learning',1),
     array('Reading',3),
     array('Writing',3),
     array('Oral Communication',1),
     array('Numeracy',2),
);
$plot->SetDataValues($example_data);

现在我得到这张图: enter image description here

我的问题是如何将yAxis Text标签设置为静态值,如1,2,3和4 ..而不仅仅是现在的3.2,3,2.8,2.6 .. 2,1.8,1.6 .. .1,0.8,...... 0 .. ??

有可能吗?

1 个答案:

答案 0 :(得分:1)

一种可能性是使用SetYTickIncrement()方法。

$plot->SetYTickIncrement(1);

别忘了,还有TuneYAutoTicks()方法。