[ncl-talk] Modifying a boxplot diagram's x-axis
Alan Rhoades
alan.m.rhoades at gmail.com
Tue May 19 18:22:14 MDT 2015
Your suggestion worked perfectly. Thanks again!
On Tue, May 19, 2015 at 4:34 PM, Adam Phillips <asphilli at ucar.edu> wrote:
> Hi Alan,
> It sounds like what you want is to change the aspect ratio of the plot.
> Try setting vpWidthF = 0.4 in the plot resource list. (The default is 0.6
> for both vpWidthF and vpHeightF.) That should compress your x-axis by a
> third.
> Adam
>
>
>
> On May 19, 2015, at 4:52 PM, Alan Rhoades <alan.m.rhoades at gmail.com>
> wrote:
>
> Hi Adam,
>
> Thanks for the prompt reply! The description of the @boxWidth command was
> very helpful.
>
> I am still curious if there is a possible way to push all of the x-axis
> labels closer together, maintain the x-axis label font size, and thus
> eliminate the physical gaps, rather than simply filling in the space with
> the boxplot lines via @boxWidth? It seems that no matter what value you
> scale the x-axis to (i.e., 1 to 15 by 1, or 0 to 1 by 1/15) the space on
> the plot image is still maintained on the x-axis and "awkward" spacing is
> still seen between the x-axis tickmark labels.
>
> All the best,
>
> AR
>
> On Tue, May 19, 2015 at 3:30 PM, Adam Phillips <asphilli at ucar.edu> wrote:
>
>> Hi Alan,
>> The boxplot function was made to be flexible, and thus should accept most
>> if not all relevant resources thrown its way.
>>
>> You are right to focus in on your xdata_BOX_ALL array. (In your script
>> this equals the input X-axis center value for each box.) However, you also
>> likely need to modify your opti_all at boxWidth resource (=width of boxes
>> in x-axis units).
>>
>> For instance, if you set things this way:
>> xdata_BOX_ALL array = (/1,2,3,4/)
>> opti_all at boxWidth = 0.25
>> then each box would be 0.25 units wide centered around x-axis values of
>> 1, 2, 3, and 4.
>>
>> However, if you set things this way:
>> xdata_BOX_ALL array = (/1,2,3,4/)
>> opti_all at boxWidth = 0.90
>>
>> There would be very little space (=.1) between each box as the first box
>> will go from 0.55 to 1.45 along the x-axis, the second from 1.55 to 2.45,
>> etc..
>>
>> I just tested the above in a toy script I have here and I was able to
>> reduce the space between the boxes.
>>
>> Hope that's helps. If not, let ncl-talk know..
>> Adam
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> On Tue, May 19, 2015 at 3:30 PM, Alan Rhoades <alan.m.rhoades at gmail.com>
>> wrote:
>>
>>> Hello,
>>>
>>> I'm trying to modify a boxplot diagram (see attached *.pdf image) so
>>> that the x-axis doesn't take up as much room (i.e., make the boxes tighter
>>> together by eliminating the spacing in between them). I've tried several
>>> different things, but none seem to work. I've attached the script to this
>>> email (unfortunately the data file is large and can't be attached too).
>>> I'm assuming that there is an NCL resource that I haven't yet tapped into
>>> that can do the trick.
>>>
>>> Here is an example of what I've tried so far to scale the x-axis values
>>> (using fspan), but unfortunately didn't work...
>>>
>>> xdata_BOX_ALL = fspan(1,xdata_num_BOX_ALL,15)
>>>
>>> ...changing the above to...
>>>
>>> xdata_BOX_ALL = fspan(1,0.25*xdata_num_BOX_ALL,15)
>>> xdata_BOX_ALL = fspan(1,0.5*xdata_num_BOX_ALL,15)
>>>
>>> ...and I tried modifying some of the ncl resource options too, but I
>>> think the boxplot plotting function is a unique case and doesn't respond
>>> like other plots would.
>>>
>>> Any ideas on how to do this? I may have missed a few plotting
>>> resources, so any insights are helpful.
>>>
>>> All the best,
>>>
>>> AR
>>>
>>> --
>>>
>>> *Alan Rhoades*
>>> *PhD Student, Atmospheric Science Graduate Group*
>>> *Climate Change Water and Society (CCWAS) NSF IGERT Trainee*
>>> *University of California, Davis*
>>> *LinkedIn <https://www.linkedin.com/pub/alan-rhoades/22/5bb/52a>*
>>> *alan.m.rhoades at gmail.com <alan.m.rhoades at gmail.com> *
>>> *amrhoades at ucdavis.edu <amrhoades at ucdavis.edu>*
>>>
>>> *"It’s all really there. That’s what really gets you. But you gotta stop
>>> and think about it to really get the pleasure about the complexity, the
>>> inconceivable nature of nature."*
>>> *Richard Feynman*
>>>
>>> _______________________________________________
>>> ncl-talk mailing list
>>> List instructions, subscriber options, unsubscribe:
>>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>>
>>>
>>
>>
>> --
>> Adam Phillips
>> Associate Scientist, Climate and Global Dynamics Laboratory, NCAR
>> www.cgd.ucar.edu/staff/asphilli/ 303-497-1726
>>
>> <http://www.cgd.ucar.edu/staff/asphilli>
>>
>
>
>
> --
>
> *Alan Rhoades*
> *PhD Student, Atmospheric Science Graduate Group*
> *Climate Change Water and Society (CCWAS) NSF IGERT Trainee*
> *University of California, Davis*
> *LinkedIn <https://www.linkedin.com/pub/alan-rhoades/22/5bb/52a>*
> *alan.m.rhoades at gmail.com <alan.m.rhoades at gmail.com> *
> *amrhoades at ucdavis.edu <amrhoades at ucdavis.edu>*
>
> *"It’s all really there. That’s what really gets you. But you gotta stop
> and think about it to really get the pleasure about the complexity, the
> inconceivable nature of nature."*
> *Richard Feynman*
>
>
--
*Alan Rhoades*
*PhD Student, Atmospheric Science Graduate Group*
*Climate Change Water and Society (CCWAS) NSF IGERT Trainee*
*University of California, Davis*
*LinkedIn <https://www.linkedin.com/pub/alan-rhoades/22/5bb/52a>*
*alan.m.rhoades at gmail.com <alan.m.rhoades at gmail.com> *
*amrhoades at ucdavis.edu <amrhoades at ucdavis.edu>*
*"It’s all really there. That’s what really gets you. But you gotta stop
and think about it to really get the pleasure about the complexity, the
inconceivable nature of nature."*
*Richard Feynman*
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20150519/3e5d728c/attachment.html
More information about the ncl-talk
mailing list