Commit Graph

355 Commits

Author SHA1 Message Date
Michal Sojka 799154f53c Add doctest of dumb terminal
This serves two purposes:

1. It demonstrates the functionality of the dumb terminal.
2. It checks that the previous commit works.
2021-12-05 11:53:30 +01:00
Michal Sojka d02c211e99 Don't run gnuplot process connected to stdout
This change fixes incompatibility of Gnuplot.jl with Documenter.jl
versions 0.27.0 and above. Without this change, Gnuplot.jl has at
least these problems:

1. When building Gnuplot.jl documentation, the process blocks and
   never finishes.

2. When using Gnuplot.jl in docstrings in other code, running
   `doctest` blocks and never finishes.

The reason is that Documenter uses a new version of IOCapture.jl,
which contains this commit:
https://github.com/JuliaDocs/IOCapture.jl/pull/9/commits/6cb4cdff34cd8f5d416bc4d0e36fe118e3f4d0bc.

Documenter evaluates code snippets from the documentation with
`stdout` redirected to a pipe to show the command's output. The
mentioned commit changes the behavior so that now capturing waits
until the pipe is closed. The problem with Gnuplot.jl is that when the
gnuplot process is started as a part of the execution of documentation
code snippet, its `stdout` is bound to Documenter's pipe. The pipe is
not closed until the gnuplot process exits, which does not happen
unless the code snippet calls `Gnuplot.quit` explicitly. Therefore
Documenter blocks indefinitely.

This can be demonstrated by storing the following code in `test.jl`

    module GnuplotDocTest
    """
    ```jldoctest; setup = :(using Gnuplot)
    julia> @gp rand(100)

    ```
    """
    test() = nothing
    end

    using Documenter
    doctest(pwd(), [GnuplotDocTest])

and running `julia test.jl`.

To fix this problem, we run the gnuplot process with stdout redirected
to a pipe and create an asynchronous task, which reads the gnuplot's
stdout and writes it to Julia's current stdout.

Correctness of this approach can be verified by running:

    using Gnuplot
    Gnuplot.options.term = "dumb"
    @gp "plot sin(x)"

Dumb terminal prints to stdout and the above command shows the graph
on Julia's stdout too. In the next commit, we add the above code as a
doctest.
2021-12-05 11:51:29 +01:00
gcalderone 04484adc22 Merge pull request #44 from wentasah/requires-jl
docs: Suggest using Requires.jl for automatic settings of package options
2021-05-25 16:04:11 +02:00
Michal Sojka 658e5f422c docs: Suggest using Requires.jl for automatic settings of package options
Using the @gnuplotrc macro for collecting user's preferred setup works
well, but it is a bit annoying when Julia needs to be restarted
often (e.g. due to crashes). Using Requires.jl allows the user to
forget about calling @gnuplotrc; the initialization happens
automatically, whenever the Gnuplot package is loaded.
2021-05-25 15:01:45 +02:00
Giorgio Calderone 9327492aa1 Updated 2021-05-06 00:14:01 +02:00
Giorgio Calderone 0567acc60e Bump version to 1.4.0 (to meet automerge guidelines) v1.4.0 2021-05-05 23:48:11 +02:00
Giorgio Calderone 74e195f290 Updated 2021-05-05 12:19:04 +02:00
Giorgio Calderone 875773fd3d Docs updated 2021-05-05 12:03:13 +02:00
Giorgio Calderone 53159f89e1 Bugfix; Allow missing as input to hist(); Updated version() 2021-05-05 11:59:15 +02:00
Giorgio Calderone 54db30cc32 Bump version 2021-05-05 00:58:14 +02:00
Giorgio Calderone 364e5281bd Merge branch 'master' of https://github.com/gcalderone/Gnuplot.jl 2021-05-05 00:53:09 +02:00
Giorgio Calderone e8a6b21df6 Updated dependencies; Accept missing values on input arrays (if eltype <: AbstractFloat) 2021-05-05 00:52:56 +02:00
gcalderone 6c6b889df6 Merge pull request #43 from wentasah/vscode
VS Code support
2021-04-08 17:40:36 +02:00
Giorgio Calderone 5c46e35fea Updated DataStructures dependency 2021-04-01 14:04:40 +02:00
Michal Sojka 34af493921 Make the figures in VS Code bigger
Without this change, the figures in VS Code are too small.
2021-03-30 20:11:05 +02:00
Michal Sojka f2ef5373b0 Show plots in internal VS Code plot pane
With this change, when Gnuplot.jl is used within VSCode, the plot
shows in VSCode plot pane instead of in a separate Gnuplot window.

