英文:
How to set specific colors for specific values
问题
I have a rather large set of data, composed of one array of tuples (coordinates) and one array of values associated with each coordinate. My problem is that those values are not just one integer but sometimes an array of possible values.
For example, I could have an array like this: [6,10,8,[4,5,6],4]. This corresponds to 5 coordinates.
I would like to plot this data using imshow. Basically I want to create my own colormap but I have only 11 different possible values, some of which being an array.
All the resources I've found only treat uniform values. Should I change my approach or is there a way to use this data as is?
I have tried using colors.boundaryNorms, but that obviously doesn't work for the sub-arrays.
As I am quite new to matplotlib I do not have much different ideas to try.
英文:
I have a rather large set of data, composed of one array of tuples (coordinates) and one array of values associated with each coordinate. My problem is that those values are not just one integer but sometimes an array of possible values.
For example, I could have an array like this: [6,10,8,[4,5,6],4]. This corresponds to 5 coordinates.
I would like to plot this data using imshow. Basically I want to create my own colormap but I have only 11 different possible values, some of which being an array.
All the resources I've found only treat uniform values. Should I change my approach or is there a way to use this data as is?
I have tried using colors.boundaryNorms, but that obviously doesn't work for the sub-arrays.
As I am quite new to matplotlib I do not have much different ideas to try.
答案1
得分: 0
After some reflection and considering I work with geospatial data, I switched to rasterio and QGIS to visualize my results.
Closing the question.
英文:
After some reflection and considering I work with geospatial data, I switched to rasterio and Qgis to visualize my results.
Closing the question.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论