Skip to content

Fix color issues related to scatter functionality #412

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

Merged

Conversation

gilbertogalvis
Copy link
Contributor

This PR fix issues related to marker coloring in scatter functionality

Code Example

clear all; close all;

% Read data file
gdpLifeExp = readtable('https://gist.githubusercontent.com/chriddyp/5d1ea79569ed194d432e56108a04d188/raw/a9f9e8076b837d541398e999dcbac2b2826a81f8/gdp-life-exp-2007.csv');
continents = unique(gdpLifeExp.continent);

ax = axes();

hold on
for i=1:length(continents)
    rows = (strcmp(gdpLifeExp.continent, continents{i}));
    subtab = gdpLifeExp(rows,:);
    scatter(ax, subtab.gdpPerCapita, subtab.lifeExpectancy,...
        subtab.population/100000, [rand,rand,rand], 'filled',...
        'DisplayName', continents{i});
end
hold off

set(ax, 'xscale', 'log');

xlabel(ax,'gdp per capita');
ylabel(ax,'life expectancy');
legend(ax, continents);

shg

fig = fig2plotly(gcf);

response = plotlyoffline(fig);
web(response, '-browser');

Results

Screen Shot 2021-10-14 at 10 02 21 PM

Screen Shot 2021-10-14 at 10 02 39 PM

Screen Shot 2021-10-14 at 10 24 00 PM

Screen Shot 2021-10-14 at 10 27 41 PM

@gilbertogalvis gilbertogalvis merged commit 97a3250 into master Oct 15, 2021
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

Successfully merging this pull request may close these issues.

2 participants