pdeplot with same colorbar range
6 次查看(过去 30 天)
显示 更早的评论
I am trying to plot the results of solving the transient heat equation. I want to use pdeplot to show the temperature distribution at a few different times. However, I want the color scale to be the same for each time, i.e. I want it to vary from 0 to 76. The different color scales currently can be misleading (see image)...
Here are the lines of code:
figure;
subplot(3,1,1)
pdeplot(model,"XYData",u(:,1),"Contour","on", "ColorMap","jet")
subplot(3,1,2)
pdeplot(model,"XYData",u(:,12),"Contour","on", "ColorMap","jet")
subplot(3,1,3)
pdeplot(model,"XYData",u(:,50),"Contour","on", "ColorMap","jet")
I have tried to update the axis' with:
axis([-inf inf -inf inf 0 76])
but this is not right. I'm not easily seeing from the pdeplot documentation how to do this... Any suggestions?
Thanks
0 个评论
采纳的回答
Chunru
2023-11-28
Use clim for each subplot.
figure;
subplot(3,1,1)
pdeplot(model,"XYData",u(:,1),"Contour","on", "ColorMap","jet")
clim([0 76])
subplot(3,1,2)
pdeplot(model,"XYData",u(:,12),"Contour","on", "ColorMap","jet")
clim([0 76])
subplot(3,1,3)
pdeplot(model,"XYData",u(:,50),"Contour","on", "ColorMap","jet")
clim([0 76])
3 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Red 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!