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 Monday, 24 July 2017 23:37:54 UTC+2, Patrick Kreitzberg 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 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/85bbe460-3736-447c-bbf3-5424090182af%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to