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

Should layout be column major? #2047

Open
cossio opened this issue Jun 1, 2019 · 5 comments
Open

Should layout be column major? #2047

cossio opened this issue Jun 1, 2019 · 5 comments

Comments

@cossio
Copy link

cossio commented Jun 1, 2019

The layout option in Plots is row-major. I mean that plot(rand(100,4), layout = (2,2)) places series 1 and 2 on the first row instead of on the first column.

Whereas (for example) reshape(1:4, 2,2) gives 1 and 2 on the first column.

Since Julia arrays are generally column major, it might be worth making layouts column major as well for consistency.

@t-bltg
Copy link
Member

t-bltg commented Nov 25, 2022

IMO, this should be fixed in 2.0 for consistency with the julia ecosystem.

@cossio
Copy link
Author

cossio commented Nov 25, 2022

It's a big breaking change

@t-bltg
Copy link
Member

t-bltg commented Nov 25, 2022

Probably, but this is why major releases are for.
If we cannot make a library evolve we are doomed ;)

@cossio
Copy link
Author

cossio commented Nov 25, 2022

Yeah ... if it is clearly explained on the Readme / Changelog what needs to be changed in user code it should be fine!

@t-bltg
Copy link
Member

t-bltg commented Apr 22, 2023

Note for the implementation: this behavior should probably depend on a global flag set by default to column major, but with the ability to be toggled to row major if needed.

Arguments in favor:

  • julia is column major.

Arguments against:

  • we read from left to right.

@isentropic isentropic mentioned this issue Jan 12, 2024
37 tasks
@BeastyBlacksmith BeastyBlacksmith mentioned this issue Mar 12, 2024
30 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants