Plotting Ferrer graph of a plane partition

I'm currently trying to plot the Ferrers graph of a plane partition, i.e. a 3D structure of stacked boxes.

My input would be a plane partition pij with the information ( i, j, k ) for each 'stack of boxes' where i, j are the coordinates in the matrix and k is the value of the respective entry.

As an example, the following input

3 2 1 1
2 2 1
1 1

should produce a plot that looks like this:

Thanks a lot in advance!

Cheers
Nils

gulliet's picture

One approach using *polyhedraplot*

Let assume that the entries are a list of lists that denotes the height z, i.e. [[3, 2, 1, 1], [2, 2, 1], [1, 1]]. Then, we transform it (manually in the example below) in a list of x-, y-, z-coordinates (for a given point, the x-coordinate is equal to its row index, and, similarly, the y-coordinate is equal to its column index). Finally, we plot the diagram thanks to the function polyhedraplot.


> with(plots);
> polyhedraplot([[1, 1, 3], [1, 2, 2], [1, 3, 1], [1, 4, 1], [2, 1, 2], [2, 2, 2], [2, 3, 1], [3, 1, 1], [3, 2, 1]], polyscale = .5, polytype = hexahedron, scaling = CONSTRAINED, orientation = [20, 70]);

97_FerrersDiagram.jpg

HTH,
-- Jean-Marc

Use plots[matrixplot]

The plots[matrixplot] command, with the heights=histogram option, should provide the functionality you need. There are various examples on the help page to show you how the options work.

Paulina Chin
Maplesoft

Thank you so much Jean-Marc

Thank you so much Jean-Marc and Paulina, both solutions work like a charm (:

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
}