eplot icon indicating copy to clipboard operation
eplot copied to clipboard

Using the full terminal

Open kakulukia opened this issue 5 years ago • 6 comments

Hi!

I just fount this lil app - awesome! But im missing an option: how can i enlarge the chart size to use the full terminal instead of its default size?

You can get the current terminal size via stty size but i have no clue about gnuplot so far, maybe you know? How to adjust the chart size?

kakulukia avatar May 04 '20 10:05 kakulukia

I kinda fixed it by hand:

set terminal dumb size 265,65;

Thats supposed to be the -d option command to gnuplot, but itsthe reverse order of stty size.

If at some other time i have some time for my hello world with ruby, i might fix that myself. For now i know how to hard code my solution. :)

kakulukia avatar May 04 '20 11:05 kakulukia

Ok, thanks!

chriswolfvision avatar May 04 '20 11:05 chriswolfvision

Are you ging to include that in the script?

kakulukia avatar May 04 '20 11:05 kakulukia

I'ill not have time for it soon, but if you make a pull request, I will accept it.

chriswolfvision avatar May 04 '20 12:05 chriswolfvision

lets test my ruby skills then :)

kakulukia avatar May 04 '20 13:05 kakulukia

@kakulukia I can help with this if you don't mind doing the PR!

Put something like this in "VARIOUS CONSTANTS" section:

# default size for the 'dumb' terminal type
$tcols=`tput cols`.chomp || 79
$tlines=`tput lines`.chomp || 24

The defaults of 79×24 are gnuplot's own defaults. It would also be possible to parse the terminal dimensions out of the output of stty size and get it in the right (x, y) order for gnuplot with something like

`stty size`.split(" ").reverse.join(",")

but I think the first method just reads better for the humans. ;)

Then change the option processing for -d / --dumb to

# ---- Do we print to dumb terminal?
when /^-d$|^--dumb$/
    com=com+"set terminal dumb size #{$tcols},#{$tlines};\n"

That is sufficient to expand the plot to the available dimensions of the terminal by default, but I'd recommend making this optional, because I kind of like that the current default behavior for -d / --dumb doesn't fill the terminal. Perhaps having a fit or stretch optional argument to -d / --dumb would be the way to go?

Note that @chriswolfvision has used literal tabulator characters for indentation in his source file, which might be different from what you're used to, so be sure to set your editor to not expand tabs into spaces. The other PR overlooked this.

ernstki avatar Jul 31 '20 14:07 ernstki