hexrdgui icon indicating copy to clipboard operation
hexrdgui copied to clipboard

colors for plotting structures

Open akrygier opened this issue 1 year ago • 6 comments

Can the colors that XRD reflections use for plotting in the integration view be changed to matplotlib default? Or something similar?

akrygier avatar Mar 27 '23 23:03 akrygier

Do you mean the plotting for the powder overlay reflections? In the overlay manager, if you click on the row for the overlay of interest, and you click on the "Edit Style" button, a dialog appears where you can edit the styles for the overlay.

image

The default settings are here, and we can change them.

psavery avatar Mar 28 '23 16:03 psavery

@akrygier Let us know if you have suggested changes for the defaults.

psavery avatar Apr 05 '23 12:04 psavery

Sorry I missed this before.

I typically use 2theta = 15 azimuth = 60

Not sure that’s absolutely optimal, but it works well enough for the tardis data I have looked at.

On Wed, Apr 5, 2023 at 5:17 AM Patrick Avery @.***> wrote:

@akrygier https://github.com/akrygier Let us know if you have suggested changes for the defaults https://github.com/HEXRD/hexrdgui/blob/a21da7f8e00ba1bb120b40c617b2536fb67671e2/hexrd/ui/overlays/powder_overlay.py#L504-L517 .

— Reply to this email directly, view it on GitHub https://github.com/HEXRD/hexrdgui/issues/1364#issuecomment-1497391949, or unsubscribe https://github.com/notifications/unsubscribe-auth/AOI42NHKHSGH6DISE4ONXJTW7VPFRANCNFSM6AAAAAAWJY56KE . You are receiving this because you were mentioned.Message ID: @.***>

--

  • Andy

akrygier avatar Apr 06 '23 03:04 akrygier

Sorry misread.

The colors I was thinking are just the matplotlib default cycle.

On Wed, Apr 5, 2023 at 8:14 PM Andy Krygier @.***> wrote:

Sorry I missed this before.

I typically use 2theta = 15 azimuth = 60

Not sure that’s absolutely optimal, but it works well enough for the tardis data I have looked at.

On Wed, Apr 5, 2023 at 5:17 AM Patrick Avery @.***> wrote:

@akrygier https://github.com/akrygier Let us know if you have suggested changes for the defaults https://github.com/HEXRD/hexrdgui/blob/a21da7f8e00ba1bb120b40c617b2536fb67671e2/hexrd/ui/overlays/powder_overlay.py#L504-L517 .

— Reply to this email directly, view it on GitHub https://github.com/HEXRD/hexrdgui/issues/1364#issuecomment-1497391949, or unsubscribe https://github.com/notifications/unsubscribe-auth/AOI42NHKHSGH6DISE4ONXJTW7VPFRANCNFSM6AAAAAAWJY56KE . You are receiving this because you were mentioned.Message ID: @.***>

--

  • Andy

--

  • Andy

akrygier avatar Apr 06 '23 03:04 akrygier

Sounds good. I can take a look at what matplotlib uses in their default cycle.

psavery avatar Apr 06 '23 11:04 psavery

They should just cycle by default [blue, orange, so on] without specifying the color directly Or you can call them by color='CN' where N is in [0:9] in a plt.plot().

Here are the hex codes:

import matplotlib.pyplot as plt

#display hex color codes print(plt.rcParams['axes.prop_cycle'].by_key()['color'])

['#1f77b4', '#ff7f0e', '#2ca02c', '#d62728', '#9467bd', '#8c564b', '#e377c2', '#7f7f7f', '#bcbd22', '#17becf']

akrygier avatar May 17 '23 19:05 akrygier