#59 Sensible orientation for long z labels

open
nobody
None
5
2014-09-28
2014-07-27
No

Gnuplot normally prints the z axis label horizontally in 3d plots which makes them more easily readable. Unfortunately this makes labels that are more than about 4 characters long exceed the image limits and thus be cropped.
My first proposal to the mailing list (adding an option that allows to set the rotation to horizontal or vertical) was answered by a proposal for a third possibility that didn't come to my mind when I tried to write a first version of this patch: Automatic rotation of long labels but leaving short labels horizontal since reading horizontal text is much easier.

The attached patch was designed to meet all of the following use-cases:

load("draw")$
draw3d(
    explicit(sin(x)*sin(y),x,0,10,y,0,10),
    title="Automatic rotation of long axis label",
    zlabel_rotate=auto,
    zlabel="Z axis"
)$

draw3d(
    explicit(sin(x)*sin(y),x,0,10,y,0,10),
    title="Automatic automatic rotation of long axis label",
    zlabel="Z axis"
)$

draw3d(
    explicit(sin(x)*sin(y),x,0,10,y,0,10),
    title="No automatic rotation of short axis labels",
    zlabel="Z111"
)$

draw3d(
    explicit(sin(x)*sin(y),x,0,10,y,0,10),
    title="Forced rotation of short label",
    zlabel_rotate=true,
    zlabel="Z111"
)$

Kind regards,

Gunter.

2 Attachments

Discussion

  • Did forget to mention the possibility to revert to the original behavior as an additional use case:

    draw3d(
        explicit(sin(x)*sin(y),x,0,10,y,0,10),
        title="The default behavior priour to this patch",
        zlabel_rotate=false,
        zlabel="A verly long z label"
    )$