Why do UICONTROL and Java objects appear pixellated when I print them from MATLAB?

I would like to create pages with graphics, tables, text, etc. I have found the best way to do this is to use a MATLAB figure and import Java objects to this figure. The problem arises when I do the following:
text(.5,.5,'Hello world');
import javax.swing.JLabel;
j = JLabel('Hello World');
javacomponent(j,[100,50,100,100]);
When I print the resulting figure, the Java object appears pixellated. The quality is not suitable for my application.

 Accepted Answer

This is a limitation in printing Java components in MATLAB. Java components are converted to bitmaps at the beginning of the print process. Bitmaps do not scale well, so when the figure is then scaled for printing, the jagged edges of the text become exaggerated.
There are no workarounds that produce high-quality printouts of Java components from a MATLAB figure window.
By making sure that the figure is not scaled for printing, you might achieve more optimal results.

More Answers (0)

Categories

Find more on Creating, Deleting, and Querying Graphics Objects in Help Center and File Exchange

Products

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!