MATLAB Answers

6

Why does the MATLAB desktop look blurry when using MATLAB R2013b or R2014a on my Mac with Retina display?

The text in MATLAB R2013b and R2014a looks visually less crisp on my Mac computer with a Retina Display.

Tags

No tags entered yet.

Products

9 Answers

Answer by MathWorks Support Team on 14 May 2019
Edited by MathWorks Support Team on 14 May 2019
 Accepted Answer

The reason for this behavior is that MATLAB R2013b (or R2014a) includes a version of the Java Runtime Environment (JRE) that does not currently take advantage of the full display capabilities on MacBook Pros with Retina displays. As a result, MATLAB R2013b will look less sharp than many other Mac applications, including earlier releases of MATLAB. A workaround is to install and use a newer JRE, and restrict your desktop to certain fonts and sizes.
Here are some options for improving the visual appearance of MATLAB:
Open in Low Resolution
This option is the simplest to execute, but it only provides a slight improvement. After completion of these steps, the MATLAB Desktop will appear pixelated, but not blurry. To use this option:
1. Open a new "Finder" window and navigate to the "Applications" directory.
2. Select the MATLAB icon and choose "File" > "Get Info".
3. Check the option "Open in Low Resolution".
4. Launch MATLAB.
Change the Display Settings
This option is also simple to execute, but it changes your Mac's display settings to shrink all content and give the appearance of more space. Because the application is smaller, the blurriness (or pixelation, if combined with the "Open in Low Resolution" option) is less noticeable. To use this option:
1. Choose "System Preferences" from the Apple menu in the top-left corner of your screen.
2. Choose "Display" to open the display settings.
3. In the "Display" tab, ensure that the "Resolution" type is set to "Scaled".
4. Select the option for "More Space". This will decrease the size of the content on your screen and offer more space.
5. Launch MATLAB.
Change the JRE Used by MATLAB
This option requires more advanced steps, but it will enable MATLAB to use the full Retina Display capabilities. This procedure involves downloading a different JRE and pointing MATLAB to use that JRE instead of the one that is shipped with MATLAB. It also applies only to MATLAB that is launched from Terminal. To use this option:
1. Install Java Runtime 7u45 or newer (but not the forthcoming Java 8) from Oracle’s web site: (Some users experience the cursor insertion pointer issue with u45 as well. But this was not observed in later releases like u60)
2. Launch the "Terminal" application and set your MATLAB_JAVA environment variable to this JRE as described at the below documentation:
3. From that same "Terminal" window, execute the following command to launch MATLAB:
/Applications/MATLAB_R2013b.app/bin/matlab
The MATLAB Desktop should now appear crisp.
4. With MATLAB as the active application, choose "MATLAB" > "Preferences" from the menu bar. In the preferences window, navigate to "MATLAB" > "Fonts".
5. For the "Desktop code font" preference, start with one of the following combinations that have been shown to work:
Monospaced, Courier, or Consolas plain, 8 point
This should give you a crisp display with a correctly drawn cursor in the Editor and Command Window. You will know you have a working combination when the cursor placement is correct when typing a long line in the Command Window. There may be other fonts and font sizes that work; you can continue to experiment until you find a setting that works well for you. Note that other windows that accept text input may continue to draw the cursor at an incorrect location. This will be most noticeable when a line of text grows in length, beyond 40 characters or so.
Further Background Information:
R2013a and previous releases of MATLAB for Mac used Java that comes bundled with OS X; however, starting with MATLAB R2013b, MathWorks migrated to Oracle's Java 7 instead of the one bundled with OS X. This is to ensure the continued availability of MATLAB on Mac computers because Apple is in the process of deprecating its Java support.
R2013b is bundled with Java 7u11. This version lacks Retina display support as described in the following webpage. http://bugs.sun.com/view_bug.do?bug_id=8009754
A subsequent update with support for Retina displays, Java 7u40, was released in September 2013. Unfortunately, this update contains incomplete support for Retina displays—while visually attractive, the cursor insertion pointer is drawn at an incorrect location with many font sizes.
This behavior is described on the following webpage: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=8020752
It is hard to know exactly where the cursor is, making editing text significantly more difficult. We now understand that choosing specific fonts and font sizes can mitigate the issue. All text editing fields can be impacted to some degree, but it is most noticeable and bothersome in the Editor and Command Window.
on Windows® enter set JAVA_HOME=__path_to_Java_install__

  9 Comments

@cyclist, creating a "global" environment variable (one that is in effect from the Dock and persists across reboots) is unfortunately somewhat tricky to do. There is a lengthy discussion of options in the comments of http://www.mathworks.com/matlabcentral/answers/103056
@Bernie: I believe it should work with Yosemite as well. however, if you run into issues, please contact MathWorks Technical Support.

Sign in to comment.


Answer by florian
on 3 Apr 2014
Edited by florian
on 4 Apr 2014

Mac only
Inspired by this post here I created the following AppleScript to run Matlab2014a
do shell script "export MATLAB_JAVA=\"/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home\"" & ";/Applications/MATLAB_R2014a.app/bin/matlab -desktop &> /dev/null &"
This should remove the blur on retina Macs. You can also download the script from attachment and drag it to your dock.
PS:
the download is huge because of the Matlab Icon

  4 Comments

Show 1 older comment
This seems to work with 2014a. The MATLAB documentation also works for me on this. Thanks for posting.
Thanks, florian, for a neat solution! But running MATLAB with the above solution makes the startup folder "/", not "~/Documents/MATLAB". This can be annoying to some people like me who stores most relevant files on MATLAB folder. Adding "export MATLAB_USE_USERWORK=1" to the above script will solve this problem. So the above script should be
do shell script "export MATLAB_JAVA=\"/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home\"" & "; export MATLAB_USE_USERWORK=1" & ";/Applications/MATLAB_R2014a.app/bin/matlab -desktop &> /dev/null &"
. And for those who want to use the MATLAB icon above, right-click the MATLAB icon and see package inside and find "Contents/Resources/Scripts/main.scpt". Double-click this script file and modify it accordingly. Then compile and save. DONE. Now you will see your original startup folder when you launch.
Great answers by Florian, Dongeun Lee, and others.
An alternative to export MATLAB_USE_USERWORK=1 is to simply change directory to your regular Matlab userpath before invoking matlab. This may be a small advantage if you invoke matlab from the terminal on occasion and want it to start in the shell's working directory when you do that.
do shell script "cd ~/Documents/MATLAB; export MATLAB_JAVA=\"/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home\";/Applications/MATLAB_R2014a.app/bin/matlab -desktop &> /dev/null &"

Sign in to comment.


Answer by David Malling on 23 Mar 2014

I had success with fixing the blurriness with the following:
  1. In the Finder, select the Matlab application
  2. From the File menu, select Get Info
  3. Expand the General section, and check Open in Low Resolution
  4. Close the Info window
  5. Open Matlab
I did not do any manual changes to the Matlab Java settings.

  6 Comments

Looks different but still blurry to me with David's solution.
First Generation 15" Retina with newest OSX
This suggestion works great for r2014a. Super easy, and I don't want to upgrade my java version for compatibility reasons. Thanks so much!
Tanks for your post. It works for my r2014a student version. I'm a programming starter and other methods seem too complicated for me.

Sign in to comment.


Answer by Andrew Janke on 4 Oct 2014

This is fixed in R2014b after all! They got the JVM upgraded to 1.7.0_55 between the prerelease and final release version, and the retina blurriness is fixed now. You can upgrade to R2014b to get the fix.

Answer by Dongeun Lee on 17 May 2014
Edited by Dongeun Lee on 20 May 2014

For those who use R2014a and downloaded new Java runtime to resolve the blurry screen issue.
You may get crisp screen; but calling help browser (either from the menu or typing 'doc') will result in MATLAB hang. So you have to quit the MATLAB via 'command+option+ESC.'
Since I often use the help browser, I contacted MathWorks support team. And after lots of e-mails going back and forth, I finally settled with the following solution.
(Note that this applies to R2014a users. I am using MacBook Pro Retina 15-inch Late 2013)
1. Refer to this link and apply the patch as explained. (During the unzip, you should overwrite existing files when prompted.)
2. After the patch, try typing 'doc' on 'crisp' MATLAB. If MATLAB does not hang, you are lucky.
3. If MATLAB hangs, open up 'Terminal' app and do the following:
cd ~
rm -r .matlab
(These commands delete MATLAB configuration directory hidden in your home directory.)
4. If you launch MATLAB again, new '.matlab' will be generated automatically. Now type 'doc' on MATLAB command line and you will see the Help Browser without causing MATLAB hang.
This is it. But there's still an issue: do not maximize the help browser by pressing green + button on the top-left. You can manually adjust the size of the help browser but maximizing the window will again cause MATLAB hang. In this case you can go back to the Step 3 and the problem will be fixed.
I just reported this new issue to MathWorks support team and if I get a final solution, I'll probably post that here. But in the meantime, we can at least use the help browser.

  4 Comments

Show 1 older comment
Maybe your download was not successful. How about trying it again? I just downloaded and checked that the zip file contains four different folders: one is the bug report folder you mentioned; another folders are "java", "sys", and "toolbox".
Hi Dongeun, thanks for your contribution.
I followed your instructions. After resetting the config folder, at first Matlab seemed to be still hanging with a doc call... But no: the second trial worked just fine!
This is so much better now! Thanks!
edit: I was using Java 8, not 7, as was clearly stated being a requirement in the top accepted post. Now working, with Java 7u67. Now Eclipse is complaining about Java's version, but at least Matlab is mex'ing for me, and text looks awesome.
Old: I have attempted this fix three times now, and can't figure out why it still doesn't work for me. I really like 2014a in retina rendered mode, but doc calls freeze matlab hard, despite patching and deleting the .matlab folder. What I have done:
  1. fresh download and install of 2014a
  2. fresh download and install of patch 870843
  3. open matlab in crisp mode, try doc, freezes, force quit
  4. rm -r ~/.matlab (which blows away my previous preferences :( )
  5. reopen in crisp mode, try doc, freezes
  6. ?, complain, post this.
  7. fix: uninstall java 8, install java 7u67.OSX 10.9.4, Mid 2012 Retina 15" MBPr

Sign in to comment.


Answer by Cong
on 18 Nov 2014

The simplest why to solve this problem is here: http://blog.csdn.net/songrotek/article/details/41178369 Of course you need to understand Chinese.
In one word, download the latest version of JAVA, and replace all files in /Applications/Matlab_2014a.app/sys/java/jre/maci64/jre/ with all files in /Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/. It may depend on the exact direction of your application.

  3 Comments

However: It does NOT work for figures.
I have - OSX Yosemite 10.10.1 on MBP Retina 15 early 2013 - Matlab_R2014b - java 1.7
Any idea where to go from here would be much appreciated.
Thanks Cong for that very simple solution - it works perfectly for the Matlab GUI.
But still the figures are blurry, as Wolfgang already said. Did anyone find a solution to apply the same to the graphics application???
Any help would be just great!
It seems that the JRE upgrade only resolves the issue with desktop elements, but not with the graphics system (figures). I recommend to get in touch with MathWorks technical support about this.

Sign in to comment.


Answer by florian
on 11 May 2014
Edited by florian
on 11 May 2014

@Bob thank you for reporting the website issue I fixed it
@Matthew glad it works, I am happy I can finally give something back to the community
@Dongeun Lee thank you for adding this, I added it to the code on my website
Best, florian

  0 Comments

Sign in to comment.



Answer by Andrew Janke on 16 Aug 2014

FYI, this is still broken in R2014b as of the R2014b Prerelease. It's still using the same Java 1.7.0_11 JVM that has the retina display issues.

  0 Comments

Sign in to comment.