Heya,

I could not reproduce the behavior you described. Your code didn't work
as-is; I changed the "layout" section to just be `w = pg.plot(title="Basic
Plot")`, and I added a `pg.exec()` at the end, but I don't think either of
those would have had an impact. What does the `self` at the beginning refer
to? That's likely a necessary part of reproducing your problem. Can you
post the rest of this class?

Best,
 - Martin (he/him)

On Sat, Sep 17, 2022 at 12:32 AM bobtoong <[email protected]> wrote:

> Hi there,
> I'm in trouble two axes are apart from each other.
>
> Please check it and let me know.
>
> [image: pygraph.jpg]
>
> And the code is below.
>
> # layout
> w = pg.PlotWidget(title='Basic Plot')
> self.vl_Graph.addWidget(w)
>
> # data
> x = [0, 1, 2, 3, 4]
> y = [0, 1, 2, 3, 4]
>
> # style
> w.setBackground('w')
> w.setTitle('Title')
> w.setLabel('left', 'y-axis')
> w.setLabel('bottom', 'x-axis')
> w.showGrid(x=True, y=True)
> w.addLegend()
> # w.setXRange(0, 10, padding=0)
>
> # plot
> w.plot(x, y, pen=pg.mkPen('r'), name='default plot', skipFiniteCheck=True)
>
> Thanks.
>
> --
> You received this message because you are subscribed to the Google Groups
> "pyqtgraph" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/pyqtgraph/123c5804-610a-41e2-9b34-e64d7187222fn%40googlegroups.com
> <https://groups.google.com/d/msgid/pyqtgraph/123c5804-610a-41e2-9b34-e64d7187222fn%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"pyqtgraph" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/pyqtgraph/CAD_p8v2bESFQ_c1_muQHT9udupVJihHj_VsT3jXcWx%3DH3m_%3D1g%40mail.gmail.com.

Reply via email to