mantidproject / mslice

Source code for Mantid MSlice
http://mantidproject.github.io/mslice
1 stars 2 forks source link

942 increase all fonts in plot #949

Closed GuiMacielPereira closed 11 months ago

GuiMacielPereira commented 12 months ago

Summary of Changes

Description of work:

To test:

Fixes #942 .

robertapplin commented 12 months ago

Last thing I just spotted, is when you give a ridiculously large number as the font size such as 10e7, I get this error:

Traceback (most recent call last):
  File "/home/mlc47243/mambaforge/envs/mantidnightly/lib/python3.10/site-packages/matplotlib/backends/backend_agg.py", line 405, in draw
    self.figure.draw(self.renderer)
  File "/home/mlc47243/mambaforge/envs/mantidnightly/lib/python3.10/site-packages/matplotlib/artist.py", line 74, in draw_wrapper
    result = draw(artist, renderer, *args, **kwargs)
  File "/home/mlc47243/mambaforge/envs/mantidnightly/lib/python3.10/site-packages/matplotlib/artist.py", line 51, in draw_wrapper
    return draw(artist, renderer)
  File "/home/mlc47243/mambaforge/envs/mantidnightly/lib/python3.10/site-packages/matplotlib/figure.py", line 3082, in draw
    mimage._draw_list_compositing_images(
  File "/home/mlc47243/mambaforge/envs/mantidnightly/lib/python3.10/site-packages/matplotlib/image.py", line 131, in _draw_list_compositing_images
    a.draw(renderer)
  File "/home/mlc47243/mambaforge/envs/mantidnightly/lib/python3.10/site-packages/matplotlib/artist.py", line 51, in draw_wrapper
    return draw(artist, renderer)
  File "/home/mlc47243/mambaforge/envs/mantidnightly/lib/python3.10/site-packages/matplotlib/axes/_base.py", line 3064, in draw
    self._update_title_position(renderer)
  File "/home/mlc47243/mambaforge/envs/mantidnightly/lib/python3.10/site-packages/matplotlib/axes/_base.py", line 3008, in _update_title_position
    ax.yaxis.get_tightbbox(renderer)  # update offsetText
  File "/home/mlc47243/mambaforge/envs/mantidnightly/lib/python3.10/site-packages/matplotlib/axis.py", line 1253, in get_tightbbox
    self._update_label_position(renderer)
  File "/home/mlc47243/mambaforge/envs/mantidnightly/lib/python3.10/site-packages/matplotlib/axis.py", line 2506, in _update_label_position
    bboxes, bboxes2 = self._get_tick_boxes_siblings(renderer=renderer)
  File "/home/mlc47243/mambaforge/envs/mantidnightly/lib/python3.10/site-packages/matplotlib/axis.py", line 2056, in _get_tick_boxes_siblings
    tlb, tlb2 = axis._get_ticklabel_bboxes(ticks_to_draw, renderer)
  File "/home/mlc47243/mambaforge/envs/mantidnightly/lib/python3.10/site-packages/matplotlib/axis.py", line 1232, in _get_ticklabel_bboxes
    return ([tick.label1.get_window_extent(renderer)
  File "/home/mlc47243/mambaforge/envs/mantidnightly/lib/python3.10/site-packages/matplotlib/axis.py", line 1232, in <listcomp>
    return ([tick.label1.get_window_extent(renderer)
  File "/home/mlc47243/mambaforge/envs/mantidnightly/lib/python3.10/site-packages/matplotlib/text.py", line 915, in get_window_extent
    bbox, info, descent = self._get_layout(self._renderer)
  File "/home/mlc47243/mambaforge/envs/mantidnightly/lib/python3.10/site-packages/matplotlib/text.py", line 313, in _get_layout
    _, lp_h, lp_d = _get_text_metrics_with_cache(
  File "/home/mlc47243/mambaforge/envs/mantidnightly/lib/python3.10/site-packages/matplotlib/text.py", line 97, in _get_text_metrics_with_cache
    return _get_text_metrics_with_cache_impl(
  File "/home/mlc47243/mambaforge/envs/mantidnightly/lib/python3.10/site-packages/matplotlib/text.py", line 105, in _get_text_metrics_with_cache_impl
    return renderer_ref().get_text_width_height_descent(text, fontprop, ismath)
  File "/home/mlc47243/mambaforge/envs/mantidnightly/lib/python3.10/site-packages/matplotlib/backends/backend_agg.py", line 238, in get_text_width_height_descent
    font = self._prepare_font(prop)
  File "/home/mlc47243/mambaforge/envs/mantidnightly/lib/python3.10/site-packages/matplotlib/backends/backend_agg.py", line 275, in _prepare_font
    font.set_size(size, self.dpi)
RuntimeError: In set_size: Could not set the fontsize (invalid pixel size; error code 0x17)

A similar problem probably happens for the scale option. We might want to set a sensible maximum possible value for font size?

GuiMacielPereira commented 11 months ago
GuiMacielPereira commented 11 months ago

I just realised that I will need to write a release note for these changes?

robertapplin commented 11 months ago

The tooltip change looks good image

I think the next step is:

It should then be possible to remove the top checkbox

GuiMacielPereira commented 11 months ago

Overall Changes: