0

When the size of a plotted sparsity matrix is increased, the title (if typeset by TeX) is anomalously blurred. What is the basis of this effect and how can it be avoided?

Example:

spy(magic(2)); title('Text','interpreter','latex','FontSize',20);
spy(magic(200)); title('Text','interpreter','latex','FontSize',20);

enter image description here enter image description here

Superbest
  • 25,318
  • 14
  • 62
  • 134
user001
  • 1,850
  • 4
  • 27
  • 42

1 Answers1

1

Related to (and actually the same issue as in) How to prevent LATEX-labels in MATLAB GUI to become blurry?

The solution applies. After inputting:

spy(magic(200)); title('Text','interpreter','latex','FontSize',20);

I get:

enter image description here

The command get(gcf, 'renderer') returns ans = zbuffer. Afterwards, I input set(gcf, 'renderer', 'painters') which immediately makes the result be:

enter image description here

For reference, this is Matlab r2011b.

Community
  • 1
  • 1
Superbest
  • 25,318
  • 14
  • 62
  • 134
  • Thanks, the solution worked perfectly. (I didn't notice the related post.) This seems like a flaw in MATLAB. I'm not sure why the end user would need to use deploy tricks like this to obtain non-blurry output. Why is the renderer being changed in one case (`spy(magic(200))`) but not another (`spy(magic(2))`)? – user001 Mar 14 '12 at 22:43
  • 1
    I'm not familiar with the code, but one might presume that the renderer is used for complex figures due to performance issues, and is not switch back due to oversight, design decision, or the fact that it can't be done any other way. Perhaps the heuristic deems the small matrix to be simple enough for the painter renderer. Who knows? Fortunately, it's easy to fix. – Superbest Mar 14 '12 at 22:51