By default, the callback function has access only to the GD image resource as the $img argument, the pass-through argument provided when the callback function was registered, and additional arguments (if any) provided by PHPlot for the callback. It does not have access to the PHPlot class object instance, nor any of its contents.
If you need access to the internals of the PHPlot class instance from your callback, you have three options.
You can declare your PHPlot class instance variable as global.
You can pass the instance variable as the $arg when registering the callback. With PHP5, this will pass a reference to the object, which allows reading and changing variables. (PHP4 would pass a copy of the object at the time the callback function is being set up, which would probably not be useful. There are work-arounds, but PHP4 is no longer supported.)
You can use a class method which extends PHPlot. This is described in Section 6.4, “Object Methods as Callbacks”.
As stated in the warning at the top of this chapter, any access to the class internals is risky and subject to break with any new update to PHPlot.