SetMarginsPixels — Set margins around the plot area
$plot->SetMarginsPixels([$lm
], [$rm
], [$tm
], [$bm
])
SetMarginsPixels
sets the size of the margins around
the plot area. By default, the margin sizes are automatically calculated
based on the space needed. Use SetMarginsPixels to override these
automatic calculations and set specific margin sizes. The four margins are
specified independently and in pixels.
$lm
Optional argument specifying the left margin, in pixels. If omitted or NULL, the value is automatically calculated.
$rm
Optional argument specifying the right margin, in pixels. If omitted or NULL, the value is automatically calculated.
$tm
Optional argument specifying the top margin, in pixels. If omitted or NULL, the value is automatically calculated.
$bm
Optional argument specifying the bottom margin, in pixels. If omitted or NULL, the value is automatically calculated.
By default, the margin sizes are automatically calculated based on the space needed (for the axis labels, tick labels, and tick marks). Use SetMarginsPixels to override these automatic calculations and control the margins.
The upper left corner of the plot area is at device coordinates (Left_Margin, Top_Margin). The lower right corner of the plot area is at device coordinates (Image_Width - Right_Margin, Image_Height - Bottom_Margin).
SetMarginsPixels and SetPlotAreaPixels perform the same function with different semantics. It makes no sense to use both - only the last one called will have an effect.
Trailing defaulted arguments can be omitted, but non-trailing defaulted arguments must be specified as NULL. For example, to set the right margin to 100 pixels, and let PHPlot calculate the other three margins, use:
$plot->SetMarginsPixels(NULL, 100);