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

making kafe2 usable for tactile output #170

Open
JonasEppelt opened this issue May 3, 2021 · 3 comments
Open

making kafe2 usable for tactile output #170

JonasEppelt opened this issue May 3, 2021 · 3 comments

Comments

@JonasEppelt
Copy link

In our current beginners course for data analysis we have blind students. We are currently working on making the material accessible for them and still learning on how to approach this.
The students do have braille lines of their own and access to a tactile display and printer. But we have yet two figure out how the acompaning software works.
As of now we have figured out that raw LaTeX works well with braille lines. We also created a matplotlib stylesheet to toggle between tactile output and visual.
We also tried to apply it on kafe2, but it does no fully work. I assume the not working parts are those using LaTeX, but i am not proficient enough
My suggestion to give it basic usability, would be the add a plot mode, which drops the error band and turns the output currently in the right box into terminal output with raw LaTeX.

The current stylesheet we created:

font.family: sans-serif
font.sans-serif: Braille DE Computer
font.size: 36
axes.unicode_minus: False	
axes.prop_cycle: cycler('linestyle',['-','--','dotted','-.'])

Running kafe2 with the stylesheet:
kafe2_braille

@cverstege
Copy link
Member

cverstege commented May 4, 2021

The given changes probably don't affect the output, as its processed latex, which probably is not using the given braille font.
Lot's of guessing here. Do you know if LaTeX has an option to render/compile using a Braille font?
This would probably be the easiest way, as this would just need a change with the (LaTeX) font config.

What do you mean by raw Latex exactly?
We could

  1. print the raw/unformatted latex e.g. \frac{1}{2} (set by the fit.assign_model_function_latex_expression() function and similar).
    For chi2 this would be $\hookrightarrow$$\chi^2 / {\rm ndf} = 6.735 / 10 = 0.6735$
    Edit: No clue, why we have multiple dollar signs here, probably by concatenating LaTeX strings...
  2. or use the non latex text, e.g. 1/2 (set by fit.assign_model_function_expression() and similar).
    For chi2 this would be chi2 / ndf = 6.735 / 10 = 0.6735

Btw. you can create your own matplotlibrc and kafe config – which kafe2 will use without the need to set everything every time – by placing a file named kafe2.matplotlibrc.conf and/or kafe2.yaml inside the working directory or overwrite the default config inside the installation directory.
Please use the default config(s) as your starting point https://github.com/dsavoiu/kafe2/blob/master/kafe2/config.

@cverstege
Copy link
Member

cverstege commented May 4, 2021

Edit: I don't know why i thought of disabling the error band, but I can imagine, that it's helpful to have the plots with and without the error band for better tactile comparison or similar. So if you need to disable/enable it, here's how:

The error band can be disabled and enabled with

# the array length must match the amount of fits handled by this plot object.
p.customize('model_error_band', 'hide', [True])

See https://kafe2.readthedocs.io/en/latest/parts/user_guide.html#plot-style

To permanently hide the error band, change line 209 to True in the plot_style_color.yaml
https://github.com/dsavoiu/kafe2/blob/96acf12f15fc08d552a3d33ab5f2534fd26cb36c/kafe2/config/plot_style_color.yaml#L209
inside the kafe2 installation directory or copy this config file and kafe2.yaml to your current working directory to overwrite the defaults.
Only kafe2.yaml is loaded on import. The file kafe2.yaml includes plot_style_color.yaml
https://github.com/dsavoiu/kafe2/blob/96acf12f15fc08d552a3d33ab5f2534fd26cb36c/kafe2/config/kafe2.yaml#L34

@cverstege
Copy link
Member

I've just found these settings inside the mafe2.matplotlibrc.conf:

https://github.com/dsavoiu/kafe2/blob/96acf12f15fc08d552a3d33ab5f2534fd26cb36c/kafe2/config/kafe2.matplotlibrc.conf#L78-L98

Maybe changing the font types here to Braille (and uncomment the lines), fixes the problem? I do not have a braille font installed at the moment and can not test it.
You can test it yourself, by copying this file to the current working directory. This should overwrite the kafe2 defaults.

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

No branches or pull requests

2 participants