Giter Club home page Giter Club logo

gaston.jl's Introduction

Gaston: Julia plotting using gnuplot

Gaston is a Julia package for plotting. It provides an interface to gnuplot, a powerful plotting package available on all major platforms.

Current stable release is v1.1.0, and it has been tested with Julia LTS (1.6) and stable (1.8), on Linux. Gaston should work on any platform that runs gnuplot.

CI Status: CI

Documentation

Gaston.jl's documentation can be found here.

Why use Gaston?

Why use Gaston, when there are powerful alternatives such as Plots.jl and Makie.jl? These are some Gaston features that may be attractive to you:

  • Gaston can plot:
    • Using graphical windows, and keeping multiple plots active at a time, with mouse interaction
    • Directly to the REPL, using text (ASCII) or sixels
    • In Jupyter, Juno and other IDEs
  • Supports popular 2-D plots: regular function plots, stem, step, histograms, images, etc.
  • Supports surface, contour and heatmap 3-D plots.
  • Can save plots to multiple formats, including pdf, png and svg.
  • Provides a simple interface for knowledgeable users to access gnuplot features.
  • Fast: time to load package, plot, and save to pdf is around six seconds.

Knowledge of gnuplot is not required. Users familiar with gnuplot, however, will be able to take advantage of Gaston's facilities to access gnuplot's vast feature set.

Installation

Gaston requires gnuplot to be installed in your system. It has been tested with versions 5.4 and above, but it should work with any 5.x version. Gaston also requires Julia v1.6.0 or above.

To install Gaston using Julia's packaging system, enter Julia's package manager prompt with ], and run

(v1.4) pkg> add Gaston

Tests

Gaston includes many tests, wich you can run to make sure your installation is working properly. To run the tests, enter Julia's package manager with ] and run

(v1.6) pkg> test Gaston

All tests should pass, although some tests may be labeled as "broken".

gaston.jl's People

Contributors

adrianlzt avatar bbrunaud avatar bkamins avatar carlobaldassi avatar carlolucibello avatar cosama avatar dpo avatar favba avatar francilioaraujo avatar gdkrmr avatar goropikari avatar kronosthelate avatar mbaz avatar petrkryslucsd avatar stefankarpinski avatar t-bltg avatar tlienart avatar vtjnash avatar wentasah avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gaston.jl's Issues

Errors (and warnings) when using Gaston with julia v 0.4

