Skip to content

Formatting histogram bar labels #130

Closed

Description

@ashton314

Please forgive me if this is already in the documentation, but is there a way to get the labels for bars on a discrete-histogram to be printed at an angle? If I have a plot with wide labels for the columns, the text gets smooshed.

image

One nice option would be to specify a pict to use for the bar label, but when I tried this all I got was #<pict> as the label.

image

Is there a way to do this? Or is this a feature that could be added?

Activity

  1. alex-hhh commented on May 10, 2024

    @alex-hhh
    SponsorCollaborator

    plot-{x,y,z}-tick-label-angle can be used to change the angle of the labels, and plot-{x,y,z}-tick-label-anchor can be used to control where the label is connected to the "tick" on the plot. The plot documentation contains an example on how to use these.

    https://docs.racket-lang.org/plot/params.html#%28def._%28%28lib._plot%2Fmain..rkt%29._plot-x-tick-label-angle%29%29

    There is no support for picts as labels (yet)

  2. ashton314 commented on May 11, 2024

    @ashton314
    Author

    Oh man… I did search for angle on the Racket docs, but I somehow had some context set that hid the results from me. I can see that now. Thank you for pointing me to that!

    How hard would pict labels be? If that's something I wanted to add, could you give me a pointer to the source as to where to look?

  3. alex-hhh commented on May 11, 2024

    @alex-hhh
    SponsorCollaborator

    How hard would pict labels be? If that's something I wanted to add, could you give me a pointer to the source as to where to look?

    It would not be too difficult to add, the PR #65 contains the implementation for allowing pictures as axis labels and can be used as an example on what needs to be done. It also contains some links with related discussions from when that feature was implemented.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions