Question about colors! #19
Replies: 4 comments
-
Hi! I want to make sure I understand your question correctly: Are you looking to have two different color schemes on the same figure? For example, there would be two sub-plots, and one uses a blue palette and the other yellow? Or are you looking for new color palettes in general, as alternatives to the ones currently available in https://github.com/nmalkin/plot-likert/blob/master/plot_likert/colors.py? So, for example, in addition to the default colors and the yellow-teal color scheme in (Or something else?) |
Beta Was this translation helpful? Give feedback.
-
Thank you for getting back to me so quickly! I’m wondering about both the
first and second questions. Is there a way to customize more colors than
pre-specified likert5 to likert10? Also, it would be great to have
different color schemes in the same figure across two plots.
Looking forward to hearing from you!
Srishti
…On Thu, Aug 19, 2021 at 15:49 nmalkin ***@***.***> wrote:
Hi! I want to make sure I understand your question correctly:
Are you looking to have two different color schemes on the same figure?
For example, there would be two sub-plots, and one uses a blue palette and
the other yellow?
Or are you looking for new color palettes in general, as alternatives to
the ones currently available in
https://github.com/nmalkin/plot-likert/blob/master/plot_likert/colors.py?
So, for example, in addition to the default colors and the yellow-teal
color scheme in likert5, there would be others, like a blue gradient?
(Or something else?)
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#19 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACYCWCVSQXNA3BZ5XOOHMODT5WDARANCNFSM5CPEINXA>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&utm_campaign=notification-email>
.
|
Beta Was this translation helpful? Give feedback.
-
Good news, I think the answer to both questions is yes! Custom colorsUsing colors other than the pre-specified likert5 to likert10 should be pretty straightforward. To do this, create a list of color values as strings and pass it in when you're plotting: my_new_colors = [plot_likert.colors.TRANSPARENT, # this has to be first
'#6b9eff', '#4a85f5', '#3576f1', '#2167ec', '#0858f1']
plot_likert.plot_likert(data, plot_likert.scales.agree,
colors=my_new_colors); You can specify the values in any of the formats described here, though hex RGB values (like in my example) are probably going to be easiest. I don't have suggestions for specific color schemes, but if you find one you think works well, let me know, and we can incorporate it into the library. Different color schemes in the same plotI haven't tested this, but I think it might also be doable. The trick is that, according to the Pandas docs, it will cycle through the colors you pass in when assigning each segment's colors. So I think what you could do is pass in your preferred colors twice, or however many times you need to, once for each subplot: my_new_colors = [plot_likert.colors.TRANSPARENT,
'#6b9eff', '#4a85f5', '#3576f1', '#2167ec', '#0858f1',
plot_likert.colors.TRANSPARENT,
'#fcfc92', '#ffff7c', '#fcfc5a', '#fcfc35', '#f9f90c',
]
plot_likert.plot_likert(data, plot_likert.scales.agree,
colors=my_new_colors); Again, I haven't tested it, so let me know if this works! |
Beta Was this translation helpful? Give feedback.
-
Awesome, thank you so much! I’ll try it out and let you know.
…On Fri, Aug 20, 2021 at 18:58 nmalkin ***@***.***> wrote:
Good news, I think the answer to both questions is yes!
Custom colors
Using colors other than the pre-specified likert5 to likert10 should be
pretty straightforward. To do this, create a list of color values as
strings and pass it in when you're plotting:
my_new_colors = [plot_likert.colors.TRANSPARENT, # this has to be first
'#6b9eff', '#4a85f5', '#3576f1', '#2167ec', '#0858f1']plot_likert.plot_likert(data, plot_likert.scales.agree,
colors=my_new_colors);
You can specify the values in any of the formats described here
<https://matplotlib.org/stable/tutorials/colors/colors.html>, though hex
RGB values (like in my example) are probably going to be easiest.
I don't have suggestions for specific color schemes, but if you find one
you think works well, let me know, and we can incorporate it into the
library.
Different color schemes in the same plot
I haven't tested this, but I think it might also be doable. The trick is
that, according to the Pandas docs
<https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.plot.barh.html>,
it will cycle through the colors you pass in when assigning each segment's
colors. So I *think* what you could do is pass in your preferred colors
twice, or however many times you need to, once for each subplot:
my_new_colors = [plot_likert.colors.TRANSPARENT,
'#6b9eff', '#4a85f5', '#3576f1', '#2167ec', '#0858f1',
plot_likert.colors.TRANSPARENT,
'#fcfc92', '#ffff7c', '#fcfc5a', '#fcfc35', '#f9f90c',
]plot_likert.plot_likert(data, plot_likert.scales.agree,
colors=my_new_colors);
Again, I haven't tested it, so let me know if this works!
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#19 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACYCWCXJNIUKZONPQNQJCITT54B3PANCNFSM5CPEINXA>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&utm_campaign=notification-email>
.
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello! Thank you for creating this library! Is there a way to have more than the 2 main color variations on the graph. For example, a graph where we have gradient scale of blue instead of yellow (like in colors=plot_likert.colors.likert10)?
Thank you, once again!
Beta Was this translation helpful? Give feedback.
All reactions