4k scaling on Ubuntu
Afficher commentaires plus anciens
I have a problem scaling the matlab editor on my new XPS-15 laptop running ubuntu 16.04. I have managed to increase some of the fonts, but the toolbar and plots are still tiny. Is there a way to fix this or will there be support for this in the future?
Réponse acceptée
Plus de réponses (2)
Chaitanya Devidas
le 30 Juin 2022
5 votes
MATLAB supports High DPI screens on Linux starting from R2017b.
To tune a high-DPI Linux system, you need to:
1) Set the MATLAB scale factor
2) Calibrating the system's DPI
The MATLAB scale factor affects MATLAB desktop and the size/position of windows. The system's DPI determines the scale and font size of axes and labels.
The two tuning steps are described below:
1) To set the MATLAB scale factor to, for example, 1.5, please execute the following commands in the MATLAB Command Window:
>> s = settings;s.matlab.desktop.DisplayScaleFactor
>> s.matlab.desktop.DisplayScaleFactor.PersonalValue = 1.5
2) To calibrate the system's DPI to match the scale factor, please use the following Terminal commands:
~$ xdpyinfo | grep resolution
resolution: 96x96 dots per inch
~$ xrandr --dpi 144
The DPI value chosen should be the resolution found with "xdpyinfo" multiplied by the MATLAB scale factor that was set. In the example, 96 × 1.5 = 144.
MATLAB must be restarted after Step 2.
I achnowledge Jim from the MathWorks Technical Support Department for sharing these instruction with me.
Mosam Dabhi
le 27 Jan 2018
Here is my solution for this.
While running MATLAB, I decrease the resolution to 1920x1080 end and as soon as I quit MATLAB, i should retrieve my high DPI settings back. Here is a simple bash script I wrote to pertain above solution:
# Bash script for MATLAB scale issues
# Set scaling to remove the zoom used in HDPI screens
xrandr -s 1920x1080
dconf write /com/ubuntu/user-interface/scale-factor "{'eDP-2': 17}"
# Call your program (MATLAB in our case)
sudo matlab
# Wait until the program runs
wait
# Back to original resolution
xrandr -s 3840x2160
dconf write /com/ubuntu/user-interface/scale-factor "{'eDP-1': 17}"
Save the above code with `.sh` suffix for it ti run as a bash file. Run this bash file using:
bash `whatever_file_name.sh`
Catégories
En savoir plus sur Graphics Performance dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!