Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with Markers and Legends #31

Open
free41 opened this issue Jan 7, 2019 · 1 comment
Open

Issue with Markers and Legends #31

free41 opened this issue Jan 7, 2019 · 1 comment

Comments

@free41
Copy link

free41 commented Jan 7, 2019

I am seeing an issue when a legend is created with markers. Whenever a line includes a marker, the text in the legend corresponding to that line turns gray. I am using R2018a. The problem can be reproduced with:

% generate the signal
f = 50;  % frequency
Vm = 10; % peak
phi = 45; % phase
t = [0:0.0001:3/f];
th = 2*pi*f*t;
v1 = Vm*sin(th);
v2 = Vm*sin(th - phi);
v3 = Vm*sin(th - phi*2);

% plot them
plt = Plot(t*1E3, v1, t*1E3, v2, t*1E3, v3);

plt.LineStyle = {'-', '-', '-'}; % three line styles
plt.Markers = {'o', '', 's'};
plt.LegendBox = 'on';
plt.Legend = {'\theta = 0^o', '\theta = 45^o', '\theta = 90^o'}; % legends
@dvcorreia
Copy link

Having the same issue with the legend but with different problems in the markers. I'm using R2018b and the library is skipping some markers. The markers problem happens with and without legend. I've tried to mess with the MarkerSpacing but without success. The Plot properties and export can be seen bellow.

    plt = Plot(k, e(1, :), k, e(2, :));
    plt.LineStyle = {'--', '-'};
    plt.Markers = {'s', 'o'};
    plt.LegendBox = 'on';
    plt.MarkerSpacing = [0, 0];
    plt.Legend = {'Test Data', 'Training Data'};
    plt.XLabel = 'K';
    plt.YLabel = 'Misclassification rate';
    plt.Title = 'Misclassification rate';

lab1ex1_misclassificationrate

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants