Skip to content

Conversation

gilbertogalvis
Copy link
Contributor

This PR fix a issue when log scale is set on axes.

Example code

gapminderDataFiveYear = readtable('https://raw.githubusercontent.com/plotly/datasets/master/gapminderDataFiveYear.csv');

year = 0;
if year == 0
    year = min(gapminderDataFiveYear.year);
end

YEAR = year;
rows = (gapminderDataFiveYear.year == YEAR);
subtab = gapminderDataFiveYear(rows,:);
scatter(subtab.gdpPercap, ...
    subtab.lifeExp, ...
    subtab.pop/100000, ...
    categorical(subtab.country), 'filled');

%set(gca,'FontSize',14);
%xlabel(gca, 'gdpPercap');
%ylabel(gca, 'lifeExp');  
set(gca,'xscale','log');

fig = fig2plotly(gcf, 'offline', true, 'open', false, 'Visible', false);
response = plotlyoffline(fig);

web(response, '-browser');

Result:

Screen Shot 2021-10-12 at 6 00 54 PM

@gilbertogalvis gilbertogalvis merged commit 620f32d into master Oct 12, 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