Try getting the axis item of the viewbox then changing the label. The ...
is because you may be using different plot items.
ax = ...getViewBox().getAxis('left')
ax.setLabel('y')
ay = ...getViewBox().getAxis('bottom')
ay.setLabel('x')
I think that should switch the labels if that is all you want to do. If
you rotate the viewbox then you can change the labels this way. If this
doesn't solve your problem then please add more specifics about what
exactly you want. I am not sure if you want the data to look like (x,y)
and just change the labels or if you want the data to look like (y,x) with
the left axis labled x and the right labeled y.
On Monday, July 24, 2017 at 10:31:19 AM UTC-6, m has wrote:
>
> Is there any way to swap x-axis and y-axis in plot. I need a vertical
> x-axis and horizontal y-axis. I can not simply plot(y,x) as I need to set
> alot of other properties as well. I have been searching for two days but no
> avail. I rotated the ViewBox, but it changes the x-axis and y-axis labels.
>
> Thank you.
>
--
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/ac73b0cc-7d01-42c1-b9f4-8c69e50f57c2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.