Editing
Common pen parameters
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
To control the image size, you can use n1= n2= (size in pixels) aspect= (aspect ratio) ppi=(pixels per inch). The default size is 1024x 768. Because vplot uses a 2-byte representation for integers, it cannot deal with numbers greater than 256*128-1=32767. Feeding into vplot datasets with n1 or n2 greater than this number will result in an error. Vplot has two output "styles"... <tt>size=absolute</tt> and <tt>size=relative</tt> In size=absolute the output device has a specified size associated with it, and an inch is really an inch. If size=relative vplot uses the largest 4 wide by 3 tall rectangle that fits within the device screen. That rectangle is 10.24 inches high and 10.24 * 4 / 3 = 13.653 inches wide. Most devices set "size=relative" as the default. Traditionally hardcopy devices set "size=absolute" the default. After running through vppen by default the file will be "size=absolute" after that (vpstyle=no turns this feature of vppen off). The user can override the device's default by putting "size=a" or "size=r" on the command line. <tt>xwmax= ywmax= xwmin= ywmin=</tt> are generic vplot options which work in any filter. They override the global clip window, which normally would be set at the limits of the device screen. They DON'T reset where the "device screen" is. These can be useful if you want to chop off an extraneous piece of a plot that you don't want, for example chop off unneeded axis labels on a plot. My guess is you are wanting to "zoom in" on a particular piece of the vplot plotting area. There are generic vplot options for that, too: you can set "xcenter= ycenter=" and vplot will center that coordinate in the middle of the display. You can then use "scale" to zoom in on that piece to make it bigger. If you really want to be able to set "bounds of the area to rasterize", we could add those as specific options for gdpen or as generic options to dovplot. But my guess is if the piece you are wanting is small, it doesn't need as many pixels to describe it. The "vplot2gif" script does this by calling vppen to locate the plot on the page (centered at $xcen, $ycen) and see how big it is ($height, $width). It converts the height and width to pixel-size units. It then calls "ppmpen" with the following options: <syntaxhighlight lang="bash"> ppmpen n2=$height n1=$width ppi=$ppi size=a xcenter=$xcen ycenter=$ycen </syntaxhighlight> The "size=a" says "an inch is an inch", so that as you shrink the window to just get the part of the plot you are interested in, the plot stays the same size and doesn't shrink as well. The Madgascar "vplot2gif" script does it in Python: <syntaxhighlight lang="python"> run = 'ppmpen break=i n1=%d n2=%d ppi=%d size=a ' \ 'xcenter=%g ycenter=%g %s | ' \ 'ppmquant 256 | ppmtogif > %s' % \ (width,height,ppi,xcen,ycen,vppen,gif) </syntaxhighlight> ==Controlling figure size or aspect ratio== There are three basic parameters: <tt>screenratio</tt>, <tt>screenht</tt>, and <tt>screenwd</tt>. If <tt>screenwd</tt> is not provided, it is calculated as <tt>screenht/screenratio</tt>. The defaults are: <pre> screenratio=0.75 screenht=10.24 </pre> For a finer control, you can use <tt>xinch=</tt> (horizontal size), <tt>yinch=</tt> (vertical size), <tt>xll=</tt>, <tt>xur=</tt>, <tt>yll=</tt>, <tt>yur=</tt> (x and y coordinates for lower-left and upper-right corners). If not provided, they are calculated from <tt>screenht</tt> and <tt>screenwd</tt>. These parameters apply to programs such as sfcontour, sfgraph, sfgrey, sfplotrays, and sfwiggle.
Summary:
Please note that all contributions to Madagascar are considered to be released under the GNU Free Documentation License 1.3 or later (see
My wiki:Copyrights
for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource.
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Navigation menu
Personal tools
English
Not logged in
Talk
Contributions
Create account
Log in
Namespaces
Page
Discussion
English
Views
Read
Edit
View history
More
Search
Getting Madagascar
download
Installation
GitHub repository
SEGTeX
Introduction
Package overview
Tutorial
Hands-on tour
Reproducible documents
Hall of Fame
User Documentation
List of programs
Common programs
Popular programs
The RSF file format
Reproducibility with SCons
Developer documentation
Adding programs
Contributing programs
API demo: clipping data
API demo: explicit finite differences
Community
Conferences
User mailing list
Developer mailing list
GitHub organization
LinkedIn group
Development blog
Twitter
Slack
Tools
What links here
Related changes
Special pages
Page information