julia> using Gaston
Warning: Gaston has only been tested on gnuplot version 4.6
WARNING: Base.String is deprecated, use AbstractString instead.
likely near /home/xxx/.julia/v0.4/Gaston/src/gaston_types.jl:8
WARNING: Base.String is deprecated, use AbstractString instead.
likely near /home/xxx/.julia/v0.4/Gaston/src/gaston_types.jl:8
WARNING: Base.String is deprecated, use AbstractString instead.
likely near /home/xxx/.julia/v0.4/Gaston/src/gaston_types.jl:53
WARNING: Base.String is deprecated, use AbstractString instead.
likely near /home/xxx/.julia/v0.4/Gaston/src/gaston_types.jl:53
WARNING: Base.String is deprecated, use AbstractString instead.
likely near /home/xxx/.julia/v0.4/Gaston/src/gaston_types.jl:53
WARNING: Base.String is deprecated, use AbstractString instead.
likely near /home/xxx/.julia/v0.4/Gaston/src/gaston_types.jl:53
WARNING: Base.String is deprecated, use AbstractString instead.
likely near /home/xxx/.julia/v0.4/Gaston/src/gaston_types.jl:53
WARNING: Base.String is deprecated, use AbstractString instead.
likely near /home/xxx/.julia/v0.4/Gaston/src/gaston_types.jl:53
WARNING: Base.String is deprecated, use AbstractString instead.
likely near /home/xxx/.julia/v0.4/Gaston/src/gaston_types.jl:53
WARNING: Base.String is deprecated, use AbstractString instead.
likely near /home/xxx/.julia/v0.4/Gaston/src/gaston_types.jl:53
WARNING: Base.String is deprecated, use AbstractString instead.
likely near /home/xxx/.julia/v0.4/Gaston/src/gaston_types.jl:53
WARNING: Base.String is deprecated, use AbstractString instead.
likely near /home/xxx/.julia/v0.4/Gaston/src/gaston_types.jl:53
WARNING: Base.String is deprecated, use AbstractString instead.
likely near /home/xxx/.julia/v0.4/Gaston/src/gaston_types.jl:53
WARNING: Base.String is deprecated, use AbstractString instead.
likely near /home/xxx/.julia/v0.4/Gaston/src/gaston_types.jl:53
WARNING: Base.String is deprecated, use AbstractString instead.
likely near /home/xxx/.julia/v0.4/Gaston/src/gaston_types.jl:53
WARNING: Base.String is deprecated, use AbstractString instead.
likely near /home/xxx/.julia/v0.4/Gaston/src/gaston_types.jl:53
WARNING: Base.String is deprecated, use AbstractString instead.
likely near /home/xxx/.julia/v0.4/Gaston/src/gaston_types.jl:53
WARNING: Base.String is deprecated, use AbstractString instead.
likely near /home/xxx/.julia/v0.4/Gaston/src/gaston_types.jl:53
WARNING: Base.String is deprecated, use AbstractString instead.
likely near /home/xxx/.julia/v0.4/Gaston/src/gaston_types.jl:53
WARNING: Base.String is deprecated, use AbstractString instead.
likely near /home/xxx/.julia/v0.4/Gaston/src/gaston_types.jl:53
WARNING: Base.String is deprecated, use AbstractString instead.
likely near /home/xxx/.julia/v0.4/Gaston/src/gaston_types.jl:53
WARNING: Base.String is deprecated, use AbstractString instead.
likely near /home/xxx/.julia/v0.4/Gaston/src/gaston_types.jl:53
WARNING: Base.String is deprecated, use AbstractString instead.
likely near /home/xxx/.julia/v0.4/Gaston/src/gaston_types.jl:53
WARNING: Base.String is deprecated, use AbstractString instead.
likely near /home/xxx/.julia/v0.4/Gaston/src/gaston_types.jl:53
WARNING: Base.String is deprecated, use AbstractString instead.
likely near /home/xxx/.julia/v0.4/Gaston/src/gaston_types.jl:53
WARNING: Base.String is deprecated, use AbstractString instead.
likely near /home/xxx/.julia/v0.4/Gaston/src/gaston_types.jl:53
WARNING: Base.String is deprecated, use AbstractString instead.
likely near /home/xxx/.julia/v0.4/Gaston/src/gaston_types.jl:53
WARNING: Base.String is deprecated, use AbstractString instead.
likely near /home/xxx/.julia/v0.4/Gaston/src/gaston_types.jl:53
WARNING: Base.String is deprecated, use AbstractString instead.
likely near /home/xxx/.julia/v0.4/Gaston/src/gaston_types.jl:53
WARNING: Base.String is deprecated, use AbstractString instead.
likely near /home/xxx/.julia/v0.4/Gaston/src/gaston_types.jl:53
WARNING: Base.String is deprecated, use AbstractString instead.
likely near /home/xxx/.julia/v0.4/Gaston/src/gaston_types.jl:53
WARNING: Base.String is deprecated, use AbstractString instead.
likely near /home/xxx/.julia/v0.4/Gaston/src/gaston_types.jl:53
WARNING: Base.String is deprecated, use AbstractString instead.
likely near /home/xxx/.julia/v0.4/Gaston/src/gaston_types.jl:53
WARNING: Base.String is deprecated, use AbstractString instead.
likely near /home/xxx/.julia/v0.4/Gaston/src/gaston_types.jl:53
WARNING: Base.String is deprecated, use AbstractString instead.
likely near /home/xxx/.julia/v0.4/Gaston/src/gaston_types.jl:53
WARNING: Base.String is deprecated, use AbstractString instead.
likely near /home/xxx/.julia/v0.4/Gaston/src/gaston_types.jl:53
WARNING: Base.String is deprecated, use AbstractString instead.
likely near /home/xxx/.julia/v0.4/Gaston/src/gaston_types.jl:53
WARNING: Base.String is deprecated, use AbstractString instead.
likely near /home/xxx/.julia/v0.4/Gaston/src/gaston_types.jl:53
WARNING: Base.String is deprecated, use AbstractString instead.
likely near /home/xxx/.julia/v0.4/Gaston/src/gaston_types.jl:99
WARNING: Base.String is deprecated, use AbstractString instead.
likely near /home/xxx/.julia/v0.4/Gaston/src/gaston_types.jl:99
WARNING: Base.String is deprecated, use AbstractString instead.
likely near /home/xxx/.julia/v0.4/Gaston/src/gaston_types.jl:99
WARNING: Base.String is deprecated, use AbstractString instead.
likely near /home/xxx/.julia/v0.4/Gaston/src/gaston_types.jl:99
WARNING: Base.String is deprecated, use AbstractString instead.
likely near /home/xxx/.julia/v0.4/Gaston/src/gaston_types.jl:99
WARNING: Base.String is deprecated, use AbstractString instead.
likely near /home/xxx/.julia/v0.4/Gaston/src/gaston_types.jl:99
WARNING: Base.String is deprecated, use AbstractString instead.
likely near /home/xxx/.julia/v0.4/Gaston/src/gaston_types.jl:99
WARNING: Base.String is deprecated, use AbstractString instead.
likely near /home/xxx/.julia/v0.4/Gaston/src/gaston_types.jl:99
WARNING: Base.String is deprecated, use AbstractString instead.
likely near /home/xxx/.julia/v0.4/Gaston/src/gaston_types.jl:117
WARNING: Base.String is deprecated, use AbstractString instead.
likely near /home/xxx/.julia/v0.4/Gaston/src/gaston_types.jl:117
WARNING: Base.String is deprecated, use AbstractString instead.
likely near /home/xxx/.julia/v0.4/Gaston/src/gaston_types.jl:117
WARNING: Base.String is deprecated, use AbstractString instead.
likely near /home/xxx/.julia/v0.4/Gaston/src/gaston_types.jl:117
WARNING: Base.String is deprecated, use AbstractString instead.
likely near /home/xxx/.julia/v0.4/Gaston/src/gaston_types.jl:117
WARNING: Base.String is deprecated, use AbstractString instead.
likely near /home/xxx/.julia/v0.4/Gaston/src/gaston_types.jl:117
WARNING: Base.String is deprecated, use AbstractString instead.
likely near /home/xxx/.julia/v0.4/Gaston/src/gaston_types.jl:117
WARNING: Base.String is deprecated, use AbstractString instead.
likely near /home/xxx/.julia/v0.4/Gaston/src/gaston_types.jl:117
WARNING: Base.String is deprecated, use AbstractString instead.
likely near /home/xxx/.julia/v0.4/Gaston/src/gaston_types.jl:117
WARNING: Base.String is deprecated, use AbstractString instead.
likely near /home/xxx/.julia/v0.4/Gaston/src/gaston_types.jl:117
WARNING: Base.String is deprecated, use AbstractString instead.
likely near /home/xxx/.julia/v0.4/Gaston/src/gaston_types.jl:117
WARNING: Base.String is deprecated, use AbstractString instead.
likely near /home/xxx/.julia/v0.4/Gaston/src/gaston_types.jl:117
WARNING: Base.String is deprecated, use AbstractString instead.
likely near /home/xxx/.julia/v0.4/Gaston/src/gaston_types.jl:117
WARNING: Base.String is deprecated, use AbstractString instead.
likely near /home/xxx/.julia/v0.4/Gaston/src/gaston_types.jl:117
WARNING: Base.String is deprecated, use AbstractString instead.
likely near /home/xxx/.julia/v0.4/Gaston/src/gaston_types.jl:117
WARNING: Base.String is deprecated, use AbstractString instead.
likely near /home/xxx/.julia/v0.4/Gaston/src/gaston_types.jl:117
WARNING: Base.String is deprecated, use AbstractString instead.
likely near /home/xxx/.julia/v0.4/Gaston/src/gaston_types.jl:117
WARNING: Base.String is deprecated, use AbstractString instead.
likely near /home/xxx/.julia/v0.4/Gaston/src/gaston_types.jl:117
ERROR: LoadError: LoadError: UndefVarError: Range1 not defined
while loading /home/xxx/.julia/v0.4/Gaston/src/gaston_types.jl, in expression starting on line 161
while loading /home/xxx/.julia/v0.4/Gaston/src/Gaston.jl, in expression starting on line 26

