Skip to content

Grid transformations with pcolor() #265

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

Closed
xarico10 opened this issue Aug 2, 2021 · 1 comment
Closed

Grid transformations with pcolor() #265

xarico10 opened this issue Aug 2, 2021 · 1 comment
Assignees

Comments

@xarico10
Copy link
Contributor

xarico10 commented Aug 2, 2021

When using pcolor() and trying to use defined non-regular grids, an empty figure is printed.

[X,Y] = meshgrid(-3:6/17:3);
XX = 2*X.*Y;
YY = X.^2 - Y.^2;
colorscale = [1:18; 18:-1:1];
C = repmat(colorscale,9,1);
pcolor(XX,YY,C);

fig2plotly(gcf, 'offline', false);

Expected and generated (https://chart-studio.plotly.com/~xarico10/797/#/) plots:
Captura de Pantalla 2021-08-02 a la(s) 11 34 15 a  m
Captura de Pantalla 2021-08-02 a la(s) 11 34 25 a  m

Examples on using pcolor() can be found on:
https://www.mathworks.com/help/matlab/ref/pcolor.html#responsive_offcanvas

@gilbertogalvis
Copy link
Contributor

PR #340 fix this issue

To test it please use the code

[X,Y] = meshgrid(-3:6/17:3);
XX = 2*X.*Y;
YY = X.^2 - Y.^2;
colorscale = [1:18; 18:-1:1];
C = repmat(colorscale,9,1);
pcolor(XX,YY,C);

fig2plotly(gcf, 'offline', 1, 'TreatAs', 'pcolor');

As you can see it is necessary to set 'TreatAs' Plotly Option to 'pcolor'

results looks as follow

Screen Shot 2021-08-13 at 8 44 38 PM

Screen Shot 2021-08-13 at 8 45 36 PM

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