2014年9月3日 星期三

更改繪圖axis字型

Example

n = [0:20]; x = [(n-3) == 0];
hd = stem(n,x,'k');
axis([0,20,min(x),max(x)]);
set(get(hd,'Parent'),'FontName','times new roman')


Results

原始圖(字型為Helvetica)

更改後(字型為times new roman)




觀察繪圖區內的屬性

Example:

n = [0:20]; x = [(n-3) == 0];
hd = stem(n,x,'k');
axis([0,20,min(x),max(x)]);
get(get(hd,'Parent'))

Results:
ActivePositionProperty = outerposition
ALim = [0 1]
ALimMode = auto
AmbientLightColor = [1 1 1]
Box = on
CameraPosition = [10 0.5 17.3205]
CameraPositionMode = auto
CameraTarget = [10 0.5 0]
CameraTargetMode = auto
CameraUpVector = [0 1 0]
CameraUpVectorMode = auto
CameraViewAngle = [6.60861]
CameraViewAngleMode = auto
CLim = [0 1]
CLimMode = auto
Color = [1 1 1]
CurrentPoint = [ (2 by 3) double array]
ColorOrder = [ (7 by 3) double array]
DataAspectRatio = [20 1 2]
DataAspectRatioMode = auto
DrawMode = normal
FontAngle = normal
FontName = Helvetica
FontSize = [10]
FontUnits = points
FontWeight = normal
GridLineStyle = :
Layer = bottom
LineStyleOrder = -
LineWidth = [0.5]
MinorGridLineStyle = :
NextPlot = replace
OuterPosition = [ (1 by 4) double array]
PlotBoxAspectRatio = [1 1 1]
PlotBoxAspectRatioMode = auto
Projection = orthographic
Position = [ (1 by 4) double array]
TickLength = [0.01 0.025]
TickDir = in
TickDirMode = auto
TightInset = [ (1 by 4) double array]
Title = [182.015]
Units = normalized
View = [0 90]
XColor = [0 0 0]
XDir = normal
XGrid = off
XLabel = [183.015]
XAxisLocation = bottom
XLim = [0 20]
XLimMode = manual
XMinorGrid = off
XMinorTick = off
XScale = linear
XTick = [ (1 by 11) double array]
XTickLabel = [ (11 by 2) char array]
XTickLabelMode = auto
XTickMode = auto
YColor = [0 0 0]
YDir = normal
YGrid = off
YLabel = [184.015]
YAxisLocation = left
YLim = [0 1]
YLimMode = manual
YMinorGrid = off
YMinorTick = off
YScale = linear
YTick = [ (1 by 11) double array]
YTickLabel = [ (11 by 3) char array]
YTickLabelMode = auto
YTickMode = auto
ZColor = [0 0 0]
ZDir = normal
ZGrid = off
ZLabel = [185.015]
ZLim = [-1 1]
ZLimMode = auto
ZMinorGrid = off
ZMinorTick = off
ZScale = linear
ZTick = [-1 0 1]
ZTickLabel =
ZTickLabelMode = auto
ZTickMode = auto

BeingDeleted = off
ButtonDownFcn =
Children = [ (2 by 1) double array]
Clipping = on
CreateFcn =
DeleteFcn =
BusyAction = queue
HandleVisibility = on
HitTest = on
Interruptible = on
Parent = [1]
Selected = off
SelectionHighlight = on
Tag =
Type = axes
UIContextMenu = []
UserData = []
Visible = on