comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Orientation of 2-d plot
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Orientation of 2-d plot [message #94107] Thu, 19 January 2017 17:17 Go to next message
tasboy63 is currently offline  tasboy63
Messages: 2
Registered: January 2017
Junior Member
Hello,
I'm trying to make a plot that is oriented at 90degrees to another plot on the same page.
A command something like:

plot,time,variable,position=position,orient=90

would do the trick - only "orient" isn't a keyword.

Any idea how this might be done?
Thanks greatly.
Phil
Re: Orientation of 2-d plot [message #94109 is a reply to message #94107] Fri, 20 January 2017 07:24 Go to previous messageGo to next message
Phillip Bitzer is currently offline  Phillip Bitzer
Messages: 223
Registered: June 2006
Senior Member
On Thursday, January 19, 2017 at 7:17:54 PM UTC-6, Phillip Reid wrote:
> Hello,
> I'm trying to make a plot that is oriented at 90degrees to another plot on the same page.
> A command something like:
>
> plot,time,variable,position=position,orient=90
>
> would do the trick - only "orient" isn't a keyword.
>
> Any idea how this might be done?
> Thanks greatly.
> Phil

Just swap your variables:
t= LINDGEN(50)-25
x = t^2

p = PLOT(t, x, LAYOUT=[2, 1, 1])
p2 = PLOT(x, t, LAYOUT=[2, 1, 2], /CURRENT)
Re: Orientation of 2-d plot [message #94116 is a reply to message #94109] Fri, 20 January 2017 10:09 Go to previous messageGo to next message
wlandsman is currently offline  wlandsman
Messages: 743
Registered: June 2000
Senior Member
On Friday, January 20, 2017 at 10:24:54 AM UTC-5, Phillip Bitzer wrote:
> On Thursday, January 19, 2017 at 7:17:54 PM UTC-6, Phillip Reid wrote:
>> Hello,
>> I'm trying to make a plot that is oriented at 90degrees to another plot on the same page.
>> A command something like:
>>
>> plot,time,variable,position=position,orient=90
>>
>> would do the trick - only "orient" isn't a keyword.
>>
>> Any idea how this might be done?
>> Thanks greatly.
>> Phil
>
> Just swap your variables:
> t= LINDGEN(50)-25
> x = t^2
>
> p = PLOT(t, x, LAYOUT=[2, 1, 1])
> p2 = PLOT(x, t, LAYOUT=[2, 1, 2], /CURRENT)

This works for most plots but won't if you are using BARPLOT() or creating a filled histogram plot. David Fanning's CGHISTOPLOT for direct graphics has a /ROTATE keyword (with an example in his plot gallery http://www.idlcoyote.com/gallery/) to rotate a filled histogram. Internally his program has to use a lot of calls to PLOTS to emulate a rotated filled histogram. --Wayne
Re: Orientation of 2-d plot [message #94119 is a reply to message #94109] Fri, 20 January 2017 14:45 Go to previous messageGo to next message
tasboy63 is currently offline  tasboy63
Messages: 2
Registered: January 2017
Junior Member
On Saturday, 21 January 2017 02:24:54 UTC+11, Phillip Bitzer wrote:
> On Thursday, January 19, 2017 at 7:17:54 PM UTC-6, Phillip Reid wrote:
>> Hello,
>> I'm trying to make a plot that is oriented at 90degrees to another plot on the same page.
>> A command something like:
>>
>> plot,time,variable,position=position,orient=90
>>
>> would do the trick - only "orient" isn't a keyword.
>>
>> Any idea how this might be done?
>> Thanks greatly.
>> Phil
>
> Just swap your variables:
> t= LINDGEN(50)-25
> x = t^2
>
> p = PLOT(t, x, LAYOUT=[2, 1, 1])
> p2 = PLOT(x, t, LAYOUT=[2, 1, 2], /CURRENT)


D'oh! I can't believe I didn't try that!
Thanks Phillip (and wlandsman) for your replies.
In this instance swapping the variables (with a little jiggery pokery) works just fine.
Phil
Re: Orientation of 2-d plot [message #94121 is a reply to message #94116] Sat, 21 January 2017 08:12 Go to previous messageGo to next message
Phillip Bitzer is currently offline  Phillip Bitzer
Messages: 223
Registered: June 2006
Senior Member
On Friday, January 20, 2017 at 12:09:18 PM UTC-6, wlandsman wrote:
> On Friday, January 20, 2017 at 10:24:54 AM UTC-5, Phillip Bitzer wrote:
>> On Thursday, January 19, 2017 at 7:17:54 PM UTC-6, Phillip Reid wrote:
>>> Hello,
>>> I'm trying to make a plot that is oriented at 90degrees to another plot on the same page.
>>> A command something like:
>>>
>>
>> Just swap your variables:
>> t= LINDGEN(50)-25
>> x = t^2
>>
>> p = PLOT(t, x, LAYOUT=[2, 1, 1])
>> p2 = PLOT(x, t, LAYOUT=[2, 1, 2], /CURRENT)
>
> This works for most plots but won't if you are using BARPLOT() or creating a filled histogram plot. David Fanning's CGHISTOPLOT for direct graphics has a /ROTATE keyword (with an example in his plot gallery http://www.idlcoyote.com/gallery/) to rotate a filled histogram. Internally his program has to use a lot of calls to PLOTS to emulate a rotated filled histogram. --Wayne

Good call Wayne. But, Barplot does have a horizontal property that rotates, i.e. produces horizontal bars, similar to David's cgHistoplot:

x = randomn(1l, 1000)
h = HISTOGRAM(x, BINSIZE=0.1, LOCATIONS=loc)
bp = barplot(loc, h)
bp.horizontal = 1
Re: Orientation of 2-d plot [message #94126 is a reply to message #94121] Sat, 21 January 2017 19:49 Go to previous message
wlandsman is currently offline  wlandsman
Messages: 743
Registered: June 2000
Senior Member
On Saturday, January 21, 2017 at 11:12:33 AM UTC-5, Phillip Bitzer wrote:

Cool!


> Good call Wayne. But, Barplot does have a horizontal property that rotates, i.e. produces horizontal bars, similar to David's cgHistoplot:
>
> x = randomn(1l, 1000)
> h = HISTOGRAM(x, BINSIZE=0.1, LOCATIONS=loc)
> bp = barplot(loc, h)
> bp.horizontal = 1
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Looping through arrays
Next Topic: VELOVECT Procedure

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 13:53:38 PDT 2025

Total time taken to generate the page: 0.00756 seconds