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

2D multiple plots not keeping same color on same figure #167

Closed
xarico10 opened this issue Jul 25, 2021 · 0 comments · Fixed by #213
Closed

2D multiple plots not keeping same color on same figure #167

xarico10 opened this issue Jul 25, 2021 · 0 comments · Fixed by #213
Assignees

Comments

@xarico10
Copy link
Contributor

When plotting multiple plots on a single figure, the series doesn't share the same color (using MATLAB they do)

Code:

x = linspace(0,2*pi);
y1 = 5*sin(x);
y2 = sin(5*x);
tiledlayout(2,1)

% Top plot
ax1 = nexttile;
stairs(ax1,x,y1)

% Bottom plot
ax2 = nexttile;  
stairs(ax2,x,y2)

fig2plotly();

Expected and obtained (https://chart-studio.plotly.com/~xarico10/192/#/) plots:

Captura de Pantalla 2021-07-24 a la(s) 7 51 25 p  m

Captura de Pantalla 2021-07-24 a la(s) 7 50 31 p  m

And, since the Name-Value argument Color doesn't work (#155 (comment)), there's no possible way of forcing same line color on both plots.

(Specifying same Color doesn't solve the problem):

x = linspace(0,2*pi);
y1 = 5*sin(x);
y2 = sin(5*x);
tiledlayout(2,1)

% Top plot
ax1 = nexttile;
stairs(ax1,x,y1,'Color','red')

% Bottom plot
ax2 = nexttile;  
stairs(ax2,x,y2,'Color','red')

fig2plotly();

Expected and obtained (https://chart-studio.plotly.com/~xarico10/194/#/) plots:
Captura de Pantalla 2021-07-24 a la(s) 7 50 23 p  m
Captura de Pantalla 2021-07-24 a la(s) 7 50 31 p  m

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 a pull request may close this issue.

2 participants