Suppose that there are 3 machines, A, B, C. B and C are on the same network, whereas A is remote. Connection between B, C is very fast, but any connection from A to (B or C) is slow.

I would like to run a computationally intensive job on C involving graphical output (namely, generating png files from MATLAB). If I SSH from A -> B -> C, the X11 output is displayed on A. I would like to SSH from A -> B and run the same computations on C, but have all graphical output confined to B, so that the slow A -> B connection does not make the job take forever (this is what is happening to me now). Is this possible, and if so, how should I set it up?

Operating systems: A is OSX, B is Ubuntu, C is CentOS (part of computing cluster).