Note that when compared to IJulia and Juno, we do not test for active
VS Code connection. I don't think it is necessary, but if it turns out
to be needed later, it can be done with

    isopen(VSCodeServer.conn_endpoint[])
2021-03-30 19:43:27 +02:00
Giorgio Calderone bc74aa0db4 Accept AbstractArrays which can be converted to actual arrays 2021-01-02 00:15:39 +01:00
Giorgio Calderone b7a15290d3 Bugfix 2020-10-06 10:21:46 +02:00
Giorgio Calderone f62b569560 Fix #28 and similar issues 2020-10-05 01:14:18 +02:00
gcalderone 584144e2ec Merge pull request #30 from PallHaraldsson/patch-1
Juno and Jypyther in docs
2020-10-05 00:00:36 +02:00
gcalderone 03953c0ad6 Merge pull request #35 from jarvist/master
Add check for Pluto.jl interactive notebook.
2020-10-04 23:55:14 +02:00
Jarvist Moore Frost 084dd63059 Add check for Pluto.jl interactive notebook. 2020-09-21 21:02:08 +01:00
Páll Haraldsson 50141d1b0e Juno and Jypyther in docs
[ci skip]
2020-07-13 11:38:23 +00:00
Giorgio Calderone 83c59ae682 Set utf8 encoding on gnuplot start 2020-05-05 11:44:08 +02:00
gcalderone 1877deef7f Merge pull request #26 from lyon-fnal/master
Fix the string indexing error and problems with multiplot on JupyterLab
2020-05-05 00:59:08 +02:00
Adam Lyon 67a5583c29 Fixes #25 2020-05-04 15:59:21 -05:00
Adam Lyon 69644f99ba Fix #24 2020-05-04 15:58:59 -05:00
Giorgio Calderone 2713f8517e Updated 2020-04-29 12:24:46 +02:00
Giorgio Calderone 2c2c74e448 Added dgrid3d function v1.3.0 2020-04-29 12:12:52 +02:00
Giorgio Calderone 6bf1b80058 Bump version (1.3.0) 2020-04-28 19:26:23 +02:00
Giorgio Calderone 671efccc17 Updated 2020-04-28 19:09:39 +02:00
Giorgio Calderone bdeb0e45ab Updated 2020-04-28 18:56:04 +02:00
Giorgio Calderone 3e03aa27f7 Updated 2020-04-28 18:50:40 +02:00
Giorgio Calderone dab424bfec Updated 2020-04-28 18:42:58 +02:00
Giorgio Calderone 92380bc468 Added smooth keyword to palette; Updated docstrings 2020-04-28 14:14:25 +02:00
Giorgio Calderone 4d1768e15e Added contourlines method accepting top fractions 2020-04-27 18:37:59 +02:00
Giorgio Calderone 8e140ee998 Updated 2020-04-25 20:52:19 +02:00
Giorgio Calderone 6df834bb88 Docs updated 2020-04-25 20:41:09 +02:00
Giorgio Calderone c9fa96c9eb Docs updated 2020-04-25 20:20:09 +02:00
Giorgio Calderone d74715f156 Fixed initialization in Juno 2020-04-25 19:28:57 +02:00
Giorgio Calderone 2fb581b3a3 Defined and implemented the display behaviour (based on options/gpviewer) 2020-04-25 18:37:17 +02:00
Giorgio Calderone 190562a322 Use AbstractVector and AbstractMatrix argument types in contourlines 2020-04-23 09:57:16 +02:00
Giorgio Calderone c5d64f5d76 Enable show mechanism, regardless of Juno/IJulia 2020-04-22 20:00:51 +02:00
Giorgio Calderone 184206946b Fix CI 2020-04-22 19:15:03 +02:00
Giorgio Calderone 4405daf088 Bugfix 2020-04-22 19:09:47 +02:00
Giorgio Calderone e3d9d6035e Fix CI 2020-04-22 18:26:47 +02:00
Giorgio Calderone e11d93d807 Fix CI 2020-04-22 18:17:23 +02:00
Giorgio Calderone 6996c98d40 Fix CI 2020-04-22 18:09:54 +02:00
Giorgio Calderone 02e15543cd Merge branch 'StdoutPassThrough' 2020-04-22 17:58:39 +02:00
Giorgio Calderone 8f737205a1 Improved readTask and capture protocol 2020-04-22 17:56:50 +02:00