Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>You can also play with axes label font to make it smaller.</p> <pre><code>set(gca,'FontSize',6) </code></pre> <p>See also other <a href="http://www.mathworks.com/help/techdoc/ref/axes_props.html" rel="nofollow noreferrer">axes properties</a> to change font - FontName, FontWidth, FontUnits, etc.</p> <p><strong>Another solution</strong>: If your labels are short, you can alternate there distance from the axes, so the labels will not overlap. Check this example:</p> <pre><code>lbl = cellstr(reshape(sprintf('%3d',1:100),3,100)'); lbl(1:2:100) = strcat(lbl(1:2:100),{' '}); imagesc(rand(100)) set(gca,'ytick',1:100) set(gca,'yticklabel',lbl) </code></pre> <p>Part of the resulted image:</p> <p><img src="https://i.stack.imgur.com/vjvjZ.png" alt="example image"></p> <p><strong>UPDATE</strong></p> <p>To answer your updated question. </p> <ol> <li>PDF document can contain only static images. Once you saved the figure to PDF (or any other graphic file), you cannot zoom in/out as with MATLAB figure tools. </li> <li>You can zoom first on the MATLAB figure, then save PDF file. In this case the figure will be saved as is. But this way assumes user interactivity with the figure.</li> <li>If you know your region of interest in advance, you can set axes limits with XLim/YLim properties, then save the figure. </li> </ol> <p>Example:</p> <pre><code>imagesc(X); set(gca, 'ytick', 1:1000, 'yticklabe', ylabel); set(gca, 'XLim',[1 20], 'YLim', [20 40]) saveas(gcf, 'fig.pdf'); </code></pre> <p>By the way, you can also save figure to file with <a href="http://www.mathworks.com/help/techdoc/ref/print.html" rel="nofollow noreferrer">PRINT</a> function. More flexible. SAVEAS is just wrapper around it.</p> <pre><code>print('-dpdf','fig.pdf') </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload