Dimensions of an array define its size and shape -- the arangement of elements in the array. Use this Tag for questions regarding the shape of arrays.
Questions tagged [dimensions]
1238 questions
25
votes
3 answers
How to get the resolution of a monitor in Pygame?
I'm just wondering if it is possible for me to get the resolution of a monitor in Pygame and then use these dimensions to create a window so that launching the program detects the monitor resolution and then automatically fits the window to the…

Ilmiont
- 2,032
- 4
- 27
- 44
24
votes
6 answers
How do you get the width and height of an SVG picture in PHP?
I tried to use getimagesize() on an SVG file, but it failed.
I know that SVG is “Scalable Vector Graphics”, but I find that Google Chrome’s “Review elements” can perfectly get the dimensions of an SVG picture, so I suspect that this is also possible…

cj333
- 2,547
- 20
- 67
- 110
23
votes
11 answers
outerHeight(true) gives wrong value
I want the height of a container element, including margins and paddings.
When I hover over the element in Chrome development tool, I get the value that I'm looking for but when I use jQuery $('element').outerHeight(true); I get a much smaller…

Viktor
- 460
- 2
- 5
- 16
22
votes
10 answers
How to get scrollTop of an iframe
jQuery's scrollTop returns null when window is an iframe. Has anyone been able to figure out how to get scrollTop of an iframe?
more info:
my script is running in the iframe itself, the parent window is on another domain, so I can't access the ID of…

mkoryak
- 57,086
- 61
- 201
- 257
21
votes
4 answers
C++/Size of a 2d vector
How do I find the size of a 2 dimensional vector? So far I have the following code which doesn't compile.
#include
#include
using namespace std;
int main()
{
vector < vector > v2d;
for (int x = 0; x < 3; x++)
…

pandoragami
- 5,387
- 15
- 68
- 116
21
votes
1 answer
numpy array that is (n,1) and (n,)
What is the difference between a numpy array (lets say X) that has a shape of (N,1) and (N,). Aren't both of them Nx1 matrices ? The reason I ask is because sometimes computations return either one or the other.

silencer
- 2,285
- 5
- 18
- 18
21
votes
5 answers
getDimension()/getDimensionPixelSize() - mutliplier issue
So I have android 2.3.5 device which is NORMAL/HDPI. I have a dimens.xml in my project:
...
20sp
...
this file is absolutely identical in values-normal/values-hdpi and so on…

Stan
- 6,511
- 8
- 55
- 87
19
votes
4 answers
When should the dimens.xml file be used in Android?
For instance, in a specific layout I have the following XML:

rfgamaral
- 16,546
- 57
- 163
- 275
19
votes
3 answers
Set text size in .xml or programmatically
I have variable at dimens.xml
12sp
And i can use it in layout file:

Suvitruf - Andrei Apanasik
- 5,582
- 9
- 49
- 88
18
votes
6 answers
How to specify the size of a graph in ggplot2 independent of axis labels
Say I have a data frame and want to make a plot
df <- melt(iris)
p <- ggplot(data = df, aes(x = Species, y = value)) +
geom_boxplot() + theme(aspect.ratio = 1)
I then want to use ggsave() to save a pdf of this plot
ggsave(plot = p, width =…

John Gagnon
- 825
- 1
- 8
- 20
18
votes
2 answers
Unwanted extra dimensions in NumPy array
I've opened a .fits image:
scaled_flat1 = pyfits.open('scaled_flat1.fit')
scaled_flat1a = scaled_flat1[0].data
and when I print its shape:
print scaled_flat1a.shape
I get the following:
(1, 1, 510, 765)
I want it to read:
(510, 765)
How do I…

bjd2385
- 2,013
- 4
- 26
- 47
17
votes
2 answers
How can I get the size of the webcam image with getUserMedia?
I'm trying to find out what will be the size of the image I get from the webcam using getUserMedia.
Right now, in my Macbook, I have supposedly a 720p camera, but the image I'm getting is 640x480. I'm assuming this won't always be the case, though,…

Daniel Magliola
- 30,898
- 61
- 164
- 243
16
votes
6 answers
JComboBox width
I have created a jComboBox but it takes the full width of the frame. how to set the width fixed.
yes borderlayout for the frame and box layout for the panel. i am adding the code here:
import javax.swing.*;
import java.awt.BorderLayout;
public…

Suman.hassan95
- 3,895
- 8
- 26
- 24
16
votes
2 answers
Cannot see the Image type in System.Drawing namespace in .NET
I'm trying to write a program that sorts images in specific folder by ther dimensions and moves little images to another folder via simple .NET console application. I decided to use System.Drawing.Image class to get the image dimentions from an…

BohdanZPM
- 695
- 2
- 10
- 22
16
votes
4 answers
Why is sum(X, 1) the sum of the columns in MATLAB?
>> X = [0 1 2
3 4 5]
>> sum(X, 1)
ans =
3 5 7
sum(X, 1) should sum along the 1st dimension(row) as per the document says:
S = SUM(X,DIM) sums along the
dimension DIM.
But why does it actually sums along the 2nd…

Gtker
- 2,237
- 9
- 29
- 37