plotly/plotly_matlab

docs - maps have wrong default color pallete

danton267 opened this issue · 5 comments

This issues was fixed by PR #434

Bellow share results for one example of each geo chart case

geoscatter function

Screen Shot 2021-10-22 at 5 32 53 PM

geoplot function

Screen Shot 2021-10-22 at 5 33 36 PM

geobubble function

Screen Shot 2021-10-22 at 5 34 00 PM

REMARK

It is important to note that for geo charts there is an optional parameter called 'geoRenderType'. This parameter can be set to 'geo' or 'mapbox'. Geo charts by default use 'geo'.

Below I share examples using 'mapbox'

geoscatter function

lon = (-170:10:170);
lat = 50 * cosd(3*lon);
A = 101 + 100*(sind(2*lon));
C = cosd(4*lon);
geoscatter(lat,lon,A,C,'^')

fig2plotly(gcf, 'geoRenderType', 'mapbox');

Screen Shot 2021-10-22 at 4 35 22 PM

geoplot function

latSeattle = 47.62;
lonSeattle = -122.33;
latAnchorage = 61.20;
lonAnchorage = -149.9;

geoplot([latSeattle latAnchorage],[lonSeattle lonAnchorage],'g-*')
geolimits([45 62],[-149 -123])

fig2plotly(gcf, 'geoRenderType', 'mapbox');

Screen Shot 2021-10-22 at 5 03 05 PM

geobubble function

tsunamis = readtable('tsunamis.xlsx');

tsunamis.Cause = categorical(tsunamis.Cause);

geobubble(tsunamis,'Latitude','Longitude', ...
    'SizeVariable','MaxHeight','ColorVariable','Cause');

fig2plotly(gcf, 'geoRenderType', 'mapbox');

Screen Shot 2021-10-22 at 5 07 44 PM

NOTE:

The mapbox option makes geo charts more elegant, but has limitations regarding markers (they can only be circles)

Noting down here that none of the axes are captured with fig2plotly().

tsunamis = readtable('tsunamis.xlsx');

colordata = categorical(tsunamis.Cause);

gb = geobubble(tsunamis.Latitude,tsunamis.Longitude,tsunamis.MaxHeight,colordata,'Title','Tsunamis');

gb.SizeLegendTitle = 'Max Height';
gb.ColorLegendTitle = 'Cause';

fig2plotly(gcf);

not captured properly

Noting down here that none of the axes are captured with fig2plotly().

Yes. When I updated this functionality I wrote it down as an observation. The plotly functionalities used to create the geo charts do not allow to configure the tick labels and some other axes features

tsunamis = readtable('tsunamis.xlsx');

colordata = categorical(tsunamis.Cause);

gb = geobubble(tsunamis.Latitude,tsunamis.Longitude,tsunamis.MaxHeight,colordata,'Title','Tsunamis');

gb.SizeLegendTitle = 'Max Height';
gb.ColorLegendTitle = 'Cause';

fig2plotly(gcf);

not captured properly

This issue was fixed by PR #462

Result using 'geo' as 'geoRenderType'

Screen Shot 2021-10-26 at 9 13 37 AM

Result using 'mapbox' as 'geoRenderType'

Screen Shot 2021-10-26 at 9 14 06 AM