This is happening with julia 0.4:

julia> versioninfo()
Julia Version 0.4.0
Commit 0ff703b (2015-10-08 06:20 UTC)
Platform Info:
System: Linux (x86_64-redhat-linux)
CPU: Intel(R) Core(TM) i5 CPU M 520 @ 2.40GHz
WORD_SIZE: 64
BLAS: libopenblas (DYNAMIC_ARCH NO_AFFINITY Nehalem)
LAPACK: libopenblasp.so.0
LIBM: libopenlibm
LLVM: libLLVM-3.3

errorbars not working

I use the following code

using Gaston
y = collect(1:20)
ye = rand(20)

plot(y,ye,"plotstyle","errorbars")

but I get the following error

ArgumentError: number of rows of each array must match (got (20,20,0))

 in typed_hcat(::Type{Any}, ::Array{Float64,1}, ::Array{Float64,1}, ::Array{Any,1}, ::Vararg{Array{Any,1},N}) at ./abstractarray.jl:1012
 in hcat(::Array{Float64,1}, ::Array{Float64,1}, ::Array{Any,1}, ::Vararg{Array{Any,1},N}) at ./array.jl:728
 in llplot() at /home/francilio/.julia/v0.5/Gaston/src/gaston_midlvl.jl:264
 in plot(::Array{Float64,1}, ::Vararg{Any,N}) at /home/francilio/.julia/v0.5/Gaston/src/gaston_hilvl.jl:234

I looked in the source code and solved with this

if isempty(i.ylow)
    writedlm(f,[i.x i.y],' ')
else
    writedlm(f,[i.x i.y i.ylow],' ')
end

on line 264 of file gaston_midlvl.jl

Feature request: support for time series

