I'm back for the next layer of the onion and thanks for all the help. I am trying to set the legend position as shown in the first example in section 5.36. My legend is larger but even if it were the same since as in the example I am not getting it. The example shows the legend to the left of the Y-Axis. When I try the same thing my legend is cut off on the left side not much past the axis Playing with the numbers this is what I have:
$plot->SetLegendPosition(0,0,'image',0,0,-50,10);
If I expand the image size, the image expands and still cuts off the legend. There must be something not shown in the example that lets the legend go further beyond the axis.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
(Although I inherited most of the PHPlot API, I take full responsibility for SetLegendPosition(). It is complex and confusing... One of my favorite functions.)
In words, SetLegendPosition(0, 0, 'image', 0, 0, -50, 10) tells PHPlot that you want the upper left corner of the legend to be placed at the upper left corner of the image, then moved 50 pixels left and 10 pixels down. That -50 will push the left side of the legend off the image, which isn't what you want.
The (5,5) offset in the first image of example 5.36 just moves the legend border slightly inside (down and right) from the upper left corner image border.
If you want the legend to be left of the Y axis, you also have to increase the margin on that side to leave room. You can estimate the size, or use GetLegendSize() to get the exact size. (The manual probably should cross-reference GetLegendSize() from SetLegendPosition() - I'll make a note to look at it.)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I'm back for the next layer of the onion and thanks for all the help. I am trying to set the legend position as shown in the first example in section 5.36. My legend is larger but even if it were the same since as in the example I am not getting it. The example shows the legend to the left of the Y-Axis. When I try the same thing my legend is cut off on the left side not much past the axis Playing with the numbers this is what I have:
$plot->SetLegendPosition(0,0,'image',0,0,-50,10);
If I expand the image size, the image expands and still cuts off the legend. There must be something not shown in the example that lets the legend go further beyond the axis.
(Although I inherited most of the PHPlot API, I take full responsibility for SetLegendPosition(). It is complex and confusing... One of my favorite functions.)
In words, SetLegendPosition(0, 0, 'image', 0, 0, -50, 10) tells PHPlot that you want the upper left corner of the legend to be placed at the upper left corner of the image, then moved 50 pixels left and 10 pixels down. That -50 will push the left side of the legend off the image, which isn't what you want.
The (5,5) offset in the first image of example 5.36 just moves the legend border slightly inside (down and right) from the upper left corner image border.
If you want the legend to be left of the Y axis, you also have to increase the margin on that side to leave room. You can estimate the size, or use GetLegendSize() to get the exact size. (The manual probably should cross-reference GetLegendSize() from SetLegendPosition() - I'll make a note to look at it.)
Got it. Thanks.