[PyQt] avoid automatic x axis extension when plotting with pyqwt.qplt
Peter Schmidtke
pschmidtke at mmb.pcb.ub.es
Mon Mar 1 19:21:23 GMT 2010
Hello,
sorry for posting this question in this mailing list, but the pyqwt mailing
list seems rather dead. So I give it a chance here :
I would like to use pyqwt to create a basic curve with x values ranging
from 0 to 175 and y values ranging from 0 to 1. I do not want to plot this
to the screen but put it to a QPixmap in order to include it into a more
complex QGraphicsScene afterwards. The way I did it for now was :
qplt.QPixmap.grabWidget(qplt.Plot(qplt.Curve(x, y, qplt.Pen(qplt.Red, 2)),
1400, 150)))
This goes nicely and puts everything to the pixmap and I can include it to
my QGraphicsScene like wanted. However, my x values range from 0 to 175 and
the qplt Curve function always plots until 200 with the last 25 points not
having any y correspondence (so it's empty there). Is there a way to make
it plot only in the range you give x values for? I saw that it works nicely
for ranges from -1 to 1, but it certainly doesn't for bigger things.
If I have to pass through multiple lines to parameter the plot, how can I
suppress the temporary plotting this is doing (as I just need the image,
but I do not see it on the screen).
Thanks in advance for your help...sorry for this basic question, but I find
the documentation somehow puzzling for beginners.
Best regards.
--
Peter Schmidtke
----------------------
PhD Student at the Molecular Modeling and Bioinformatics Group
Dep. Physical Chemistry
Faculty of Pharmacy
University of Barcelona
More information about the PyQt
mailing list