grid

How do I make a grid in python?

How do I make a grid in python? Question: This is my code width = int(input("How wide?")) height = int(input("How high?")) grid = [] row = [] bak = "." for i in range(width): row.append(bak) for i in range(height): grid.append(row) while True: for i in range(len(grid)): print(grid[i]) It’s not working and i don’t know why. …

Total answers: 5

Change grid interval and specify tick labels in Matplotlib

Change grid interval and specify tick labels in Matplotlib Question: I am trying to plot counts in gridded plots, but I haven’t been able to figure out how to go about it. I want: to have dotted grids at an interval of 5; to have major tick labels only every 20; for the ticks to …

Total answers: 2

Is there a GUI design app for the Tkinter / grid geometry?

Is there a GUI design app for the Tkinter / grid geometry? Question: Does anyone know of a GUI design app that lets you choose/drag/drop the widgets, and then turn that layout into Python code with the appropriate Tkinter calls & arrangement using the grid geometry manager? So far I’ve turned up a couple of …

Total answers: 3

How to create a self resizing grid of buttons in tkinter?

How to create a self resizing grid of buttons in tkinter? Question: I am trying to create a grid of buttons(in order to achieve the clickable cell effect) with Tkinter. My main problem is that I cannot make the grid and the buttons autoresize and fit the parent window. For example, when I have a …

Total answers: 4

2D grid data visualization in Python

2D grid data visualization in Python Question: I need to visualize some data. It’s basic 2D grid, where each cell have float value. I know how to e.g. assign color to value and paint grid in OpenCV. But the point here is that there are so many values so it’s nearly impossible to do that. …

Total answers: 2

Make a 2D pixel plot with matplotlib

Make a 2D pixel plot with matplotlib Question: I got the following data from some calculations: x, y, temp where x and y are the coordinates of a point in a 2D box of dimensions 10×10. Spacing is equal to 0.1. So there are 10000 different points and the resulting file looks like: 0.0 0.0 …

Total answers: 1

Auto wrap and newlines in wxPython grid

Auto wrap and newlines in wxPython grid Question: I want to implement a grid with the cells that have the following behaviour: cell text should be wrapped if it doesn’t fit to the cell newlines (n) in the cell text should be processed as well i.e. the same behaviour as in table editors like MS …

Total answers: 2

Matplotlib: draw grid lines behind other graph elements

Matplotlib: draw grid lines behind other graph elements Question: In Matplotlib, I make dashed grid lines as follows: fig = pylab.figure() ax = fig.add_subplot(1,1,1) ax.yaxis.grid(color=’gray’, linestyle=’dashed’) however, I can’t find out how (or even if it is possible) to make the grid lines be drawn behind other graph elements, such as bars. Changing the order …

Total answers: 7

Execute arbitrary python code remotely – can it be done?

Execute arbitrary python code remotely – can it be done? Question: I’m working on a grid system which has a number of very powerful computers. These can be used to execute python functions very quickly. My users have a number of python functions which take a long time to calculate on workstations, ideally they would …

Total answers: 6