Skip to content

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

Closed
@xarico10

Description

@xarico10

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions