mbaz / Gaston.jl

A julia front-end for gnuplot.
MIT License
148 stars 30 forks source link

Define less ugly defaults #75

Closed bbrunaud closed 5 years ago

bbrunaud commented 6 years ago

Hello

First of all, kudos for the great idea and work!. I took Gaston for a spin and the first thing I got was:

julia> using Gaston

julia> plot(1:5,[sin(i) for i in 1:5])
WARNING: Gnuplot returned an error message:
Gtk-Message: Failed to load module "overlay-scrollbar"
1

Julia 0.6 running on Ubuntu 17.10

The second thing I noticed is that my configuration in ~/.gnuplot was not loaded.

thanks!

mbaz commented 6 years ago

How did you determine that ~/.gnuplot is not loaded? Since Gaston uses its own defaults, it's possible that it is just being overriden.

At first sight, the GTK message looks like a Gnuplot problem. Does your gnuplot work fine by itself? What do you get if you run:

set term wxt
plot(sin(x))

in a gnuplot session?

bbrunaud commented 6 years ago

You are right, I was wondering why every line turned out blue. And also why the grid had disappeared. May I suggest a nicer set of defaults?.

# Borders
set border 3
set tics nomirror

# Grid
set style line 12 lc rgb '#808080' lt 0 lw 1
set grid back ls 12

# Default lines
set style line 1 lt 1 lw 2 lc rgb '#0072bd' pt 7 # blue
set style line 2 lw 2 lc rgb '#d95319' pt 5 # orange
set style line 3 lw 2 lc rgb '#edb120' pt 1 # yellow
set style line 4 lw 2 lc rgb '#7e2f8e' pt 13 # purple
set style line 5 lw 2 lc rgb '#77ac30' pt 9 # green
set style line 6 lw 2 lc rgb '#4dbeee' pt 2 # light-blue
set style line 7 lw 2 lc rgb '#a2142f' pt 11 # red
set linetype cycle 7

# Legend
set key outside

And perhaps a larger font for tics and legend. That would immediately improve first impression on the package.

Also, from gnuplot session I don't have that error. The error shows up as a warning. I can still see the plot.

best regards

mbaz commented 6 years ago

Regarding GTK's error: I think it's due to a problem with your installation. Nobody else has reported seeing it, and those warnings are usually caused by a mismatch between the libraries present in your system and the ones that a package was actually compiled with.

mbaz commented 6 years ago

Regarding the defaults: one problem is that everybody has different tastes. If I change them to your liking, somebody else might complain.

The ideal solution is to parse .gnuplot and use the settings there. It's not a trivial change, though.

bbrunaud commented 6 years ago

I agree that what looks good is very subjective. However, the gnuplot defaults are objectively ugly =) Check http://www.gnuplotting.org/attractive-plots/

mbaz commented 6 years ago

Heh :)

So I'll review the defaults, and also see about implementing a configuration file.

cosama commented 5 years ago

At least on my system the .gnuplot file is parsed and works as expected.

Unfortunately, Gaston defines its own defaults, that overwrite the gnuplot defaults, so it is required to set the values that I would like to use from .gnuplot to "" (i.e. color="").

I think it would be better (and easier to implement) to let gnuplot pick defaults, and allow them being adjusted in .gnuplot and don't define any defaults in Gaston (i.e. set all values in gaston_config to "").

mbaz commented 5 years ago

@cosama Thanks for the idea. I'll accept a pull request; otherwise I'll get to this in the near future.

mbaz commented 5 years ago

Fixed in https://github.com/mbaz/Gaston.jl/commit/dafbcf8d9e0ea299b74b5fca5e6d053bfdacd44f

cosama commented 5 years ago

@mbaz Great work on that. Sorry I didn't manage to find some time to help out some.

mbaz commented 5 years ago

@cosama No worries! Please let me know if you have more suggestions or find any bugs.