Hello Patrick,
Thank a lot for your reply.
Let *'t'* represent time,  *'s'* represent sin. Both are list, or numpy
array of 1 dimension,

If I use *plot(x,y)*, the sin wave is plotted such that *x-axis(horizontal)* is
time, *y-axis(vertical) *is sin wave.

I want to use same *"plot(x,y)"* such that, *vertical axis is time*
and *horizontal
axis is sin wave*.
Now the simpler way to go is to use* "plot(y,x)"*. But it create confusion
in code, for example, *to actually set XLimits, I have to use values of
YLimits*.

It would be great if there is method to simply interchange the x-axis to
y-axis.

##             +ve Y
##               ^                 Default axis
##               |
##               |
##               |
##               -------> +ve X
##
##

##              +ve X
##               ^                 Required axis
##               |
##               |
##               |
##  +ve Y <-------


Proposed Method:
1) Interchange X-axis to Y-axis, then Invert Y-axis
2) Rotate the plot in place by -90 degrees.(making sure all text, tick
labels of axis doesn't get rotated.

Thank you.


On 24 July 2017 at 23:37, Patrick Kreitzberg <[email protected]> wrote:

> 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 a topic in the
> Google Groups "pyqtgraph" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/
> topic/pyqtgraph/LPpYZrDvZpA/unsubscribe.
> To unsubscribe from this group and all its topics, 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
> <https://groups.google.com/d/msgid/pyqtgraph/ac73b0cc-7d01-42c1-b9f4-8c69e50f57c2%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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/CACEzMm7f8Csh8PgqN5GpyN70gFQOfW-oGhLjNjKs4nqB22%3D0dA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to