How to get image of figure with exact same size after saving on computer

46 Ansichten (letzte 30 Tage)
Rafi Ahmed
Rafi Ahmed am 22 Sep. 2019
Bearbeitet: Rafi Ahmed am 25 Sep. 2019
I would like to save image from a figure with exact same size. I have used export setup for specific size (e.g. points) of image. However, it becomes a different dimension after saving on computer memory. Is there any way to get the image of that figure with exact same size after saving it.

Antworten (1)

Image Analyst
Image Analyst am 22 Sep. 2019
Using saveas() or export_fig() will give you an image the same size in pixels as the displayed figure.
If you have an axes on that figure and want just the stuff in the axes, you can use getimage() or getframe() to get an image.
If you have an image, you can use imwrite() and that will save it with the same size.
  8 Kommentare
Walter Roberson
Walter Roberson am 25 Sep. 2019
You have
[Az Doppler] = meshgrid(sin(phi*pi/180),fdop);
so Az will be "sin spaced" apart -- closer together near -180, 0, and +180 than near +-90 degrees. When you then use Az as the x coordinate for pcolor, it has to put the elements closer together or further apart because of that.The distance between adjacent values is not constant with what you are doing now. But when you create an image, the distance between adjacent values (pixels) is constant. So you have to substitute in original non-linearly spaced phi coordinates such that sin() of them translates after the sin() to be linearly spaced.
However, I just realized that you have a problem: for each x value in the range (-1,1) exclusive, there are two phi values that map to that same x value. Your surface folds back on itself, and you need to decide which of the folds is the one that you want to appear in the output.
Rafi Ahmed
Rafi Ahmed am 25 Sep. 2019
Bearbeitet: Rafi Ahmed am 25 Sep. 2019
Sir,
Yes you are right. The values fold back and I need all of them in one image. I guess, there is no option but to use pcolor for that. But I could not understand that if I have the figure, why couldn't I save the figure with the size of 360x360 dimension? It is always converted into another dimension (e.g. 525x700) when saving on computer memory. When I resize it to 360x360, it has some loss probably. Do you think that, resizing image has better solution?

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Images finden Sie in Help Center und File Exchange

Produkte


Version

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by