I've seen several examples of using gnuplot for plotting time series. This functionality might already be exposed in Gaston.

# a demonstration of gnuplot finance plot styles
# by John Bollinger, CFA, CMT
# www.BollingerBands.com
# [email protected]

set title "Finance bars"
set yrange [75:105]
set ytics (105, 100, 95, 90, 85, 80)
set xrange [50:253]
set lmargin 9
set rmargin 2
set grid
set logscale y
plot 'finance.dat' using 0:2:3:4:5 notitle with financebars lt 8

This produces a plot that looks like this:

http://imgur.com/jcaMKcm

Gaston does not work with Windows

There are a few differences from a Linux box:
(1) Windows does not know "which". In Gaston.jl we can use instead of:
if !success(which gnuplot)
the universal
if !success(gnuplot --version)
(2) There is no standard environment variable USER. Use USERNAME instead (in Gaston.jl), or create a USER variable.
(3) There is no popen function in a standard C library for opening a pipe. In the kernel dll there is _popen, which can be similar.

I tried the corresponding simple fixes (and the ones about dozens of deprecation warnings with assert() and contains()), so
using Gaston
finally returns without errors. However, gaston_demo() does not create a file figure1.dat, and so it ends up in error, without showing anything.

Even gaston_test() is not happy. I got errors about invalid sleep intervals (0.3 and 0.4). I can replace the parameters with 1s, to get something happening, but only 80 tests passed of 98.

Interaction with plots

In the documentation it's stated that you can interact with mouse and keyboard, but I can't find out how to do this.

Where is this documented?

gnuplot_send() method crashing

When I try to use the following code in IJulia

using Gaston
gnuplot_send("set view 67,25")
surf(-3:.1:3,-3:0.1:3,(x,y)->cos(x)*sin(y),"plotstyle","points","xlabel","coord 1","ylabel","coord 2","zlabel","coord 3","title","surf demo","color","blue")

I get the following error

MethodError: no method matching write(::Int64, ::String)
Closest candidates are:
  write(::AbstractString, ::Any...) at io.jl:107
  write(::IO, ::String) at strings/string.jl:244
  write(::IO, ::AbstractString) at strings/io.jl:71
  ...

 in gnuplot_send(::String) at /home/francilio/.julia/v0.5/Gaston/src/gaston_lowlvl.jl:8

Perhaps the gnuplot_state.fid[1] field is setted wrong in the first run.

Gaston types are not exported

julia> using Gaston

julia> CurveConf
ERROR: CurveConf not defined

julia> require(Pkg.dir("Gaston/src/gaston_types.jl"))

julia> CurveConf
CurveConf

yrange

Is it possible to define axis-ranges?

I tried the following without success

xs = [1,2,3,4,5]
ys = [0,0,0,0,0]
plot(xs,ys, "yrange", [-0.5,0.5])

Re-work the demos

Maybe make individual demos; make them more illustrative and tutorial-like.

Saving to file crops the image

Using the example in the PDF docs.

julia> plot(sin(-pi:0.01:pi))
20

julia> set_filename("test.png")
"test.png"

julia> printfigure("png")
20

The original plot generated looks right, with the title and x and y labels. The saved file crops off the title, x-label and y-label

0.4.0-rc problem starting gnuplot

I just upgraded to julia 0.4.0-rc and checked out Gaston. Gnuplot does not start.

  julia> Gaston.plot(sin(-pi:.01:pi))
  ERROR: There was a problem starting up gnuplot.
   in gnuplot_init at /home/yves/.julia/v0.4/Gaston/src/gaston_aux.jl:10
   in figure at /home/yves/.julia/v0.4/Gaston/src/gaston_hilvl.jl:94
   in plot at /home/yves/.julia/v0.4/Gaston/src/gaston_hilvl.jl:142

This could come from the instruction Base.Pipe(C_NULL) in the definition of popen3. This seems to raise an error now.

  julia> let x = Base.Pipe(C_NULL) ; print("ok") ; end
  ERROR: MethodError: `convert` has no method matching convert(::Type{Pipe}, ::Ptr{Void})
  This may have arisen from a call to the constructor Pipe(...),
  since type constructors fall back to convert methods.
  Closest candidates are:
    Pipe(::Any, !Matched::Any)
    call{T}(::Type{T}, ::Any)
    convert{T}(::Type{T}, !Matched::T)
    ...
   in call at essentials.jl:56

Gaston package

The doc says to do

Pkg.add("Gaston")

but I get

julia> Pkg.add("Gaston")
ERROR: Unknown package Gaston; Perhaps you need to Pkg.update() for new metadata?
in anonymous at no file:118
in cd at file.jl:26
in cd_pkgdir at pkg.jl:34
in add at pkg.jl:113
in add at pkg.jl:145

With julia release-0.1 AND with latest julia HEAD.

