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

1 回表示 (過去 30 日間)
Brian
Brian 2016 年 6 月 7 日
コメント済み: Star Strider 2016 年 6 月 7 日
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!

回答 (1 件)

Star Strider
Star Strider 2016 年 6 月 7 日
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 件のコメント
Brian
Brian 2016 年 6 月 7 日
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.
Star Strider
Star Strider 2016 年 6 月 7 日
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.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeRed についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by