How to plot surf or imagesc for my data?
5 次查看(过去 30 天)
显示 更早的评论
Hi,
This is my figure code, it comprises on 38 VP vs TWT plots as:
h = plot(VP1,TWT1,VP2+500,TWT2,VP3+1000,TWT3,VP4+1500,TWT4,VP5+2000,TWT5,VP6+2500,TWT6,...
VP7+3000,TWT7,VP8+3500,TWT8,VP9+4100,TWT9,VP10+4500,TWT10,VP11+5000,TWT11,VP12+5500,...
TWT12,VP13+6000,TWT13,VP14+6500,TWT14,VP15+7000,TWT15,VP16+7500,TWT16,VP17+8000,TWT17,...
VP18+8500,TWT18,VP19+9000,TWT19,VP20+9500,TWT20,VP21+10000,TWT21,VP22+10500,TWT22,...
VP23+11000,TWT23,VP24+11500,TWT24,VP25+12500,TWT25,VP26+13000,TWT26,VP27+13500,TWT27...
,VP28+14000,TWT28,VP29+14500,TWT29,VP30+15000,TWT30,VP31+15500,TWT31,VP32+16000,TWT32,...
VP33+16500,TWT33,VP34+17000,TWT34,VP34+17500,TWT34,VP35+18000,TWT35,VP36+18500,TWT36...
,VP37+19000,TWT37,VP38+19500,TWT38);
I want to to plot it as imagesc rather than vertical curves. How can I do it?
回答(1 个)
Walter Roberson
2021-8-13
Use the Computer Vision insertShape() function to "draw" the lines into an array. Afterwards you can image() the resulting array.
imagesc() is not really suitable for this situation: you would be storing colored pixels into the array, not relative values.
Perhaps I am misunderstanding what kind of plot you were looking for ??
If your primary purpose is just display, then I would not recommend going through the trouble of doing the insertShape -- not unless you are building an image to display on a Raspberry Pi display or to store into a file.
4 个评论
Walter Roberson
2021-8-16
At least one of your VP* variables contains duplicate points; perhaps the line doubles back on itself.
In that situation, I am having trouble imagining what result you are hoping for.
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!