1

I Need to Change the font of Axis Parameters to Arial. What amendment in the code is required? I am already defining my axis Parameters in Arial Font but it is not working? Thanks

newfigure = h_figure; 
%  fsize=[0 0 9 7]*1.394;  % Genesys
fsize=[0 0 9 7]*1.394;  % Framemaker

set(newfigure,'PaperUnits','centimeters');
% Festlegen der Dimensionen in cm der gesamten Grafik + Ueberschrift
set(newfigure,'PaperPosition',fsize); 
set(newfigure,'Position',fsize*254/6.1); 
figure(h_figure);
ax1=axes('Position',[0 0 1 1],'Visible','off');

% copy the axes into the new figure
%newaxes = copyobj(handles.axes2,newfigure);
%set(ax1,'Position',[0.1475 0.11 0.7688 0.841],'FontSize',[10],'GridLineStyle','-');
set(ax1,'Position',[0.5 0.11 0.7688 0.5],'FontSize',[20],'FontName','Arial','GridLineStyle','-','MinorGridLineStyle','-'); % Ra. 5.7.13
% print the new figure

%pos=0;
  pos=findstr(image_name, 'color'); % für farbige Plots!
  if isempty(pos)
      %print(newfigure,'-deps','-tiff',image_name);
      print(newfigure,'-dsvg',image_name);  %--------------------------------------------------------------------------------------------------------------- NEW MODIFICATION
  else
      print(newfigure,'-depsc','-tiff',image_name);    
  end

% save smithchart
savefiguresmith_cmd_ext(handles)
%print(newfigure,'-deps','-tiff',filename);
% close the new figure
%close(newfigure)
KHAN6691
  • 11
  • 1
  • 4

1 Answers1

0

I think I found the problem:
For the font to be updated, you should execute drawnow or pause function, after setting the font.

See following code sample:

figure;
ax1 = gca;
plot(-pi:0.1:pi, sin(-pi:0.1:pi), 'Parent', ax1);
for i = 1:10
    set(ax1, 'FontSize',20,'FontName','Arial')
    drawnow
    pause(0.5);
    set(ax1, 'FontSize',20,'FontName','Courier New')
    drawnow
    pause(0.5);
end
Rotem
  • 30,366
  • 4
  • 32
  • 65