0 System Configuration + software version
Host: Dell Optiplex 390 MT (i5)
System + Software: CentOS 6.5 x64, Matlab R2012, R2013
System + Software: CentOS 6.7 x64, Matlab R2014
There is an issue in which the print function prints incorrectly in both combinations.
1 Problem Description
Normally, print prints the picture that the image handle points to as "WYSIWYG", including attributes such as line thickness and font size.
Because the graphics driver from CentOS does not control and use the onboard NVIDIA graphics card, the printed JPEG images are particularly small fonts, regardless of the font size set in the *.fig file, and the settings in *.fig are completely different.
From the CentOS 6..4 upgrade to CentOS 6.7, this problem has not been found for the real reason, until recently purchased a new graphics card, struggled to install its Nvidia driver, re-use the Print function mapping, only to find a real solution to the "WYSIWYG" problem.
clf;x=1:100; Y=x;plot (x, y, ' B. '); Hold on;; Plot (X,sin (x), ' G. '); Xlabel (' Test x '); Ylabel (' Test y '); Set (FindAll (GCF, ' Type ', ' text '), ' FontSize ', ', ' fontname ', ' Timew New Roman '); % set the text to 20th Times New Roman font set (GCF, ' Paperpositionmode ', ' auto ');p rint (GCF, '-djpeg ', '-r600 ', ' test1.jpg '); Set ( FindAll (GCF, ' Type ', ' text '), ' FontSize ', ' n ', ' fontname ', ' Timew New Roman '); % set Text to 12th times New Roman font set (GCF, ' Paperpositionmode ', ' auto ');p rint (GCF, '-djpeg ', '-r600 ', ' test2.jpg ');
The above code can be tested to see whether the result of the graph satisfies the "WYSIWYG" effect. If satisfied, the following text can be skipped directly.
2 Solutions2.1 Graphics Driver Identification
The CentOS system comes with a graphics driver by default, but it does not drive well. If you enter the ' OpenGL Info ' command in the MATLAB command window, you may need to install the appropriate driver separately for the following results, which are similar to this.
% CentOS 6.5, Matlab r2013a, System comes with graphics driver, NVIDIA graphics driver not specifically installed >> OpenGL info Version: '2.1 Mesa 10.4.3' C4/>vendor: ' Mesa Project ' Renderer: 'software Rasterizer' maxtexturesize:16384 Visual: ' Visual 0x104, (RGBA + bits (8 8 8 8), Z depth, H ... ' software: ' False ' supportsgraphicssmoothing:0
supportsdepthpeeltransparency:1 supportsalignvertexcenters:0 Extensions: {150x1 cell} maxframebuffersize:16384
The system comes with the video card driver, the OpenGL information returned by Matlab r2013a, did not see the NVIDIA graphics card name, can not use hardware rendering, can only use the software (rasterization) renderer.
2.2 After installing the appropriate NVIDIA graphics card driver separately
To install NVIDIA graphics drivers, see my other blog, "Installing Nvidia GT730 in CentOS 6.7". The article mentions the different installation method, if in the setup process encounters the problem which the card in the green screen after the reboot, may try the blog the operation procedure. As for why the green screen, I do not know ...
after installing the graphics driver, Matlab r2014b The returned OpenGL information, showing that a video card called ' GeForce GT 730/pcie/sse2 ' has been loaded and can use hardware rendering and hardware acceleration.
% CentOS 6.7, Matlab r2014b, specifically installs NVIDIA graphics drivers
>> OpenGL info Version: '4.5.0 nvidia 352.30' Vendor: ' nvidia Corporation ' Renderer: ' GeForce GT 730/pcie/sse2' maxtexturesize:16384 Hardware acceleration, Double buffer, ... ' Software: ' False ' supportsgraphicssmoothing:1 supportsdepthpeeltransparency:1 Supportsalignvertexcenters:1 Extensions: {316x1 cell} maxframebuffersize:16384
3 Testing
Finally, the 1th section of the drawing command for a simple test, with the font size adjustment, generated in the *.jpg file, the font should be changed, the realization of the real "WYSIWYG".
At this point, the Print command bug finally solved!
4 References
[1] http://www.cnblogs.com/snake553/p/4941163.html , "Installing the GT730 of Nvidia in CentOS 6.7 "
Solutions for "non-derived" bugs in the MATLAB print function in CentOS 6