Skip to content

label size in pygr.Plot #24

Open
Open
@nilsbecker

Description

@nilsbecker

hi, it seems that here the font size at which labels are drawn is set to a fixed multiple of the height of the plot window in normalized device coordinates.

it should be made possible somehow to adjust that.

concrete example: i am trying to produce a non 1:1, landscape-format plot. the only way i found to achieve that was the cumbersome method:

    window_cm = np.array([0., 20, 0, 10])
    gr.setwsviewport(*(1e-2*window_cm))  # screen window size in meters
    gr.setwswindow(0, 1, 0, 0.5) # rect in NDC coords to be scaled to the workspace window
    p = Plot(viewport=(.1, .95, 0.05, .45)) # padding of plot into that rect
    p.xlabel = 't'
    p.ylabel = 'mol number' # it seems currently impossible to change label size.

this means the NDC height is now only 0.5 instead of 1, so that my axis labels now come out as half the font size of the usual case with 1:1 aspect plots, with apparently no way to change that.

edit:

  • the window size in m on screen is incorrect on my iMac Retina screen. the window appears at half the desired size.
  • removed rant about missing documentation.
  • i found a way to produce my desired figure using matplotlib.animation with GR as backend, which works fine.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions