[gradsusr] How to draw string that matches default title settings?

Lyndz olagueralyndonmark429 at gmail.com
Fri Jun 15 14:11:15 EDT 2018


Hi Tracey,

If you look at the source code of set_parea.gs, you will see these lines.

            'set strsiz 0.25'
            'set string 1 c 6'
            'draw string 'x_cent' 'y_cent' 'i','j

>From this, you can just tweak the 'set strsiz'.
For your 2 by 2 panels, I have the following values:

set_parea 2 2 1 1 -margin 0.9
d precip
draw title GFS

set strsiz 0.199 0.24
set string 2 c 6
draw string 2.475 9.5 GFS
draw string 2.475 10  Cycle 2018061018 f03 Valid 2018061021

See attached output file.
You can just change the values of the x and y positions of the strings
above.

Is this what you want?

I hope this helps.

*Lyndon Mark P. Olaguera*
PhD Student
Laboratory of Climatology
Department of Geography
Faculty of Urban Environmental Science
Minami-Osawa Campus
Tokyo Metropolitan University
Hachioji Tokyo, Japan



On Fri, Jun 15, 2018 at 11:07 PM Tracey <tdorian10 at gmail.com> wrote:

> Hi Lyndz,
>
> I used "set_parea.gs" to plot two panels in the top of the plot, and one
> panel in the bottom center of the plot.
>
> For example, for one panel I have:
>
> * Draw one single title at the top center
>
> 'set strsiz 0.22'
>
> 'set font 0'
>
> 'set annot 1 12'
>
> 'draw string '0' '8' Cycle 2018061018 f03 Valid 2018061021 \ 2m Dewpoint
> [f]'
>
>
> * Plot a panel in the upper left corner, row 1, column 1
>
> 'set_parea 2 2 1 1 -margin 0.9'
>
> 'd ((DPT2m.1-273.15)*(9/5)+32)'
>
> 'q gxinfo'
>
> line3=sublin(result,3)
>
> x1=subwrd(line3,4)
>
> x2=subwrd(line3,6)
>
> say '    (x1,x2) = ('x1','x2')'
>
> line4=sublin(result,4)
>
> y1=subwrd(line4,4)
>
> y2=subwrd(line4,6)
>
> say '    (y1,y2) = ('y1','y2')'
>
> 'xcbar 'x1' 'x2' 'y1-0.4' 'y1-0.3' -fw .08 -fh .08 -fs 2'
>
> 'draw title GFS'
>
>
> This works to plot a single title at the top, but I would like a title
> with the exact same style as the titles for the individual panels.  Also
> I'm not quite sure I'm centering the title in the best way.
>
>
> I've attached a screenshot of what my final plot looks like:
>
>
>
>
>
> Thanks,
>
> Tracey
>
>
> On Fri, Jun 15, 2018 at 9:48 AM, Lyndz <olagueralyndonmark429 at gmail.com>
> wrote:
>
>> Hi,
>>
>> How did you do the panel plots?
>> Have you tried these examples/alternatives?
>>
>> http://bguan.bol.ucla.edu/bGASL.html (subplot.gs & drawstr.gs)
>>
>> http://gradsaddict.blogspot.com/2013/05/script-setparea-simple-way-to-set-up.html
>>
>> Hope this helps,
>>
>> *Lyndz*
>>
>>
>>
>> On Fri, Jun 15, 2018 at 10:05 PM Tracey <tdorian10 at gmail.com> wrote:
>>
>>> Good morning,
>>>
>>> I am plotting a multi-panel plot, and I discovered I can't add one
>>> single title at the top by using the "draw title" command, so I've used the
>>> "draw string" command and it successfully plots the string at the top.
>>> However, I was wondering if anyone knows how to exactly replicate the
>>> default font size, thickness, etc of the "draw title" command so that my
>>> string looks exactly like it would be if I had used "draw title"?
>>>
>>> The current settings that I have are the following:
>>>
>>> 'set strsiz 0.22'
>>>
>>> 'set font 0'
>>>
>>> 'set annot 1 12'
>>>
>>> 'draw string '1.5' '8' Cycle 2018061018 f03 Valid 2018061021 \ 2m
>>> Dewpoint [f]'
>>>
>>> But my title does not look the same as in my other plots when I use
>>> "draw title."   How do I need to change my settings to make it match
>>> exactly to the default title settings?  Any help would be greatly
>>> appreciated!
>>>
>>> Thank you,
>>> Tracey
>>> _______________________________________________
>>> gradsusr mailing list
>>> gradsusr at gradsusr.org
>>> http://gradsusr.org/mailman/listinfo/gradsusr
>>>
>>
>> _______________________________________________
>> gradsusr mailing list
>> gradsusr at gradsusr.org
>> http://gradsusr.org/mailman/listinfo/gradsusr
>>
>>
> _______________________________________________
> gradsusr mailing list
> gradsusr at gradsusr.org
> http://gradsusr.org/mailman/listinfo/gradsusr
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://gradsusr.org/pipermail/gradsusr/attachments/20180616/68f0c410/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image.png
Type: image/png
Size: 217737 bytes
Desc: not available
URL: <http://gradsusr.org/pipermail/gradsusr/attachments/20180616/68f0c410/attachment-0001.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test.jpeg
Type: image/jpeg
Size: 6181 bytes
Desc: not available
URL: <http://gradsusr.org/pipermail/gradsusr/attachments/20180616/68f0c410/attachment-0001.jpeg>


More information about the gradsusr mailing list