Thread Subject: Square figure window?

Subject: Square figure window?

From: Jacob

Date: 4 Nov, 2009 08:06:02

Message: 1 of 6

Hi All,

Just a quick question regarding figures, Why does the following code not produce a square figure:

figure('Position',[250 250 500 500])

Only thing I can think of is screen resolution is different in horizontal and vertical directions? If so, is there anyway to determine what dpiX and dpiY are? Because of this, is it better to build a GUI using units in inches or centimeters rather then using pixels?

Regards Jake

Subject: Square figure window?

From: Jos

Date: 4 Nov, 2009 08:49:02

Message: 2 of 6

"Jacob " <jacob.barton1@gmail.com> wrote in message <hcrcla$pbf$1@fred.mathworks.com>...
> Hi All,
>
> Just a quick question regarding figures, Why does the following code not produce a square figure:
>
> figure('Position',[250 250 500 500])
>
> Only thing I can think of is screen resolution is different in horizontal and vertical directions? If so, is there anyway to determine what dpiX and dpiY are? Because of this, is it better to build a GUI using units in inches or centimeters rather then using pixels?
>
> Regards Jake

get(0,'screensize')

might help you. I do not think there is a way to determine the actual size of the screen in cm programmatically.

Jos

Subject: Square figure window?

From: Jacob

Date: 4 Nov, 2009 23:55:21

Message: 3 of 6

Thanks Jos,

That returns the size off the screen, but still doesn't explain why a window 500x500 isn't square. I read in the documentation that you can change the units from pixels to normalized or absolute so was just wondering what the best approach is.

I dont understand why anyone would work in pixels if a window specified as 500x500 isn't square. Its like comparing apples and oranges isn't it? Plus your GUI will be dependent on the pixel density dpiX and dpiY so it might look completely different on another machine?

Regards Jake

Subject: Square figure window?

From: Jake

Date: 6 Nov, 2009 12:35:19

Message: 4 of 6

Can anybody please shed some more light on this problem? I assume that there is a reasonably simple explanation?

Regards Jake

Subject: Square figure window?

From: Jos

Date: 6 Nov, 2009 14:52:02

Message: 5 of 6

"Jake " <elbarto_87@hotmail.com> wrote in message <hd1567$eum$1@fred.mathworks.com>...
> Can anybody please shed some more light on this problem? I assume that there is a reasonably simple explanation?
>
> Regards Jake

Using my measurement lint I get a square red figure (inside, i.e., excluding the bar and menu etc.) after

figure('position',[200 200 500 500],'color','r')

Jos

Subject: Square figure window?

From: Jake

Date: 7 Nov, 2009 03:05:04

Message: 6 of 6

Thanks Jos,

I understand it now.

Regards Jake

Tags for this Thread

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

rssFeed for this Thread
 

MATLAB Central Terms of Use

NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Terms prior to use.

Contact us at files@mathworks.com