Bar Chart

You can use a combination of scripting, operators, and expressions to produce a bar chart of 2D data in VisIt.

BarChart before.png BarChart.png
2D scalar data.

2D scalar data represented as a bar chart.

Here is a Python function that will set up the bar chart plot. The script works by extruding the 2D data to 3D, adding 100 bins along the Z-axis. The script considers the normalized values of the data along the Z-axis, creating a field called void that is 1 where the Z coordinates are larger than the data values and 0 everywhere else. The script uses the Threshold operator to remove the cells where the void field is above 0.5. The result is a bar chart. If you want to increase the accuracy of the bar heights, you can increase the number of extrusion cells (the default here is 100).

def BarChart(filename, var):
    md = GetMetaData(filename)
    mesh = ""
    for i in xrange(md.GetNumScalars()):
        if md.GetScalars(i).name == var:
            mesh = md.GetScalars(i).meshName
            break
    OpenDatabase(filename)
    AddPlot("Pseudocolor", var)
    DrawPlots()
    Query("MinMax")
    min,max = GetQueryOutputValue()
    DeleteActivePlots()

    DefineScalarExpression("normalized_%s" % var, "(<%s> - %lg) / %lg" % (var, min, max-min))
    DefineScalarExpression("void", "if(ge(coord(<%s>)[2], <normalized_%s>), 1, 0)" % (mesh, var))

    AddPlot("Pseudocolor", var)
    AddOperator("Extrude", 0)
    ext = ExtrudeAttributes()
    ext.steps = 100
    SetOperatorOptions(ext)

    AddOperator("DeferExpression", 0)
    de = DeferExpressionAttributes()
    de.exprs = ("normalized_%s" % var, "void")
    SetOperatorOptions(de)

    AddOperator("Threshold", 0)
    thresh = ThresholdAttributes()
    thresh.zonePortions=(0,)
    thresh.listedVarNames = ("void",)
    thresh.lowerBounds=(-1e+37,)
    thresh.upperBounds=(0.5,)
    SetOperatorOptions(thresh)

    DrawPlots()

def main():
    BarChart("~/data/rect2d.silo", "d")

main()