gaston + gnuplot-x11 not persisting

gnuplot closes immediately after being called, which also closes the plot window.
Adding the -persist flag to the gnuplot_init() function inside gaston_aux.js remedies the problem.

I am using Ubuntu 13.04, Julia 0.1.2 and gnuplot-x11 (the package that includes wxt) version 4.6 patchlevel 1

Code:

function gnuplot_init()                                                         
    global gnuplot_state                                                        
    f = ccall(:popen, Ptr{Int}, (Ptr{Uint8},Ptr{Uint8}), "gnuplot -persist" ,"w\
")                                                                              
    if f == C_NULL                                                              
        error("There was a problem starting up gnuplot.")                       
    end                                                                         
    gnuplot_state.running = true                                                
    gnuplot_state.fid = f                                                       
end

Tests failing on Windows, file access

Running Julia through Cygwin, after installing GNUPlot:

julia> using Gaston

julia> run(`gnuplot --version`)
gnuplot 5.2 patchlevel 2

So far so good. Pkg.test() results in a file path failure that can probably be easily fixed. Just reporting for now:

WARNING: Plotting with an 'unknown' terminal.
No output will be generated. Please select a terminal with 'set terminal'.
WARNING: Gnuplot returned an error message:

gnuplot> set output "C:\cygwin64\tmp\/gastontest"
                                                 ^
         line 0:          cannot open file; output not changed
system error: No such file or directory

gaston_demo() fails on Mac

On my mac, doing gaston_demo() yields:

julia> Gaston.gaston_demo()

gnuplot> set term wxt 1
                  ^
         line 0: unknown or ambiguous terminal type; type just 'set terminal' for a list


gnuplot> set term wxt 2
                  ^
         line 0: unknown or ambiguous terminal type; type just 'set terminal' for a list


gnuplot> set term wxt 3
                  ^
         line 0: unknown or ambiguous terminal type; type just 'set terminal' for a list


gnuplot> set term wxt 4
                  ^
         line 0: unknown or ambiguous terminal type; type just 'set terminal' for a list


gnuplot> set term wxt 5
                  ^
         line 0: unknown or ambiguous terminal type; type just 'set terminal' for a list


gnuplot> set term wxt 6
                  ^
         line 0: unknown or ambiguous terminal type; type just 'set terminal' for a list


gnuplot> set term wxt 7
                  ^
         line 0: unknown or ambiguous terminal type; type just 'set terminal' for a list


gnuplot> set term wxt 8
                  ^
         line 0: unknown or ambiguous terminal type; type just 'set terminal' for a list


gnuplot> set term wxt 9
                  ^
         line 0: unknown or ambiguous terminal type; type just 'set terminal' for a list


gnuplot> set term wxt 10
                  ^
         line 0: unknown or ambiguous terminal type; type just 'set terminal' for a list


gnuplot> set term wxt 11
                  ^
         line 0: unknown or ambiguous terminal type; type just 'set terminal' for a list


gnuplot> set term wxt 12
                  ^
         line 0: unknown or ambiguous terminal type; type just 'set terminal' for a list


gnuplot> set term wxt 13
                  ^
         line 0: unknown or ambiguous terminal type; type just 'set terminal' for a list


gnuplot> set term wxt 14
                  ^
         line 0: unknown or ambiguous terminal type; type just 'set terminal' for a list


gnuplot> set term wxt 15
                  ^
         line 0: unknown or ambiguous terminal type; type just 'set terminal' for a list


gnuplot> set term wxt 16
                  ^
         line 0: unknown or ambiguous terminal type; type just 'set terminal' for a list


gnuplot> set term wxt 17
                  ^
         line 0: unknown or ambiguous terminal type; type just 'set terminal' for a list


gnuplot> set term wxt 18
                  ^
         line 0: unknown or ambiguous terminal type; type just 'set terminal' for a list


gnuplot> set term wxt 19
                  ^
         line 0: unknown or ambiguous terminal type; type just 'set terminal' for a list


gnuplot> set term wxt 20
                  ^
         line 0: unknown or ambiguous terminal type; type just 'set terminal' for a list

gnuplot not available

Hi,

I'm trying to use the Gaston package, but when I press using Gaston, Julia says gnuplot is not available on this system. I opened the ENV["PATH"], the directory for gnuplot is not in the list, but I can't seem to get it to be added to the list.

I'm new to the language, so it could be I'm missing something straightforward, but I can't seem to find a solution that works.

please help.

REPL hanging after a second plot

I just upgraded julia and gaston to latest version today, and I get a weird behavior at the repl (cli or emacs).
The first plot is fine but the repl hangs for ever after a second plot.

  julia> using Gaston      
  julia> set_terminal("x11")
  "x11"      
  julia> plot(sin(-10:0.01:10))
  0      
  julia> plot(sin(-5:0.01:5))

