How can I create an x,y plot where the grid spacing is not equal?

조회 수: 3 (최근 30일)
Rob
Rob 2013년 1월 16일
I have a 5x50 matrix of temperature measurements taken across a metal plate which I would like to plot. The spacing of the x-axis measurements was 1.1cm and the y-axis was 0.6cm. Somehow I need to plot the measurements according to this spacing and interpolate the temperatures between the measurements. Here's what I have so far:
% Temperature data is stored in T
[X,Y]=meshgrid(0:1.1:4.9,-15:0.6:14.4);
contourf(X,Y,T)
title('Temperature Distribution')
I am not convinced this is producing the correct result also, I am not able to interpolate the shading when using contourf, if there a better plot to use?
  댓글 수: 2
Doug Hull
Doug Hull 2013년 1월 16일
What makes you think this is incorrect?
What is the purpose of the visualization?
Rob
Rob 2013년 1월 16일
I thought it was incorrect because of the shape of the contours it produced, that may just be the nature of the temperatures recorded but I wanted to rule out it was a problem with my code first.
The visualization is simply there to give the reader an overview of how well the plate is conducting heat so I need to produce the same plot for different values of time.

댓글을 달려면 로그인하십시오.

답변 (1개)

Irl
Irl 2013년 1월 16일
You might prefer to interpolate the data first, before plotting. Look at the help for interp2, perhaps with method set to bicubic.
  댓글 수: 1
Rob
Rob 2013년 1월 16일
Thanks, I'll take a look. Is this better than using 'shading interp'?

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Contour Plots에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by