-
Notifications
You must be signed in to change notification settings - Fork 2
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
Assign different portions of a single colormap to different sub-colormaps #2
base: master
Are you sure you want to change the base?
Conversation
…ferent sub-colormaps
08e3265
to
8f59149
Compare
@@ -68,3 +68,10 @@ tight_layout() | |||
# Wiggle plot | |||
figure(figsize=(10, 5)) | |||
wiggle_plot(shot[1:5:end, 1:10:end], xloc[1:10:end], 0:0.02:4.6; new_fig=false) | |||
|
|||
# plot with multiple colorscales |
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 would appreciate an actual illustrative example like all the other ones that use proper images/shot records/.... because this doesn't really show anything.
Create a single colormap that assigns different portions of it to different sub-colormaps. | ||
|
||
# Arguments | ||
- `intervals::Vector{Tuple{T, T}}`: intervals of values where each interval will be assigned to a different colormap |
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.
That's not super practical especially considering it plots with perc. Working with actual portion in % or something would be more user friendly.
|
||
# Arguments | ||
- `intervals::Vector{Tuple{T, T}}`: intervals of values where each interval will be assigned to a different colormap | ||
- `cmap_types::Vector{ColorMap}`: colormaps for each interval |
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.
why not just cmaps
# Arguments | ||
- `intervals::Vector{Tuple{T, T}}`: intervals of values where each interval will be assigned to a different colormap | ||
- `cmap_types::Vector{ColorMap}`: colormaps for each interval | ||
- `out_of_interval_color`: (Optional) the color assigned to values that live outside of all the intervals, default is black [0.,0.,0.,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.
Someting like taht is usually just called padding
total_sections = vcat(cmap_sections[1], vcat([vcat(between_interval_sections[i], cmap_sections[i+1]) for i = 1:length(cmap_sections)-1]...)) | ||
|
||
# construct the colormaps | ||
cmaps = matplotlib.colors.ListedColormap(total_sections) |
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 bit overly intricated but that's fine
0948c8a
to
e1bbd1d
Compare
962188f
to
be534a2
Compare
This can create colormaps to show different layers in an image, e.g. Figure 2 in https://slim.gatech.edu/Publications/Public/Submitted/2022/yin2022TLEdgc/paper.html