Skip to content

Allow pictures to be used as title and axis labels in plots - #65

Merged
alex-hhh merged 1 commit into
racket:masterfrom
alex-hhh:ah/pict-titles
Aug 28, 2020
Merged

alex-hhh merged 1 commit into
racket:masterfrom
alex-hhh:ah/pict-titles

Conversation

@alex-hhh

@alex-hhh alex-hhh commented Aug 21, 2020 •

Copy link
Copy Markdown
Collaborator

Updated the 2D and 3D plot procedures to accept a picture (from the pict
library) or a string as the label for the #:title and#:{x,y,z}-label
keywords, as well as the corresponing parameters, plot-title and
plot-{x,y,z}-label.

fishy-plot

The original request was to allow LaTeX notation for the labels, this
changeset will enable doing that (and more) by installing the additional
latex-pict package and using the pictures produced by that package as
labels.

The folowing caveats apply for the implementation:

  • the label position for the Y axis is not rotated when it is a picture,
    only when it is a string. This was done to allow full flexibility to users
    who chose to use pictures -- they can easily rotate the picture themselves.
    If the picture would be rotated by the plot package, the user might have to
    supply a rotated picture to have a horizontal picture for the y label, and
    this would result in a double rotation -- depending on the type of graphics
    used for the picture, this might create undesirable artifacts.

  • the font used for axis labels and title determines the gap between the label
    and the plot area and axis themselves.

A bug was fixed, where passing incorect parameters to plot procedure could
cause Racket to crash, an explanation for the fix is put as a comment in the
"plot-gui-lib/plot/private/gui/plot2d.rkt" file.

See also:

Updated the 2D and 3D plot procedures to accept a picture (from the pict
library) or a string as the label for the `#:title` and`#:{x,y,z}-label``
keywords, as well as the corresponing parameters, `plot-title` and
`plot-{x,y,z}-label`.

The original request was to allow LaTeX notation for the labels, this
changeset will enable doing that (and more) by installing the additional
`latex-pict` package and using the pictures produced by that package as
labels.

The folowing caveats apply for the implementation:

* the label position for the Y axis **is not** rotated when it is a picture,
  only when it is a string.  This was done to allow full flexibility to users
  who chose to use pictures -- they can easily rotate the picture themselves.
  If the picture would be rotated by the plot package, the user might have to
  supply a rotated picture to have a horizontal picture for the y label, and
  this would result in a double rotation -- depending on the type of graphics
  used for the picture, this might create undesirable artifacts.

* the font used for axis labels and title determines the gap between the label
  and the plot area and axis themselves.

A bug was fixed, where passing incorect parameters to plot procedure could
cause Racket to crash, an explanation for the fix is put as a comment in the
"plot-gui-lib/plot/private/gui/plot2d.rkt" file.

See also:

* racket#58
* racket/racket#3321
* racket#64
@alex-hhh
alex-hhh merged commit 18d8eca into racket:master Aug 28, 2020
@alex-hhh
alex-hhh deleted the ah/pict-titles branch August 28, 2020 23:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant