I've successfully overlaid charts in the past, however it seems that with the following data set (included below) a random solid black line appears in the middle of the chart. I have encountered a solid black line before, but it was positioned at the top of the plot area and no reason for concern.
My thoughts are that the left and right grid lines are lined up and solidifying in a solid black line, instead of the standard gray grid lines.
To fix this, add the following call anywhere in the second plot setup, for example right after SetPlotAreaWorld(NULL):
$plot->SetXAxisPosition('');
That errant line you were seeing (and I admit this had me puzzled until I played around with it a bit) is the X axis line of the second plot. The X axis position was calculated at Y=8 for the first plot. It was drawn at the bottom, where it belongs, for the first plot. For the second plot, you told PHPlot to recalculate the World coordinate mapping, which it did, resulting in a Y range of 6 to 9. But without being explicitly told to recalculate the axis lines, PHPlot uses the same Y=8 from the first plot for the X axis line in the second plot, and now draws it at Y=8 according to the new (right-side) scale.
Hi,
I've successfully overlaid charts in the past, however it seems that with the following data set (included below) a random solid black line appears in the middle of the chart. I have encountered a solid black line before, but it was positioned at the top of the plot area and no reason for concern.
My thoughts are that the left and right grid lines are lined up and solidifying in a solid black line, instead of the standard gray grid lines.
Any ideas?
To fix this, add the following call anywhere in the second plot setup, for example right after SetPlotAreaWorld(NULL):
That errant line you were seeing (and I admit this had me puzzled until I played around with it a bit) is the X axis line of the second plot. The X axis position was calculated at Y=8 for the first plot. It was drawn at the bottom, where it belongs, for the first plot. For the second plot, you told PHPlot to recalculate the World coordinate mapping, which it did, resulting in a Y range of 6 to 9. But without being explicitly told to recalculate the axis lines, PHPlot uses the same Y=8 from the first plot for the X axis line in the second plot, and now draws it at Y=8 according to the new (right-side) scale.
Reference: http://phplot.sourceforge.net/phplotdocs/adv-multiplot.html#adv-multiplot-axis
Makes sense - thanks for quick reply!