The plot occurs (same window) but the REPL does not return. Interrupt gives

    C-c C-cERROR: InterruptException:
   in process_events at ./stream.jl:639
   in wait at ./task.jl:298
   in wait at ./task.jl:225
   in sleep at ./stream.jl:613
   in llplot at /home/mlr/.julia/v0.4/Gaston/src/gaston_midlvl.jl:359
   in plot at /home/mlr/.julia/v0.4/Gaston/src/gaston_hilvl.jl:230

I can replicate the problem with the qt terminal. I don't have wxt installed so I don't know if the problem appears in that case. Subsequent plots hang the repl in the same way.

Cannot install

Hi Miguel. Julia 0.2.0, CentOS 6.4, gnuplot 4.6.2, cairo 1.8.8, pango 1.28.1, Gaston fails. Any ideas? Thanks, Jesus.

Pkg.add("Gaston")
...
MESSAGE: Attempting to Create directory /root/.julia/Cairo/deps/src/cairo-1.12.8
execvp(): No such file or directory
tar: This does not look like a tar archive
tar: Exiting with failure status due to previous errors
ERROR: failed processes:
Process(unxz -c /root/.julia/Cairo/deps/downloads/cairo-1.12.8.tar.xz, ProcessExited(-1)) [-1]
Process(tar xv --directory=/root/.julia/Cairo/deps/src, ProcessExited(2)) [2]
in pipeline_error at process.jl:412
in run at process.jl:384
in run at /root/.julia/BinDeps/src/BinDeps.jl:359
in run at /root/.julia/BinDeps/src/BinDeps.jl:376
in run at /root/.julia/BinDeps/src/BinDeps.jl:376
in run at /root/.julia/BinDeps/src/BinDeps.jl:376
in run at /root/.julia/BinDeps/src/BinDeps.jl:147
in run at /root/.julia/BinDeps/src/BinDeps.jl:376
in include_from_node1 at loading.jl:92
in anonymous at no file:249
in cd at file.jl:26
in runbuildscript at pkg.jl:246
in _resolve at pkg.jl:330
in anonymous at no file:592
in cd at file.jl:26
in cd_pkgdir at pkg.jl:42
in update at pkg.jl:563
at /root/.julia/Cairo/deps/build.jl:79

Configuring for cygwin / mintty

Glad to see the progress here!
I'm on windows, using cygwin. The terminal is called mintty. Gnuplot is installed, and I believe gnuplot is configured correctly (see screenshot). It looks like we can have inline plotting in the REPL with some help.

The test feedback, or trying to make a plot in the REPL result in:

julia> Pkg.test("Gaston")
INFO: Testing Gaston
WARNING: Gnuplot returned an error message:
WARNING: Plotting with an 'unknown' terminal.
No output will be generated. Please select a terminal with 'set terminal'.

image

Updates to README

It would be nice if the README were updated to reflect the fact that one has to use the Gaston module to use Gaston functions.

Pkg.add("Gaston")
Using Gaston

Also, gaston_demos() doesn't exist, and one has to use Gaston.gaston_demo() to get the demo to run. Of course, the other alternative is to do importall Gaston, and then gaston_demo() works fine.

[0.2]gaston_demo

julia> using Gaston

julia> gaston_demo()

gnuplot> set term wxt 1
                  ^
         line 0: unknown or ambiguous terminal type; type just 'set terminal' for a list


gnuplot> set term wxt 2
                  ^
         line 0: unknown or ambiguous terminal type; type just 'set terminal' for a list


gnuplot> set term wxt 3
                  ^
         line 0: unknown or ambiguous terminal type; type just 'set terminal' for a list


gnuplot> set term wxt 4
                  ^
         line 0: unknown or ambiguous terminal type; type just 'set terminal' for a list


gnuplot> set term wxt 5
                  ^
         line 0: unknown or ambiguous terminal type; type just 'set terminal' for a list


gnuplot> set term wxt 6
                  ^
         line 0: unknown or ambiguous terminal type; type just 'set terminal' for a list


gnuplot> set term wxt 7
                  ^
         line 0: unknown or ambiguous terminal type; type just 'set terminal' for a list


gnuplot> set term wxt 8
                  ^
         line 0: unknown or ambiguous terminal type; type just 'set terminal' for a list


gnuplot> set term wxt 9
                  ^
         line 0: unknown or ambiguous terminal type; type just 'set terminal' for a list


gnuplot> set term wxt 10
                  ^
         line 0: unknown or ambiguous terminal type; type just 'set terminal' for a list


gnuplot> set term wxt 11
                  ^
         line 0: unknown or ambiguous terminal type; type just 'set terminal' for a list


gnuplot> set term wxt 12
                  ^
         line 0: unknown or ambiguous terminal type; type just 'set terminal' for a list


