Filter löschen
Filter löschen

Fraction in label of a scatter plot

22 Ansichten (letzte 30 Tage)
Milan Kumar
Milan Kumar am 16 Jul. 2019
Kommentiert: Milan Kumar am 16 Jul. 2019
hi,
I want to add a fraction label in scatter plot. Please help.
clear all;
clc;
Base=[0.01 0.00 1.46
0.05 0.00 1.46
0.1 1.94 1.22
0.15 1.63 1.15
0.2 1.47 1.11
0.25 1.38 1.09
0.3 1.31 1.07];
h=zeros(1,2);
h(1)=scatter(Base(:,1),Base(:,2),30,'b','s','LineWidth',2,'DisplayName','\frac{X}{Y}');
hold on;
h(2)=scatter(Base(:,1),Base(:,3),30,'b','+','LineWidth',2,'DisplayName','\frac{W}{Z}');
ylim([0,2]);
  2 Kommentare
KALYAN ACHARJYA
KALYAN ACHARJYA am 16 Jul. 2019
Is it axis label?
Milan Kumar
Milan Kumar am 16 Jul. 2019
No. The plot label.

Melden Sie sich an, um zu kommentieren.

Akzeptierte Antwort

Walter Roberson
Walter Roberson am 16 Jul. 2019
h = gobjects(1,2);
h(1) = scatter(Base(:,1), Base(:,2), 30, 'b', 's', 'LineWidth', 2, 'DisplayName',' $\frac{X}{Y}$');
hold on;
h(2) = scatter(Base(:,1), Base(:,3), 30, 'b', '+', 'LineWidth', 2, 'DisplayName', '$\frac{W}{Z}$');
lh = legend('show');
lh.Interpreter = 'latex';

Weitere Antworten (0)

Community Treasure Hunt

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

Start Hunting!

Translated by