-
Notifications
You must be signed in to change notification settings - Fork 252
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
RFC: Color schemes #908
RFC: Color schemes #908
Conversation
Is this a theme you cooked up yourself, or is it the atom color scheme, or? |
🎉🎉🎉🎉 I guess the main things remaining are to update the docs. I think the most important files are |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, just a couple minor nitpicks
try | ||
set_theme(Symbol(theme)) | ||
catch err | ||
warn("Error loading Gadlfy theme $theme (set by GADFLY_THEME env variable)") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Gadfly misspelled
:shape => Scale.shape_discrete(), | ||
:group => Scale.group_discrete(), | ||
:label => Scale.label())) | ||
const default_aes_scales = Dict{Symbol, Dict}( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the @compat
not necessary?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not anymore since we depend on Julia 0.4+
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, good point. I forgot we dropped 0.3
end | ||
b | ||
function $(name)($(inherit_parameters_expr), b::$name) | ||
$(new_with_defaults) | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice!
Also, it looks like Travis is failing due to things unrelated to this PR. |
@@ -1492,7 +1492,7 @@ const contour = ContourStatistic | |||
function default_scales(::ContourStatistic) | |||
return [Gadfly.Scale.z_func(), Gadfly.Scale.x_continuous(), | |||
Gadfly.Scale.y_continuous(), | |||
Gadfly.Scale.color_continuous_gradient()] | |||
Gadfly.get_scale(:numerical, :color)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure why the other Scales here also should not come from Gadfly.get_scale
, doing that only for the color scales might seem a little odd.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, shouldn't these all be get_scale
calls?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll leave the others unchanged for now, because its seems this will in fact be faster than a dict lookup. We should consider this if we are doing a larger simplification of these things.
plot(x=rand(10), y=rand(10), | ||
style(major_label_font="CMU Serif",minor_label_font="CMU Serif", | ||
major_label_font_size=16pt,minor_label_font_size=14pt)) | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How do I hide the output of this? (This is the same as the previous one)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As in, you don't want it to plot? You can append # hide
(spaces are important) to the end of any line you don't want displayed. If you have multiple lines then a @setup
block might be useful. See https://juliadocs.github.io/Documenter.jl/latest/man/syntax.html#@example-block-1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I want the code to appear, but not the output...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah, there are two different ways of doing it. It depends whether you want the code to be displayed and get executed or just displayed.
To display and execute:
```@example 1
plot(...)
nothing # hide
```
just display, no execution
```julia
code
```
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, thanks. I think 1st one will also test that it works, so will use that.
style(major_label_font="CMU Serif",minor_label_font="CMU Serif", | ||
major_label_font_size=16pt,minor_label_font_size=14pt)) do | ||
|
||
plot(x=rand(10), y=rand(10)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to hide this as well.
That color scheme will look really awesome with Juno! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
plot(x=rand(10), y=rand(10), | ||
style(major_label_font="CMU Serif",minor_label_font="CMU Serif", | ||
major_label_font_size=16pt,minor_label_font_size=14pt)) | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As in, you don't want it to plot? You can append # hide
(spaces are important) to the end of any line you don't want displayed. If you have multiple lines then a @setup
block might be useful. See https://juliadocs.github.io/Documenter.jl/latest/man/syntax.html#@example-block-1
I think this PR is getting close. Main thing is to get JuliaIO/FileIO.jl#85 fixed because I want CI tests passing before merging. |
3 similar comments
The tests look good! (except for on 0.4, but that's due to Media/Juno having issues) |
Okay, added a couple of tests. Added a bit more documentation. I did a Documenter generation and everything is great. Merging. |
This adds the ability to
Theme
(discrete_color_scale
,continuous_color_scale
)set_theme(::Theme)
, or withset_theme(theme_name::Symbol)
givenget_theme(::Type{Val{theme_name}})
returns aTheme
style
function which will modify the current theme instead of creating a new one with the default default values.and adds a dark theme:
And is intended for use in Atom