gnuplot> set term wxt 13
                  ^
         line 0: unknown or ambiguous terminal type; type just 'set terminal' for a list


gnuplot> set term wxt 14
                  ^
         line 0: unknown or ambiguous terminal type; type just 'set terminal' for a list


gnuplot> set term wxt 15
                  ^
         line 0: unknown or ambiguous terminal type; type just 'set terminal' for a list


gnuplot> set term wxt 16
                  ^
         line 0: unknown or ambiguous terminal type; type just 'set terminal' for a list


gnuplot> set term wxt 17
                  ^
         line 0: unknown or ambiguous terminal type; type just 'set terminal' for a list


gnuplot> set term wxt 18
                  ^
         line 0: unknown or ambiguous terminal type; type just 'set terminal' for a list


gnuplot> set term wxt 19
                  ^
         line 0: unknown or ambiguous terminal type; type just 'set terminal' for a list


gnuplot> set term wxt 20
                  ^
         line 0: unknown or ambiguous terminal type; type just 'set terminal' for a list

Gaston and Windows 7

Hi, I tried to use Gaston on Windows 7, and run into a few issues, that I empirically found solutions to:

  1. Gaston.jl line 17:
 if !success(`which gnuplot`)

'which' does not run directly. To solve this problem I have changed the line to :

if !success(`bash which gnuplot`)
  1. Gaston.jl line 36:
gnuplot_state = GnuplotState(false,0,0,string("/tmp/gaston-",ENV["USER"], "-",randstring(5),"/"),[])

on my system there is no USER env var defined. I do not know if this is typical for window systems. I added it to prepare-julia-env.bat file (set USER=Me)

  1. The same line. I had an issue with '/tmp'. Simply changing it to 'C:/' solved the problem.
gnuplot_state = GnuplotState(false,0,0,string("C:/Users/Temp/gaston-",ENV["USER"], "-",randstring(5),"/"),[])

Or any other temp dir, as long as it exists.

  1. gaston_aux.jl line 7 and 20. There is no popen and pclose on windows. They need to be changed to _popen and _pclose for it to work.

  2. Added gnuplot path in prepare-julia-env.bat to the PATH env

After these changes:

using Gaston
plot([1,2,3], [1,2,3])

produced a plot.

Jarek

Add Base.writemime methods for export

We've recently added a general API for multimedia I/O to Julia's standard library. What this allows you to do is to write a writemime method for any of your types that exports it to any MIME type you know how to write, and then display(x) on that type will automatically display it on any supporting display that has been loaded. In particular, the upcoming IJulia front-end hooks up with IPython to enable inline display of SVG, PNG, and JPEG graphics.

This way, you only need to supply a writemime method to enable multimedia display, and don't need to worry about managing windows or GUIs.

It would be nice to add some support to Gaston for this, at least to allow inline display in IJulia. What is needed is:

  • A writemime(io::IO, ::@MIME("image/svg+xml"), x::Figure) that writes a figure to io as SVG (and similar for PNG etcetera) using Gnuplot's export functions. Right now, it looks like you use integers as your figure handles, so you may need to wrap a new Figure type around these handles.
  • If the current display supports images (if displayable("image/svg+xml") || displayable("image/png") is true), you might consider having plot and similar functions simply call redisplay(x) on your Figure handle instead of asking GnuPlot to pop up a window. This will allow e.g. inline plots in IJulia by default.

plot() does not accept keyword arguments?

julia> using Gaston

WARNING: deprecated syntax "typealias UnitRange{T} Range1{T}" at C:\Users\PetrKrysl\.julia\v0.6\Gaston\src\gaston_types.jl:9.
Use "UnitRange{T} = Range1{T}" instead.

julia> t = 0:0.01:1
0.0:0.01:1.0

julia> plot(t, sin.(2π*5*t));

julia> plot(t,sin.(2π*5*t),title="A sine wave",xlabel="Time (s)",ylabel="Amplitude",grid="on",linewidth=3,color="blue",
           yrange="[-1.1:1.1]",marker="ecircle",plotstyle="linespoints");
ERROR: function plot does not accept keyword arguments
Stacktrace:
 [1] kwfunc(::Any) at .\boot.jl:237
julia> versioninfo()
Julia Version 0.6.2
Commit d386e40c17* (2017-12-13 18:08 UTC)
Platform Info:
  OS: Windows (x86_64-w64-mingw32)
  CPU: Intel(R) Core(TM) i7-6650U CPU @ 2.20GHz
  WORD_SIZE: 64
  BLAS: libopenblas (USE64BITINT DYNAMIC_ARCH NO_AFFINITY Haswell)
  LAPACK: libopenblas64_
  LIBM: libopenlibm
  LLVM: libLLVM-3.9.1 (ORCJIT, skylake)

No histogram with Gaston on 0.6

