rotating a plot using 'rotate' keyword?

Is there something for plot() that rotates the axes. I know I can
simply switch the variables like so: plot(x,y) and plot(y,x), but I
have a 1D array and I don't want to add a second array for the element
number. Is there a keyword like rotate=90 as there is for text? Thanks.

Jeff

A pylab approach:

line2d = plot(rand(10))[0]

def swap(xdata, ydata):
line2d.set_xdata(ydata)
line2d.set_ydata(xdata)
draw()

swap(line2d.get_xdata(), line2d.get_ydata())

···

On 9/27/05, Jeff Peery <jeffpeery@…420…> wrote:

Is there something for plot() that rotates the axes. I know I can
simply switch the variables like so: plot(x,y) and plot(y,x), but I

have a 1D array and I don’t want to add a second array for the element
number. Is there a keyword like rotate=90 as there is for text? Thanks.

Jeff


This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl


Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net

https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Thanks. Will that work for the WXAgg backend?

···

-----Original Message-----
From: Charlie Moad
[mailto:cwmoad@…287…]
Sent: Tuesday, September 27, 2005
9:34 AM
To: Jeff Peery
Cc: matplotlib-users@…813…ourceforge.net
Subject: Re: [Matplotlib-users]
rotating a plot using ‘rotate’ keyword?

A pylab approach:

line2d = plot(rand(10))[0]

def swap(xdata, ydata):

line2d.set_xdata(ydata)

line2d.set_ydata(xdata)

draw()

swap(line2d.get_xdata(), line2d.get_ydata())

On 9/27/05, Jeff Peery <jeffpeery@…420…> wrote:

Is there something for plot() that rotates the
axes. I know I can

simply switch the variables like so: plot(x,y) and plot(y,x), but I

have a 1D array and I don’t want to add a second array for the element

number. Is there a keyword like rotate=90 as there is for text? Thanks.

Jeff


This SF.Net email is sponsored by:

Power Architecture Resource Center: Free content, downloads, discussions,

and more. http://solutions.newsforge.com/ibmarch.tmpl


Matplotlib-users mailing list

Matplotlib-users@lists.sourceforge.net

https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Nm, I misread you question. You can get the transform object and
possibly apply a rotation. (e.g. line2d.get_transform() from example).
I don't know how to manipulate this from the top of my head though.

···

On 9/27/05, Charlie Moad <cwmoad@...287...> wrote:

A pylab approach:

line2d = plot(rand(10))[0]

def swap(xdata, ydata):
     line2d.set_xdata(ydata)
     line2d.set_ydata(xdata)
     draw()

swap(line2d.get_xdata(), line2d.get_ydata())

On 9/27/05, Jeff Peery <jeffpeery@...420...> wrote:
> Is there something for plot() that rotates the axes. I know I can
> simply switch the variables like so: plot(x,y) and plot(y,x), but I
> have a 1D array and I don't want to add a second array for the element
> number. Is there a keyword like rotate=90 as there is for text? Thanks.
>
> Jeff
>
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by:
> Power Architecture Resource Center: Free content, downloads, discussions,
> and more. http://solutions.newsforge.com/ibmarch.tmpl
> _______________________________________________
> Matplotlib-users mailing list
> Matplotlib-users@lists.sourceforge.net
>
matplotlib-users List Signup and Options
>