Skip to content

using size parameter results in cropped image #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
gianniqq opened this issue Jul 26, 2017 · 4 comments
Open

using size parameter results in cropped image #1

gianniqq opened this issue Jul 26, 2017 · 4 comments

Comments

@gianniqq
Copy link

Using a command like
eplot data.txt -s 2

generates a cropped image instead of a complete bigger image.
The command seems to get the image to a higher resolution, but fails to place it in its entirety in a proper "outline"

foo

@travisdowns
Copy link

Can confirm I ran into this issue too.

When used with the dumb terminal option -d, most of the image is cropped away.

@lballardini
Copy link

I can confirm this. Happens when exporting to png too.

@ernstki
Copy link

ernstki commented Aug 4, 2020

The way the eplot passes the size parameter to gnuplot, you can only scale down. As stated in the manual (p. 30), in this particular context, size "scales the plot itself relative to the size of the canvas."

I think this is not a bug, rather the -s option just needs to be bounds-checked so that it cannot be greater than 1, otherwise you will get the cropping behavior described here. In light of that, it might be more appropriate to call the option --scale rather than --size, or at least use "scale, not size" as your mnemonic for remembering what eplot -s does.

If you are not happy with the default plot size of 640×480 px (6.25×5 in or ~15.9×12.7 cm at 96 ppi), you could:

  • modify the gnuplot script generated by eplot
    • dump the intermediate data files with eplot -D, if necessary
    • copy-paste or otherwise capture the output (standard error) of eplot into your own gnuplot script
    • then change the canvas size by adding size XDIM, YDIM (in pixels) at the end of the set term line
    • re-run gnuplot with your custom script and the same input files

—or—

  • output to SVG (-g) and scale it with some graphics program of your choice, e.g., Inkscape

—or—

  • modify the eplot script directly to set term TERMTYPE size XDIM, YDIM to your liking (reference)

@ernstki
Copy link

ernstki commented Aug 4, 2020

@travisdowns If you are just trying to get the plot to fill the terminal, you can apply this patch to your copy of eplot, or else vote for issue #7. Or do both!

If you trust that the patch linked above looks OK, you can apply it directly to your copy of eplot with

cd /the/place/where/you/have/eplot

curl https://github.com/chriswolfvision/eplot/compare/master...ernstki:dumb-auto-size.diff |
    patch -p1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants