Displaying offsets in 3d plots

I have been working on a new feature for mplot3d. It is a bit of a hack but with this patch the offset information in a tick formatter can now be displayed. The offset text is located so that the offset texts for two jointed axis are not co-located, and is placed at the same distance away from the axis as the axis label. The text is aligned so that it should always be “tucked” underneath the axis as one rotates the plot. There are a few edge cases as one rotates where an offset text will “stick out”, but they should be very infrequent.

I have attached a patch to enable this feature and also an example script that showcases it.

This is how it should look:
http://dl.dropbox.com/u/7325604/mplot3d_offsettest.png

Let me know what you think, and if all is good, I will add it to the development branch soon.

Ben Root

mplot3d_offsets.patch (4.41 KB)

mplot3d_offsetdemo.py (931 Bytes)

Since there haven’t been any objections, I will commit this to the development branch today.

Ben Root

···

On Thu, Dec 16, 2010 at 11:13 AM, Benjamin Root <ben.root@…553…> wrote:

I have been working on a new feature for mplot3d. It is a bit of a hack but with this patch the offset information in a tick formatter can now be displayed. The offset text is located so that the offset texts for two jointed axis are not co-located, and is placed at the same distance away from the axis as the axis label. The text is aligned so that it should always be “tucked” underneath the axis as one rotates the plot. There are a few edge cases as one rotates where an offset text will “stick out”, but they should be very infrequent.

I have attached a patch to enable this feature and also an example script that showcases it.

This is how it should look:
http://dl.dropbox.com/u/7325604/mplot3d_offsettest.png

Let me know what you think, and if all is good, I will add it to the development branch soon.

Ben Root