I have tried solutions to related posts, but these don't appear to work in my case:
-----
ah = gca;
set(ah,'YTick',1:60);
hold on
for ii = 1:length(data(1,:))
try
plot(spikes(2:end,ii)/1000,(ii*ones(1,length(spikes(2:end,ii)))),'r.','MarkerSize', 4)
ylabel('\bfElectrode channel','FontSize',10)
title('\bfCH72, spikes across all channels', 'FontSize', 12)
catch exception
end
end
xlim([-10 260])
ch = measort(1:60,'lin');
set(ah,'YTickLabel',num2str(ch'), 'FontSize',4)
-------
The last code changes BOTH x and y axis label font size, even though only YTickLabel was specified. But I don't want my x-axis ticklabel fonts to be 4.
If this is indeed asking too much, can I at least hide the unreadable x-axis tick labels?
> set(ah,'YTickLabel',num2str(ch'), 'FontSize',4)
> The last code changes BOTH x and y axis label font size, even though
> only YTickLabel was specified.
Matlab is constructed so that the order of named parameters in set()
only matters for the Unit and Position properties; if it had a distinct
X Tick font size and Y Tick font size, it would use different names for
them, such as 'XFontSize' and 'YFontSize'. If you look at the axes_props
documentation you will see there is only one FontSize for the axes. And
as you have indirectly discovered, there is no Interpreter property for
tick labels.
> If this is indeed asking too much, can I at least hide the
> unreadable x-axis tick labels?
You can use patch() or rectangle() to put a box of the background color
over the labels. You may need to specify a z coordinate greater than 0
for the box. When you go to text() the new labels into place, be sure to
use a z coordinate greater than your box to be sure the new labels will
be in front of the box (well, this is actually only a consideration if
you are using the OpenGL renderer.)
Thanks for your reply.
A colleague showed me an even easier way to hide the x-axis tick labels:
set(ah,'XTickLabel',[])
There are several functions in the File Exchange that will replace the TickLabels with normal text objects providing full control. Well, all the properties of text objects anyway..
hth
figure; axes;
xlabel('not to change')
ylabel('\bfElectrode channel')
h = findobj('string','\bfElectrode channel');
set(h,'FontSize',18)