Filter löschen
Filter löschen

ENLARGE AND CHANGE COLOR OF A FRACTION IN TITLE !

4 Ansichten (letzte 30 Tage)
George Vigilaios
George Vigilaios am 19 Aug. 2020
Kommentiert: George Vigilaios am 19 Aug. 2020
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!!!

Akzeptierte Antwort

John D'Errico
John D'Errico am 19 Aug. 2020
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 Kommentare
George Vigilaios
George Vigilaios am 19 Aug. 2020
thank you, sir! very helpful!
George Vigilaios
George Vigilaios am 19 Aug. 2020
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.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (1)

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

Kategorien

Mehr zu Graphics Object Programming finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by