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

Default Colors for Elements/Orbitals #8

Closed
shyamd opened this issue Apr 26, 2018 · 9 comments
Closed

Default Colors for Elements/Orbitals #8

shyamd opened this issue Apr 26, 2018 · 9 comments

Comments

@shyamd
Copy link
Contributor

shyamd commented Apr 26, 2018

It would be really nice if there was a default color scheme for all elements, or could auto generate something based on the total number of elements/orbitals. Right now, I'm just hard-coding in color brewer color sets for X number of elements.

@shyamd shyamd changed the title Default Colors for Orbitals Default Colors for Elements/Orbitals Apr 26, 2018
@ajjackson
Copy link
Member

I suspect it is impossible to develop a colour scheme for all elements which allows the contributions to be easily distinguished in all compounds.

The current scheme gives reasonable contrast in my experience; can you show an example where the default behavior is particularly poor?

When you say "hard-coding" you are using a .conf file, right? I would encourage users to go with .conf files if they have opinions about colour choice. (As long as we nake sure the defaults are also decent!)

I am interested in this issue as I would like to imrove the colour-blindness accessibility; but it is difficult at this point to imagine what a colour-blind-safe quaternary PDOS would look like. Adding markers to the lines could be very effective, but also could become very cluttered.

@utf
Copy link
Member

utf commented Apr 26, 2018

Hi @shyamd

Thanks for this comment, generating a custom scheme based on the total number of orbits would be nice.

Currently, if the orbital is not found in orbital_colours.conf, we choose a colour from this list of 22 colours of maximum contast: http://www.iscc.org/pdf/PC54_1724_001.pdf

You should only have to create your own config file if you want the colour scheme to be consistent over multiple system with different composition (or you are not happy with the colours in the above list).

Unfortunately, due to the large number of elements and orbitals, creating a default colour for all of them would surely result in some colour reuse, which is something we'd like to avoid.

@shyamd
Copy link
Contributor Author

shyamd commented Apr 26, 2018

@utf , Sounds good. I also recently found this: http://tools.medialab.sciences-po.fr/iwanthue/ Which lets you generate a ton of different color palettes with lots of separate hues. Might be a good place to get several sets of different color palettes. Hard coding in 1 to say 24 would more than enough, but you'd want each set to be unique a not just a mishmash of from a standard set of colors.

On a side note, I noticed that If I regenerate the plot, say in a notebook, I can get different colors for the DOS. Might this be a caching issue with the color picker?

@shyamd
Copy link
Contributor Author

shyamd commented Apr 26, 2018

Also, it might be a good idea to change the Energy Label to something like E-E_f (eV) when zero'ing to the Fermi level.

@ajjackson
Copy link
Member

The current colour palette is a sequence of 23 colours. If you think the palette needs to be improved, please be more specific about how it is failing so that we can consider our options; examples would be helpful. In my opinion this kind of line plot becomes difficult to interpret when there are more than four lines, so while there is room for improvement I would like to look further than merely tweaking colours.

I can reproduce the regeneration issue and see how that would be annoying. It is a result of the way the colour sequence is implemented as a cycle generator which is created at import time. This was actually done deliberately as it means that when dosplotters are called on a series of subplots the colours will be different for each. We could have an optional argument which chooses to use a fresh colour cycle or not; I have no strong preference as to which should be the default behaviour. @utf ?

I have moved the energy label discussion to a new Issue.

@shyamd
Copy link
Contributor Author

shyamd commented May 1, 2018

It might be a good idea to move the color cycle into the DOS Plotter object and have subplots grab it to enumerate forward. This will ensure consistency. I should be able to run plot over and over again and get the same plot.

@ajjackson
Copy link
Member

That only works if the subplots are all generated by the same DOS plotter.

I should be able to run plot over and over again and get the same plot.

I agree that this should be possible, but I am not convinced that it should replace the existing behaviour. Repeatedly calling the DOS plotter from a script is a likely use-case.

What I would really like would be if Sumo remembered which colours it had assigned to which elements and orbitals, so that calling it on say NaCl followed by KCl would give consistent colouring for the chlorine and pick different colours for the alkali metals. I think that would suit both cases?

@shyamd
Copy link
Contributor Author

shyamd commented May 1, 2018

Yeah that would be a good compromise.

@utf
Copy link
Member

utf commented May 8, 2018

This has been addressed in #10.

@utf utf closed this as completed May 8, 2018
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

3 participants