Fraction in label of a scatter plot

42 views (last 30 days)
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]);

Accepted Answer

Walter Roberson
Walter Roberson on 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';

More Answers (0)

Community Treasure Hunt

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

Start Hunting!