How to vary the pixel size in matlab imagesc() plot?
I have data of a heated plate (2m x 2m = L x L) defined by a grid (x- and y-coordinates from 0 to 2 in same or different refinements) and a corresponding matrix containing the temperatures of the centres of the plates fields (the field dimensions are defined by the x- and y-grid).
The imagesc() plot function from matlab creates good results on equidistant grids since every field has the same length and width. However working with an non-equidistant grid requires to adjust all fields dimensions according to x-y-grid.
Is it possible to do this within the imagesc() function?
Code:
imagesc(x,y, sol)
set(gca,’YDir’,’normal’)
colormap(jet(2000)); colorbar;
xlabel(‘x[m]’)
ylabel(‘y[m]’)
x and y are vectors containing the coordinates of the grid, sol is the matrix containing the field centres temperatures.
Plot:
[Heated Plate with equidistant grid]
[Heated Plate with non-equidistant grid]
The non-equidistant grid performs a refinement on the right side of the plate since numerical error is biggest there.
The refinement is defined by
– same discretization for 0 <= x <= L/2 (same for y)
– double fine discretization for L/2 <= x <= L*3/4 (same for y)
– four times discretization for L*3/4 <= x <= L (same for y)
As you can see, the refinement’s new field dimensions are not considered which ends up ruining the visulization.
I’ve already tried different plot methods like surf or pcolor. Both are not well suited for a field-centre-oriented solution.
Thank’s for any advice.I have data of a heated plate (2m x 2m = L x L) defined by a grid (x- and y-coordinates from 0 to 2 in same or different refinements) and a corresponding matrix containing the temperatures of the centres of the plates fields (the field dimensions are defined by the x- and y-grid).
The imagesc() plot function from matlab creates good results on equidistant grids since every field has the same length and width. However working with an non-equidistant grid requires to adjust all fields dimensions according to x-y-grid.
Is it possible to do this within the imagesc() function?
Code:
imagesc(x,y, sol)
set(gca,’YDir’,’normal’)
colormap(jet(2000)); colorbar;
xlabel(‘x[m]’)
ylabel(‘y[m]’)
x and y are vectors containing the coordinates of the grid, sol is the matrix containing the field centres temperatures.
Plot:
[Heated Plate with equidistant grid]
[Heated Plate with non-equidistant grid]
The non-equidistant grid performs a refinement on the right side of the plate since numerical error is biggest there.
The refinement is defined by
– same discretization for 0 <= x <= L/2 (same for y)
– double fine discretization for L/2 <= x <= L*3/4 (same for y)
– four times discretization for L*3/4 <= x <= L (same for y)
As you can see, the refinement’s new field dimensions are not considered which ends up ruining the visulization.
I’ve already tried different plot methods like surf or pcolor. Both are not well suited for a field-centre-oriented solution.
Thank’s for any advice. I have data of a heated plate (2m x 2m = L x L) defined by a grid (x- and y-coordinates from 0 to 2 in same or different refinements) and a corresponding matrix containing the temperatures of the centres of the plates fields (the field dimensions are defined by the x- and y-grid).
The imagesc() plot function from matlab creates good results on equidistant grids since every field has the same length and width. However working with an non-equidistant grid requires to adjust all fields dimensions according to x-y-grid.
Is it possible to do this within the imagesc() function?
Code:
imagesc(x,y, sol)
set(gca,’YDir’,’normal’)
colormap(jet(2000)); colorbar;
xlabel(‘x[m]’)
ylabel(‘y[m]’)
x and y are vectors containing the coordinates of the grid, sol is the matrix containing the field centres temperatures.
Plot:
[Heated Plate with equidistant grid]
[Heated Plate with non-equidistant grid]
The non-equidistant grid performs a refinement on the right side of the plate since numerical error is biggest there.
The refinement is defined by
– same discretization for 0 <= x <= L/2 (same for y)
– double fine discretization for L/2 <= x <= L*3/4 (same for y)
– four times discretization for L*3/4 <= x <= L (same for y)
As you can see, the refinement’s new field dimensions are not considered which ends up ruining the visulization.
I’ve already tried different plot methods like surf or pcolor. Both are not well suited for a field-centre-oriented solution.
Thank’s for any advice. imagesc, plot, grid, refinement MATLAB Answers — New Questions