3

I'm using matplotlib to plot things that have a lot of data clustered around values 0, .5, and 1. So it is difficult to see the difference between values within each cluster with a sequential colormap (which is what I want to use).

I would like to "stretch" the colormap around the values where my data clusters, so that you can see the contrast within each cluster as well as between clusters.

I saw this similar question, but it doesn't quite get me to where I want: Matlab, Python: Fixing colormap to specified values

Thanks!

Community
  • 1
  • 1
capybaralet
  • 1,757
  • 3
  • 21
  • 31
  • 1
    So if that question doesn't get you quite where you want, where exactly do you want to get? What are you asking for? An idea for a solution? Code for an idea for a solution? – dg99 Jan 14 '14 at 23:23
  • You can not have both if you want to use a linear scale. If you use a non-linear (non-log) scale, then your color map is useless. Either distort your normalization (so that the values are evenly distributed), use three different color maps, or distort a colormap by hand. – tacaswell Jan 15 '14 at 03:56
  • I was looking for code. I figure someone else would have had similar problems and might have a nice general purpose solution lying around. I've thought about it more since then, and I think an idea for a solution would be to simply rescale the data values so they are evenly spaced. But I don't need this feature right now. I switched to mayavi which is working much better in general (I'm doing 3D plots), although I'm having a bit of trouble re-implementing this part of my code, so I haven't gotten to the point where this might be an issue again yet. – capybaralet Jan 16 '14 at 23:43
  • Here is a related question/answer: https://stackoverflow.com/a/20528097/1558890 – Jim Garrison Sep 28 '17 at 18:06

0 Answers0