I have information that needs to be displayed where 1 is the top of the axis
and everything higher than 1 is below (for example alexa rank) is it possible?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
There is no direct way to do this. I can't even think of how it might be
implemented, since so much depends on the axis direction. However, you can
'simulate' it by (1) inverting and offsetting the data, and (2) using a custom
Y label format function to display the 'fake' values. Here is a quick stand-
alone example. Note: This forum isn't friendly for copying and pasting code
(Sourceforge knows about it but has not chosen to do anything) - someday I
will set something better up for this purpose. Sorry.
<?php# Simulated inversion of Y axisrequire_once'phplot.php';# The original data:$data=array(array('A',3),array('B',2),array('C',1),array('D',4),array('E',8),);# Offset and invert the data:$offset=11;// Must be bigger than all valuesforeach($dataas&$row)$row[1]=$offset-$row[1];unset($row);// See PHP manual on foreach with references$p=newPHPlot;$p->SetTitle('Invert Y axis');$p->SetDataType('text-data');$p->SetDataValues($data);$p->SetPlotType('bars');$p->SetXTickPos('none');$p->SetYLabelType('custom',create_function('$y',"return ($offset-\$y);"));$p->SetPlotAreaWorld(NULL,0,NULL,$offset-1);$p->DrawGraph();
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I have information that needs to be displayed where 1 is the top of the axis
and everything higher than 1 is below (for example alexa rank) is it possible?
There is no direct way to do this. I can't even think of how it might be
implemented, since so much depends on the axis direction. However, you can
'simulate' it by (1) inverting and offsetting the data, and (2) using a custom
Y label format function to display the 'fake' values. Here is a quick stand-
alone example. Note: This forum isn't friendly for copying and pasting code
(Sourceforge knows about it but has not chosen to do anything) - someday I
will set something better up for this purpose. Sorry.