Assign different portions of a single colormap to different sub-colormaps#2
Open
Assign different portions of a single colormap to different sub-colormaps#2
Conversation
…ferent sub-colormaps
08e3265 to
8f59149
Compare
mloubout
reviewed
Oct 13, 2022
| 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 |
Member
There was a problem hiding this comment.
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 |
Member
There was a problem hiding this comment.
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 |
| # 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.] |
Member
There was a problem hiding this comment.
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) |
Member
There was a problem hiding this comment.
looks bit overly intricated but that's fine
0948c8a to
e1bbd1d
Compare
962188f to
be534a2
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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