Fraction in label of a scatter plot

15 vues (au cours des 30 derniers jours)
Milan Kumar
Milan Kumar le 16 Juil 2019
Commenté : Milan Kumar le 16 Juil 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 commentaires
KALYAN ACHARJYA
KALYAN ACHARJYA le 16 Juil 2019
Is it axis label?
Milan Kumar
Milan Kumar le 16 Juil 2019
No. The plot label.

Connectez-vous pour commenter.

Réponse acceptée

Walter Roberson
Walter Roberson le 16 Juil 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';

Plus de réponses (0)

Community Treasure Hunt

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

Start Hunting!

Translated by