[Python] Python Pyx: bar graph y-axis height

Discussão em 'Python' iniciado por Stack, Abril 7, 2025.

  1. Stack

    Stack Membro Participativo

    I wanna make a bar graph plot in PyX (see here) using the code

    from pyx import *
    g = graph.graphxy(width=8, x=graph.axis.bar())
    g.plot(graph.data.file("minimal.dat", xname=0, y=2), [graph.style.bar()])
    g.writePDFfile("minimal")


    and the data

    1 0.4
    2 0.5
    3 0.2
    4 0.1
    5 0.0


    I get the plot

    [​IMG]

    Question: how to force the y-axis maximum to be 1.0 instead of 0.5?

    Continue reading...

Compartilhe esta Página