필터 지우기
필터 지우기

ENLARGE AND CHANGE COLOR OF A FRACTION IN TITLE !

조회 수: 4 (최근 30일)
George Vigilaios
George Vigilaios 2020년 8월 19일
댓글: George Vigilaios 2020년 8월 19일
Hi everyone! Some help please! Beginner, here!
i used
h1=title('$y = \frac{1}{x+1}$');set (h1,'Interpreter','latex');
and got my desired fraction on title but TOO SMALL and BLACK.What are the exact lines to Change Size AND colour?
Thanks!!!

채택된 답변

John D'Errico
John D'Errico 2020년 8월 19일
Not THAT much of a beginner. :) A true beginner thinks Latex is something you find in rubber gloves. :)
h1=title('$y = \frac{1}{x+1}$');set (h1,'Interpreter','latex');
>> h1
h1 =
Text ($y = \frac{1}{x+1}$) with properties:
String: '$y = \frac{1}{x+1}$'
FontSize: 11
FontWeight: 'bold'
FontName: 'Helvetica'
Color: [0 0 0]
HorizontalAlignment: 'center'
Position: [0.500000638346518 1.00401459854015 0.5]
Units: 'data'
Show all properties
>> get(h1)
BackgroundColor: 'none'
BeingDeleted: off
BusyAction: 'queue'
ButtonDownFcn: ''
Children: [0×0 GraphicsPlaceholder]
Clipping: off
Color: [0 0 0]
ContextMenu: [0×0 GraphicsPlaceholder]
CreateFcn: ''
DeleteFcn: ''
EdgeColor: 'none'
Editing: off
Extent: [0.456989192742906 1.00401459854015 0.0860229307605374 0.0400822771726734]
FontAngle: 'normal'
FontName: 'Helvetica'
FontSize: 11
FontSmoothing: on
FontUnits: 'points'
FontWeight: 'bold'
HandleVisibility: 'off'
HitTest: on
HorizontalAlignment: 'center'
Interpreter: 'latex'
Interruptible: on
LineStyle: '-'
LineWidth: 0.5
Margin: 3
Parent: [1×1 Axes]
PickableParts: 'visible'
Position: [0.500000638346518 1.00401459854015 0.5]
Rotation: 0
Selected: off
SelectionHighlight: on
String: '$y = \frac{1}{x+1}$'
Tag: ''
Type: 'text'
Units: 'data'
UserData: []
VerticalAlignment: 'bottom'
Visible: on
If you want to see all the properties, get gives you an expanded list.
Now, you can change a property on the fly using a simple assignment.
>> h1.FontSize = 18;
>> h1.Color = 'r'
h1 =
Text ($y = \frac{1}{x+1}$) with properties:
String: '$y = \frac{1}{x+1}$'
FontSize: 18
FontWeight: 'bold'
FontName: 'Helvetica'
Color: [1 0 0]
HorizontalAlignment: 'center'
Position: [0.500000638346518 1.00656934306569 0.5]
Units: 'data'
Show all properties
And now the title is as I set it.
  댓글 수: 2
George Vigilaios
George Vigilaios 2020년 8월 19일
thank you, sir! very helpful!
George Vigilaios
George Vigilaios 2020년 8월 19일
And very good humour, too! I am a beginner, indeed. You see, 20 days ago i thought Mathcad Prime 3.1 was better than Matlab. You see now, i have a good sense of humour as well.

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

KSSV
KSSV 2020년 8월 19일
plot((1:10).^2)
title(['\fontsize{16}black {\color{magenta}magenta '...
'\color[rgb]{0 .5 .5}teal \color{red}red} black again'])

카테고리

Help CenterFile Exchange에서 Graphics Object Programming에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by