Question about plotting same network multiple times in subplot with same color range

Hello, thanks for looking at this,
I have a question about plotting a patched line network multiple times (one reference, one slightly different, etc) and have the color range for the second one be reflective of the first in terms of its caxis.
This is sort of what I mean, look here. All of the ranges of values are different for each of the subplots, but the colormaps are determined by each individual subplot. What I want to have is one colormap that all subplots reference and color for accordingly
This is what I do currently:
For each subplot, I
  • Determine a colormap (this is probably the problem here, as the colormap is unique to each subplot)
  • patch('Vertices', ptMx, 'Faces', faceMx, 'FaceVertexCData', color_array, 'EdgeColor', 'interp');
where the color_array is the indexed coordinates of the colormap depending on the values. I do this because this is more or less what I grew up learning.
So for the 800Hz plot earlier, the maxes are lower and the mins are lower. But the maxes are just as red as any other subplot reds.
Any advice? Thanks!

Answers (1)

I don’t completely understand what you’re doing.
You can define the levels of your colormap. The default jet colormap is colormap(jet(64)), but I believe you can go to colormap(jet(256)). That would provide you a greater range or colours. Experiment!

4 Comments

Basically, the max values in my 800Hz plot above just as red as the maxes for my 200Hz (which should have the highest maxes between all four plots). In reality, the top reds from the 800Hz plot should be a little less red, more pink-ish and the lows should be the deepest blues since those typically are the mins between all four plots.
I made a colormap in each individual plot because I wasn't completely sure how to make one uniform colormap for all 4 plots. I made a colormap by creating a jet colormap the size of the number of faces I have, and color each face individually. I then create indices for the faces based on the colormap by descending order from the max value to the min value.
The problem with doing it this way is each plot looks good, but is separate. I want to try to have all four colored against a uniform colormap.
I don’t have enough information to provide a specific reply.
One possibility is for you to define the same colormap for all your plots, then scale them by the range of the plot with the maximum range. So the highest value in one plot might be 60, in another 150, and in another 256.
Correct me if I'm wrong, but doesn't jet(64) and jet(256) just mean you have 64 and 256 interpolated values in the color range?
Scaling might be a good idea, but it would probably be simpler with a very simple custom colormap... may try that next.
Yes. However it gives you more options.
Scaling with the same colormap would probably give you the result you want.
Alternatively, to create custom colormaps, you could create a custom colormap for each plot by simply choosing the appropriate scaled row range of the colormap(jet(256)) matrix (or whatever number of values want). That essentially scales the colormap to the data, rather than the data to the colormap (my initial approach). That would probably give you the same result as scaling the data, and, especially since creating a custom colormap for each plot is what you want to do, might be an easier approach.
So if you had a maximum of 150 values, one plot could be defined to use the first 50 rows of the colormap, another the first 75, and so forth.

Sign in to comment.

Categories

Asked:

on 7 Jun 2016

Commented:

on 7 Jun 2016

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!