What are some alternative methods or functions in PHP that can be used to manipulate the order of legends in PHPLOT graphs?

When working with PHPLOT graphs, the default behavior is to display legends in the order that the data series are added. However, if you want to manipulate the order of legends, you can use the `SetLegend` function to explicitly set the legend labels in the desired order.

// Create a new PHPLOT graph object
$plot = new PHPlot();

// Add data series to the plot

// Set legend labels in the desired order
$plot->SetLegend(array('Legend 1', 'Legend 2', 'Legend 3'));

// Draw the plot
$plot->DrawGraph();