Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

label size in pygr.Plot #24

Open
nilsbecker opened this issue Jan 21, 2021 · 0 comments
Open

label size in pygr.Plot #24

nilsbecker opened this issue Jan 21, 2021 · 0 comments

Comments

@nilsbecker
Copy link

nilsbecker commented Jan 21, 2021

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.
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

No branches or pull requests

1 participant