The histogram functionality doesn't work any more under julia v0.6.0
I guess that this comes from the fact that the function hist has been removed from base.
There is instead a function fit(Histogram, ...) in the package StatsBase.

julia> Gaston.histogram(randn(100000), "bins", 100, "norm", 1, "color", "gray")
ERROR: UndefVarError: hist not defined
Stacktrace:
[1] histogram(::Array{Float64,1}, ::Vararg{Any,N} where N) at ~/.julia/v0.6/Gaston/src/gaston_hilvl.jl:283

How to set grid?

I would like to be able set a grid on my plots.
How would I do this?

Mid-level API not being exported

I have a program in which I want to add curves to a plot iteratively. The documentation says to use addcoords in order to accomplish this. However, I am unable to do so because the mid-level functions and types like addcoords, CurveConf, etc. are not exported. Was this an oversight, or has the mid-level API been removed from the public interface? If the latter, how do I go about iteratively adding curves to a plot?

Improve commands syntax

I need to modernize the syntax of plot and similar commands -- right now they're really clunky.

Also, think about prefixing commands with g so that other plotting packages may be loaded at the same time.

Gaston fails to load

Hi, I wanted to try Gaston but couldn't.
My system:

  • Linux asus_nixos 4.6.5 #1-NixOS SMP Wed Jul 27 15:42:34 UTC 2016 x86_64 GNU/Linux
  • julia version 0.4.5
  • gnuplot: Version 5.0 patchlevel 3 last modified 2016-02-21
  • Gaston installed with Pkg.add("Gaston")

Running using Gaston leads to many deprecation warning

WARNING: Base.String is deprecated, use AbstractString instead.
  likely near /home/nixo/.julia/v0.4/Gaston/src/gaston_types.jl:117

and


ERROR: LoadError: LoadError: UndefVarError: Range1 not defined
 in include at ./boot.jl:261
 in include_from_node1 at ./loading.jl:320
 in include at ./boot.jl:261
 in include_from_node1 at ./loading.jl:320
 in require at ./loading.jl:259
while loading /home/nixo/.julia/v0.4/Gaston/src/gaston_types.jl, in expression starting on line 161
while loading /home/nixo/.julia/v0.4/Gaston/src/Gaston.jl, in expression starting on line 26

Gaston error on Pkg.update()

I did a Pkg.update() and I got this error with Gaston. I am running on julia master:

ERROR: Gaston has no versions compatible with your fixed requirements (e.g. julia version).
 in ReqsStruct at pkg/resolve.jl:107
 in resolve at pkg/resolve.jl:1205
 in _resolve at pkg.jl:265
 in anonymous at no file:541
 in cd at file.jl:26
 in cd_pkgdir at pkg.jl:34
 in update at pkg.jl:516

problem using Gaston under 0.5

I just downloaded the v0.5 julia binary. Gaston seems to load fine using `Pkg.add("Gaston"). It returns an error though if I use it.

julia> using Gaston
ERROR: LoadError: LoadError: UndefVarError: Range1 not defined
 in include_from_node1(::String) at ./loading.jl:488 (repeats 2 times)
 in eval(::Module, ::Any) at ./boot.jl:234
 in require(::Symbol) at ./loading.jl:415
while loading /home/***/.julia/v0.5/Gaston/src/gaston_types.jl, in expression starting on line 161
while loading /home/***/.julia/v0.5/Gaston/src/Gaston.jl, in expression starting on line 26

From the changelog, I can see that this is Gaston v0.5.5 that has been installed.
I think that Range1 was renamed UnitRange when v0.4 went stable. This looks ok on master.
So maybe the Gaston version packaged with julia should be upgraded?

problem with Range1 using Gaston

I just upgraded julia today from master [(ersion 0.4.0-dev+6093 (2015-07-20 07:55 UTC)) and Gaston using the package manager. I now get an error when I try to start Gaston.

  julia> using Gaston
  ERROR: LoadError: LoadError: UndefVarError: Range1 not defined
   in include at ./boot.jl:254
   in include_from_node1 at ./loading.jl:187
   in include at ./boot.jl:254
   in include_from_node1 at ./loading.jl:187
   in require at ./loading.jl:141
  while loading /home/mlr/.julia/v0.4/Gaston/src/gaston_types.jl, in expression starting on line 161
  while loading /home/mlr/.julia/v0.4/Gaston/src/Gaston.jl, in expression starting on line 26

I can see that the issue (Range1 is now UnitRange) is now fixed in master. Maybe it is possible to update the version in the package manager?

Missing documentation tracker

  • Fillsteps
  • Grid
  • Stderr interaction
  • Start docs with tutorials for common usage
  • Provide motivation for using gnuplot
  • Add note about letting gnuplot's installer add it to the system path on windows.
  • Clarify how to run the tests
  • Add reference documentation

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.