├── .gitattributes ├── .github └── ISSUE_TEMPLATE.md ├── .gitignore ├── .paket ├── paket.bootstrapper.exe ├── paket.exe └── paket.targets ├── .travis.yml ├── FnuPlot.sln ├── LICENSE.md ├── README.md ├── RELEASE_NOTES.md ├── appveyor.yml ├── build.cmd ├── build.fsx ├── build.sh ├── docs ├── content │ ├── index.fsx │ ├── tutorial.fsx │ ├── worldbank.fsx │ └── worldbank.xml ├── files │ └── img │ │ ├── logo-template.pdn │ │ ├── logo.png │ │ ├── tutorial-1.png │ │ ├── tutorial-10.png │ │ ├── tutorial-2.png │ │ ├── tutorial-3.png │ │ ├── tutorial-4.png │ │ ├── tutorial-5.png │ │ ├── tutorial-6.png │ │ ├── tutorial-7.png │ │ ├── tutorial-8.png │ │ ├── tutorial-9.png │ │ └── worldbank.png └── tools │ ├── generate.fsx │ └── templates │ └── template.cshtml ├── nuget └── FnuPlot.nuspec ├── paket.dependencies ├── paket.lock ├── src └── FnuPlot │ ├── AssemblyInfo.fs │ ├── FnuPlot.fs │ ├── FnuPlot.fsproj │ └── paket.references └── tests └── FnuPlot.Tests ├── FnuPlot.Tests.fsproj ├── Tests.fs └── paket.references /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files 2 | * text=auto 3 | 4 | # Custom for Visual Studio 5 | *.cs diff=csharp text=auto eol=lf 6 | *.fs diff=csharp text=auto eol=lf 7 | *.fsi diff=csharp text=auto eol=lf 8 | *.fsx diff=csharp text=auto eol=lf 9 | *.sln text eol=crlf merge=union 10 | *.csproj merge=union 11 | *.vbproj merge=union 12 | *.fsproj merge=union 13 | *.dbproj merge=union 14 | 15 | # Standard to msysgit 16 | *.doc diff=astextplain 17 | *.DOC diff=astextplain 18 | *.docx diff=astextplain 19 | *.DOCX diff=astextplain 20 | *.dot diff=astextplain 21 | *.DOT diff=astextplain 22 | *.pdf diff=astextplain 23 | *.PDF diff=astextplain 24 | *.rtf diff=astextplain 25 | *.RTF diff=astextplain 26 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | ### Description 2 | 3 | Please provide a succinct description of your issue. 4 | 5 | ### Repro steps 6 | 7 | Please provide the steps required to reproduce the problem 8 | 9 | 1. Step A 10 | 11 | 2. Step B 12 | 13 | ### Expected behavior 14 | 15 | Please provide a description of the behavior you expect. 16 | 17 | ### Actual behavior 18 | 19 | Please provide a description of the actual behavior you observe. 20 | 21 | ### Known workarounds 22 | 23 | Please provide a description of any known workarounds. 24 | 25 | ### Related information 26 | 27 | * Operating system 28 | * Branch 29 | * .NET Runtime, CoreCLR or Mono Version 30 | * Performance information, links to performance testing scripts 31 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | 4 | # User-specific files 5 | *.suo 6 | *.user 7 | *.sln.docstates 8 | 9 | # Xamarin Studio / monodevelop user-specific 10 | *.userprefs 11 | 12 | # Build results 13 | 14 | [Dd]ebug/ 15 | [Rr]elease/ 16 | x64/ 17 | build/ 18 | [Bb]in/ 19 | [Oo]bj/ 20 | 21 | # Enable "build/" folder in the NuGet Packages folder since NuGet packages use it for MSBuild targets 22 | !packages/*/build/ 23 | 24 | # MSTest test Results 25 | [Tt]est[Rr]esult*/ 26 | [Bb]uild[Ll]og.* 27 | 28 | *_i.c 29 | *_p.c 30 | *.ilk 31 | *.meta 32 | *.obj 33 | *.pch 34 | *.pdb 35 | *.pgc 36 | *.pgd 37 | *.rsp 38 | *.sbr 39 | *.tlb 40 | *.tli 41 | *.tlh 42 | *.tmp 43 | *.tmp_proj 44 | *.log 45 | *.vspscc 46 | *.vssscc 47 | .builds 48 | *.pidb 49 | *.log 50 | *.scc 51 | 52 | # Visual C++ cache files 53 | ipch/ 54 | *.aps 55 | *.ncb 56 | *.opensdf 57 | *.sdf 58 | *.cachefile 59 | 60 | # Visual Studio profiler 61 | *.psess 62 | *.vsp 63 | *.vspx 64 | 65 | # Guidance Automation Toolkit 66 | *.gpState 67 | 68 | # ReSharper is a .NET coding add-in 69 | _ReSharper*/ 70 | *.[Rr]e[Ss]harper 71 | 72 | # TeamCity is a build add-in 73 | _TeamCity* 74 | 75 | # DotCover is a Code Coverage Tool 76 | *.dotCover 77 | 78 | # NCrunch 79 | *.ncrunch* 80 | .*crunch*.local.xml 81 | 82 | # Installshield output folder 83 | [Ee]xpress/ 84 | 85 | # DocProject is a documentation generator add-in 86 | DocProject/buildhelp/ 87 | DocProject/Help/*.HxT 88 | DocProject/Help/*.HxC 89 | DocProject/Help/*.hhc 90 | DocProject/Help/*.hhk 91 | DocProject/Help/*.hhp 92 | DocProject/Help/Html2 93 | DocProject/Help/html 94 | 95 | # Click-Once directory 96 | publish/ 97 | 98 | # Publish Web Output 99 | *.Publish.xml 100 | 101 | # Enable nuget.exe in the .nuget folder (though normally executables are not tracked) 102 | !.nuget/NuGet.exe 103 | 104 | # Windows Azure Build Output 105 | csx 106 | *.build.csdef 107 | 108 | # Windows Store app package directory 109 | AppPackages/ 110 | 111 | # Others 112 | sql/ 113 | *.Cache 114 | ClientBin/ 115 | [Ss]tyle[Cc]op.* 116 | ~$* 117 | *~ 118 | *.dbmdl 119 | *.[Pp]ublish.xml 120 | *.pfx 121 | *.publishsettings 122 | 123 | # RIA/Silverlight projects 124 | Generated_Code/ 125 | 126 | # Backup & report files from converting an old project file to a newer 127 | # Visual Studio version. Backup files are not needed, because we have git ;-) 128 | _UpgradeReport_Files/ 129 | Backup*/ 130 | UpgradeLog*.XML 131 | UpgradeLog*.htm 132 | 133 | # SQL Server files 134 | App_Data/*.mdf 135 | App_Data/*.ldf 136 | 137 | 138 | #LightSwitch generated files 139 | GeneratedArtifacts/ 140 | _Pvt_Extensions/ 141 | ModelManifest.xml 142 | 143 | # ========================= 144 | # Windows detritus 145 | # ========================= 146 | 147 | # Windows image file caches 148 | Thumbs.db 149 | ehthumbs.db 150 | 151 | # Folder config file 152 | Desktop.ini 153 | 154 | # Recycle Bin used on file shares 155 | $RECYCLE.BIN/ 156 | 157 | # Mac desktop service store files 158 | .DS_Store 159 | 160 | # =================================================== 161 | # Exclude F# project specific directories and files 162 | # =================================================== 163 | 164 | # NuGet Packages Directory 165 | packages/ 166 | 167 | # Generated documentation folder 168 | docs/output/ 169 | 170 | # Temp folder used for publishing docs 171 | temp/ 172 | 173 | # Test results produced by build 174 | TestResults.xml 175 | 176 | # Nuget outputs 177 | nuget/*.nupkg 178 | release.cmd 179 | release.sh 180 | localpackages/ 181 | paket-files 182 | *.orig 183 | .paket/paket.exe 184 | docs/content/license.md 185 | docs/content/release-notes.md 186 | -------------------------------------------------------------------------------- /.paket/paket.bootstrapper.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fsprojects/FnuPlot/07c130d385a0a27e7f560574a926f768c15b4feb/.paket/paket.bootstrapper.exe -------------------------------------------------------------------------------- /.paket/paket.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fsprojects/FnuPlot/07c130d385a0a27e7f560574a926f768c15b4feb/.paket/paket.exe -------------------------------------------------------------------------------- /.paket/paket.targets: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | true 6 | 7 | true 8 | $(MSBuildThisFileDirectory) 9 | $(MSBuildThisFileDirectory)..\ 10 | 11 | 12 | 13 | $(PaketToolsPath)paket.exe 14 | $(PaketToolsPath)paket.bootstrapper.exe 15 | "$(PaketExePath)" 16 | mono --runtime=v4.0.30319 $(PaketExePath) 17 | "$(PaketBootStrapperExePath)" 18 | mono --runtime=v4.0.30319 $(PaketBootStrapperExePath) 19 | 20 | $(PaketCommand) restore 21 | $(PaketBootStrapperCommand) 22 | 23 | RestorePackages; $(BuildDependsOn); 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: csharp 2 | sudo: required 3 | dist: trusty 4 | dotnet : 2.1.4 5 | 6 | mono: 7 | - 5.0.1 8 | 9 | script: 10 | - ./build.sh All 11 | -------------------------------------------------------------------------------- /FnuPlot.sln: -------------------------------------------------------------------------------- 1 | Microsoft Visual Studio Solution File, Format Version 12.00 2 | # Visual Studio 2013 3 | VisualStudioVersion = 12.0.21005.1 4 | MinimumVisualStudioVersion = 10.0.40219.1 5 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".paket", ".paket", "{63297B98-5CED-492C-A5B7-A5B4F73CF142}" 6 | ProjectSection(SolutionItems) = preProject 7 | paket.dependencies = paket.dependencies 8 | paket.lock = paket.lock 9 | EndProjectSection 10 | EndProject 11 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "docs", "docs", "{A6A6AF7D-D6E3-442D-9B1E-58CC91879BE1}" 12 | EndProject 13 | Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "FnuPlot", "src\FnuPlot\FnuPlot.fsproj", "{7E90D6CE-A10B-4858-A5BC-41DF7250CBCA}" 14 | EndProject 15 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "project", "project", "{BF60BC93-E09B-4E5F-9D85-95A519479D54}" 16 | ProjectSection(SolutionItems) = preProject 17 | build.fsx = build.fsx 18 | nuget\FnuPlot.nuspec = nuget\FnuPlot.nuspec 19 | README.md = README.md 20 | RELEASE_NOTES.md = RELEASE_NOTES.md 21 | EndProjectSection 22 | EndProject 23 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tools", "tools", "{83F16175-43B1-4C90-A1EE-8E351C33435D}" 24 | ProjectSection(SolutionItems) = preProject 25 | docs\tools\generate.fsx = docs\tools\generate.fsx 26 | docs\tools\templates\template.cshtml = docs\tools\templates\template.cshtml 27 | EndProjectSection 28 | EndProject 29 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "content", "content", "{8E6D5255-776D-4B61-85F9-73C37AA1FB9A}" 30 | ProjectSection(SolutionItems) = preProject 31 | docs\content\index.fsx = docs\content\index.fsx 32 | docs\content\tutorial.fsx = docs\content\tutorial.fsx 33 | docs\content\worldbank.fsx = docs\content\worldbank.fsx 34 | EndProjectSection 35 | EndProject 36 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{ED8079DD-2B06-4030-9F0F-DC548F98E1C4}" 37 | EndProject 38 | Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "FnuPlot.Tests", "tests\FnuPlot.Tests\FnuPlot.Tests.fsproj", "{E789C72A-5CFD-436B-8EF1-61AA2852A89F}" 39 | EndProject 40 | Global 41 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 42 | Debug|Any CPU = Debug|Any CPU 43 | Release|Any CPU = Release|Any CPU 44 | EndGlobalSection 45 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 46 | {7E90D6CE-A10B-4858-A5BC-41DF7250CBCA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 47 | {7E90D6CE-A10B-4858-A5BC-41DF7250CBCA}.Debug|Any CPU.Build.0 = Debug|Any CPU 48 | {7E90D6CE-A10B-4858-A5BC-41DF7250CBCA}.Release|Any CPU.ActiveCfg = Release|Any CPU 49 | {7E90D6CE-A10B-4858-A5BC-41DF7250CBCA}.Release|Any CPU.Build.0 = Release|Any CPU 50 | {E789C72A-5CFD-436B-8EF1-61AA2852A89F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 51 | {E789C72A-5CFD-436B-8EF1-61AA2852A89F}.Debug|Any CPU.Build.0 = Debug|Any CPU 52 | {E789C72A-5CFD-436B-8EF1-61AA2852A89F}.Release|Any CPU.ActiveCfg = Release|Any CPU 53 | {E789C72A-5CFD-436B-8EF1-61AA2852A89F}.Release|Any CPU.Build.0 = Release|Any CPU 54 | EndGlobalSection 55 | GlobalSection(SolutionProperties) = preSolution 56 | HideSolutionNode = FALSE 57 | EndGlobalSection 58 | GlobalSection(NestedProjects) = preSolution 59 | {83F16175-43B1-4C90-A1EE-8E351C33435D} = {A6A6AF7D-D6E3-442D-9B1E-58CC91879BE1} 60 | {8E6D5255-776D-4B61-85F9-73C37AA1FB9A} = {A6A6AF7D-D6E3-442D-9B1E-58CC91879BE1} 61 | {E789C72A-5CFD-436B-8EF1-61AA2852A89F} = {ED8079DD-2B06-4030-9F0F-DC548F98E1C4} 62 | EndGlobalSection 63 | EndGlobal 64 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | Copyright 2011-2014, Tomas Petricek and contributors 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | 15 | ------------------------------------------------------------ 16 | 17 | Apache License, Version 2.0 18 | =========================== 19 | 20 | Apache License 21 | Version 2.0, January 2004 22 | http://www.apache.org/licenses/ 23 | 24 | ### TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 25 | 26 | 27 | **1. Definitions.** 28 | 29 | - "License" shall mean the terms and conditions for use, reproduction, 30 | and distribution as defined by Sections 1 through 9 of this document. 31 | 32 | - "Licensor" shall mean the copyright owner or entity authorized by 33 | the copyright owner that is granting the License. 34 | 35 | - "Legal Entity" shall mean the union of the acting entity and all 36 | other entities that control, are controlled by, or are under common 37 | control with that entity. For the purposes of this definition, 38 | "control" means (i) the power, direct or indirect, to cause the 39 | direction or management of such entity, whether by contract or 40 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 41 | outstanding shares, or (iii) beneficial ownership of such entity. 42 | 43 | - "You" (or "Your") shall mean an individual or Legal Entity 44 | exercising permissions granted by this License. 45 | 46 | - "Source" form shall mean the preferred form for making modifications, 47 | including but not limited to software source code, documentation 48 | source, and configuration files. 49 | 50 | - "Object" form shall mean any form resulting from mechanical 51 | transformation or translation of a Source form, including but 52 | not limited to compiled object code, generated documentation, 53 | and conversions to other media types. 54 | 55 | - "Work" shall mean the work of authorship, whether in Source or 56 | Object form, made available under the License, as indicated by a 57 | copyright notice that is included in or attached to the work 58 | (an example is provided in the Appendix below). 59 | 60 | - "Derivative Works" shall mean any work, whether in Source or Object 61 | form, that is based on (or derived from) the Work and for which the 62 | editorial revisions, annotations, elaborations, or other modifications 63 | represent, as a whole, an original work of authorship. For the purposes 64 | of this License, Derivative Works shall not include works that remain 65 | separable from, or merely link (or bind by name) to the interfaces of, 66 | the Work and Derivative Works thereof. 67 | 68 | - "Contribution" shall mean any work of authorship, including 69 | the original version of the Work and any modifications or additions 70 | to that Work or Derivative Works thereof, that is intentionally 71 | submitted to Licensor for inclusion in the Work by the copyright owner 72 | or by an individual or Legal Entity authorized to submit on behalf of 73 | the copyright owner. For the purposes of this definition, "submitted" 74 | means any form of electronic, verbal, or written communication sent 75 | to the Licensor or its representatives, including but not limited to 76 | communication on electronic mailing lists, source code control systems, 77 | and issue tracking systems that are managed by, or on behalf of, the 78 | Licensor for the purpose of discussing and improving the Work, but 79 | excluding communication that is conspicuously marked or otherwise 80 | designated in writing by the copyright owner as "Not a Contribution." 81 | 82 | - "Contributor" shall mean Licensor and any individual or Legal Entity 83 | on behalf of whom a Contribution has been received by Licensor and 84 | subsequently incorporated within the Work. 85 | 86 | **2. Grant of Copyright License.** 87 | Subject to the terms and conditions of 88 | this License, each Contributor hereby grants to You a perpetual, 89 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 90 | copyright license to reproduce, prepare Derivative Works of, 91 | publicly display, publicly perform, sublicense, and distribute the 92 | Work and such Derivative Works in Source or Object form. 93 | 94 | **3. Grant of Patent License.** 95 | Subject to the terms and conditions of 96 | this License, each Contributor hereby grants to You a perpetual, 97 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 98 | (except as stated in this section) patent license to make, have made, 99 | use, offer to sell, sell, import, and otherwise transfer the Work, 100 | where such license applies only to those patent claims licensable 101 | by such Contributor that are necessarily infringed by their 102 | Contribution(s) alone or by combination of their Contribution(s) 103 | with the Work to which such Contribution(s) was submitted. If You 104 | institute patent litigation against any entity (including a 105 | cross-claim or counterclaim in a lawsuit) alleging that the Work 106 | or a Contribution incorporated within the Work constitutes direct 107 | or contributory patent infringement, then any patent licenses 108 | granted to You under this License for that Work shall terminate 109 | as of the date such litigation is filed. 110 | 111 | **4. Redistribution.** 112 | You may reproduce and distribute copies of the 113 | Work or Derivative Works thereof in any medium, with or without 114 | modifications, and in Source or Object form, provided that You 115 | meet the following conditions: 116 | 117 | - You must give any other recipients of the Work or 118 | Derivative Works a copy of this License; and 119 | 120 | - You must cause any modified files to carry prominent notices 121 | stating that You changed the files; and 122 | 123 | - You must retain, in the Source form of any Derivative Works 124 | that You distribute, all copyright, patent, trademark, and 125 | attribution notices from the Source form of the Work, 126 | excluding those notices that do not pertain to any part of 127 | the Derivative Works; and 128 | 129 | - If the Work includes a "NOTICE" text file as part of its 130 | distribution, then any Derivative Works that You distribute must 131 | include a readable copy of the attribution notices contained 132 | within such NOTICE file, excluding those notices that do not 133 | pertain to any part of the Derivative Works, in at least one 134 | of the following places: within a NOTICE text file distributed 135 | as part of the Derivative Works; within the Source form or 136 | documentation, if provided along with the Derivative Works; or, 137 | within a display generated by the Derivative Works, if and 138 | wherever such third-party notices normally appear. The contents 139 | of the NOTICE file are for informational purposes only and 140 | do not modify the License. You may add Your own attribution 141 | notices within Derivative Works that You distribute, alongside 142 | or as an addendum to the NOTICE text from the Work, provided 143 | that such additional attribution notices cannot be construed 144 | as modifying the License. 145 | 146 | You may add Your own copyright statement to Your modifications and 147 | may provide additional or different license terms and conditions 148 | for use, reproduction, or distribution of Your modifications, or 149 | for any such Derivative Works as a whole, provided Your use, 150 | reproduction, and distribution of the Work otherwise complies with 151 | the conditions stated in this License. 152 | 153 | **5. Submission of Contributions.** 154 | Unless You explicitly state otherwise, 155 | any Contribution intentionally submitted for inclusion in the Work 156 | by You to the Licensor shall be under the terms and conditions of 157 | this License, without any additional terms or conditions. 158 | Notwithstanding the above, nothing herein shall supersede or modify 159 | the terms of any separate license agreement you may have executed 160 | with Licensor regarding such Contributions. 161 | 162 | **6. Trademarks.** 163 | This License does not grant permission to use the trade 164 | names, trademarks, service marks, or product names of the Licensor, 165 | except as required for reasonable and customary use in describing the 166 | origin of the Work and reproducing the content of the NOTICE file. 167 | 168 | **7. Disclaimer of Warranty.** 169 | Unless required by applicable law or 170 | agreed to in writing, Licensor provides the Work (and each 171 | Contributor provides its Contributions) on an "AS IS" BASIS, 172 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 173 | implied, including, without limitation, any warranties or conditions 174 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 175 | PARTICULAR PURPOSE. You are solely responsible for determining the 176 | appropriateness of using or redistributing the Work and assume any 177 | risks associated with Your exercise of permissions under this License. 178 | 179 | **8. Limitation of Liability.** 180 | In no event and under no legal theory, 181 | whether in tort (including negligence), contract, or otherwise, 182 | unless required by applicable law (such as deliberate and grossly 183 | negligent acts) or agreed to in writing, shall any Contributor be 184 | liable to You for damages, including any direct, indirect, special, 185 | incidental, or consequential damages of any character arising as a 186 | result of this License or out of the use or inability to use the 187 | Work (including but not limited to damages for loss of goodwill, 188 | work stoppage, computer failure or malfunction, or any and all 189 | other commercial damages or losses), even if such Contributor 190 | has been advised of the possibility of such damages. 191 | 192 | **9. Accepting Warranty or Additional Liability.** 193 | While redistributing 194 | the Work or Derivative Works thereof, You may choose to offer, 195 | and charge a fee for, acceptance of support, warranty, indemnity, 196 | or other liability obligations and/or rights consistent with this 197 | License. However, in accepting such obligations, You may act only 198 | on Your own behalf and on Your sole responsibility, not on behalf 199 | of any other Contributor, and only if You agree to indemnify, 200 | defend, and hold each Contributor harmless for any liability 201 | incurred by, or claims asserted against, such Contributor by reason 202 | of your accepting any such warranty or additional liability. 203 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | *Note: I am no longer maintaining this project or using F#. If someone out there would like take over maintaining it, let me know. -Luke* 2 | 3 | Lightweight F# wrapper for gnuplot 4 | =================================== 5 | 6 | FnuPlot is a lightweight wrapper for the [gnuplot](http://www.gnuplot.info/) charting and 7 | visualization library. Since gnuplot is cross-platform (works on Mac, Linux and Windows), 8 | you can use Fnuplot on all of those platforms. 9 | 10 | FnuPlot provides two features on top of gnuplot. First, it hides the gnuplot process, so you 11 | do not have to start and control the process; you can use the `GnuPlot` type and call it using 12 | `SendCommand`. Second, FnuPlot implements a simple domain-specific language for building a 13 | number of common chart types. 14 | 15 | [![Build Status](https://travis-ci.org/fsprojects/FnuPlot.png?branch=master)](https://travis-ci.org/fsprojects/FnuPlot) 16 | [![NuGet Status](http://img.shields.io/nuget/v/FnuPlot.svg?style=flat)](https://www.nuget.org/packages/FnuPlot/) 17 | [![Issue Stats](http://issuestats.com/github/fsprojects/FnuPlot/badge/issue)](http://issuestats.com/github/fsprojects/FnuPlot) 18 | [![Issue Stats](http://issuestats.com/github/fsprojects/FnuPlot/badge/pr)](http://issuestats.com/github/fsprojects/FnuPlot) 19 | 20 | More information 21 | ---------------- 22 | 23 | * See the [Getting started tutorial](http://fsprojects.github.io/FnuPlot/tutorial.html) for usage examples. 24 | 25 | * [API Reference](http://fsprojects.github.io/FnuPlot/reference/index.html) contains automatically generated documentation for all types, modules and functions in the library. This includes additional brief samples on using most of the functions. 26 | 27 | 28 | Maintainer(s) 29 | ---------------- 30 | 31 | - [@LukeAllen](https://github.com/LukeAllen) 32 | - [@tpetricek](https://github.com/tpetricek) 33 | 34 | The default maintainer account for projects under "fsprojects" is [@fsprojectsgit](https://github.com/fsprojectsgit) - F# Community Project Incubation Space (repo management) 35 | -------------------------------------------------------------------------------- /RELEASE_NOTES.md: -------------------------------------------------------------------------------- 1 | #### 0.1.1-beta - February 20, 2015 2 | * Bug fix for mono (suppresses a meaningless error when calling Dispose()) 3 | 4 | #### 0.1.0-beta - February 4, 2015 5 | * Replaced Series.Lines, Series.XY, Series.TimeY, and Series.Function with a single overloaded Series.Lines which accepts any of the above data types. **Important note:** This will break code which used the old constructors. To fix your legacy code, simply replace all usages of the above constructors with Series.Lines 6 | * Added Series.Points and Series.Impulses constructors. These work exactly like Series.Lines, but instead of plotting a continuous line they plot the datapoints as isolated points or isolated thin bars, respectively. 7 | 8 | #### 0.0.5-beta - December 22, 2014 9 | * Adding more documentation, minor code refactoring 10 | 11 | #### 0.0.4-beta - December 18, 2014 12 | * Adding tutorial content 13 | 14 | #### 0.0.3-beta - December 16, 2014 15 | * Publish documentation 16 | 17 | #### 0.0.2-beta - December 16, 2014 18 | * Fixing remaining build issues and releasing 19 | 20 | #### 0.0.1-beta - December 16, 2014 21 | * Using project scaffold and initial NuGet release 22 | -------------------------------------------------------------------------------- /appveyor.yml: -------------------------------------------------------------------------------- 1 | init: 2 | - git config --global core.autocrlf input 3 | build_script: 4 | - cmd: build.cmd 5 | test: off 6 | version: 0.0.1.{build} 7 | artifacts: 8 | - path: bin 9 | name: bin 10 | -------------------------------------------------------------------------------- /build.cmd: -------------------------------------------------------------------------------- 1 | @echo off 2 | cls 3 | 4 | .paket\paket.bootstrapper.exe 5 | if errorlevel 1 ( 6 | exit /b %errorlevel% 7 | ) 8 | 9 | .paket\paket.exe restore 10 | if errorlevel 1 ( 11 | exit /b %errorlevel% 12 | ) 13 | 14 | IF NOT EXIST build.fsx ( 15 | .paket\paket.exe update 16 | packages\FAKE\tools\FAKE.exe init.fsx 17 | ) 18 | packages\FAKE\tools\FAKE.exe build.fsx %* 19 | -------------------------------------------------------------------------------- /build.fsx: -------------------------------------------------------------------------------- 1 | // -------------------------------------------------------------------------------------- 2 | // FAKE build script 3 | // -------------------------------------------------------------------------------------- 4 | 5 | #r @"packages/FAKE/tools/FakeLib.dll" 6 | 7 | open Fake 8 | open Fake.Git 9 | open Fake.AssemblyInfoFile 10 | open Fake.ReleaseNotesHelper 11 | open Fake.Testing.NUnit3 12 | open System 13 | open System.IO 14 | #if MONO 15 | #else 16 | #load "packages/SourceLink.Fake/tools/Fake.fsx" 17 | open SourceLink 18 | #endif 19 | 20 | // -------------------------------------------------------------------------------------- 21 | // START TODO: Provide project-specific details below 22 | // -------------------------------------------------------------------------------------- 23 | 24 | // Information about the project are used 25 | // - for version and project name in generated AssemblyInfo file 26 | // - by the generated NuGet package 27 | // - to run tests and to publish documentation on GitHub gh-pages 28 | // - for documentation, you also need to edit info in "docs/tools/generate.fsx" 29 | 30 | // The name of the project 31 | // (used by attributes in AssemblyInfo, name of a NuGet package and directory in 'src') 32 | let project = "FnuPlot" 33 | 34 | // Short summary of the project 35 | // (used as description in AssemblyInfo and as a short summary for NuGet package) 36 | let summary = "An F# wrapper for the gnuplot charting library" 37 | 38 | // Longer description of the project 39 | // (used as a description for NuGet package; line breaks are automatically cleaned up) 40 | let description = "FnuPlot is a simple F# wrapper for the gnuplot charting library. It is cross-platform (Mac, Linux and Windows) and lets you create publication-quality charts" 41 | 42 | // List of author names (for NuGet package) 43 | let authors = [ "Tomas Petricek" ] 44 | 45 | // Tags for your project (for NuGet package) 46 | let tags = "gnuplot fsharp f# charting chart" 47 | 48 | // File system information 49 | let solutionFile = "FnuPlot.sln" 50 | 51 | // Pattern specifying assemblies to be tested using NUnit 52 | let testAssemblies = "tests/**/bin/Release/*Tests*.dll" 53 | 54 | // Git configuration (used for publishing documentation in gh-pages branch) 55 | // The profile where the project is posted 56 | let gitOwner = "fsprojects" 57 | let gitHome = "https://github.com/" + gitOwner 58 | 59 | // The name of the project on GitHub 60 | let gitName = "FnuPlot" 61 | 62 | // The url for the raw files hosted 63 | let gitRaw = environVarOrDefault "gitRaw" "https://raw.github.com/fsprojects" 64 | 65 | // -------------------------------------------------------------------------------------- 66 | // END TODO: The rest of the file includes standard build steps 67 | // -------------------------------------------------------------------------------------- 68 | 69 | // Read additional information from the release notes document 70 | let release = LoadReleaseNotes "RELEASE_NOTES.md" 71 | 72 | let genFSAssemblyInfo (projectPath) = 73 | let projectName = System.IO.Path.GetFileNameWithoutExtension(projectPath) 74 | let basePath = "src/" + projectName 75 | let fileName = basePath + "/AssemblyInfo.fs" 76 | CreateFSharpAssemblyInfo fileName 77 | [ Attribute.Title (projectName) 78 | Attribute.Product project 79 | Attribute.Description summary 80 | Attribute.Version release.AssemblyVersion 81 | Attribute.FileVersion release.AssemblyVersion ] 82 | 83 | let genCSAssemblyInfo (projectPath) = 84 | let projectName = System.IO.Path.GetFileNameWithoutExtension(projectPath) 85 | let basePath = "src/" + projectName + "/Properties" 86 | let fileName = basePath + "/AssemblyInfo.cs" 87 | CreateCSharpAssemblyInfo fileName 88 | [ Attribute.Title (projectName) 89 | Attribute.Product project 90 | Attribute.Description summary 91 | Attribute.Version release.AssemblyVersion 92 | Attribute.FileVersion release.AssemblyVersion ] 93 | 94 | // Generate assembly info files with the right version & up-to-date information 95 | Target "AssemblyInfo" (fun _ -> 96 | let fsProjs = !! "src/**/*.fsproj" 97 | let csProjs = !! "src/**/*.csproj" 98 | fsProjs |> Seq.iter genFSAssemblyInfo 99 | csProjs |> Seq.iter genCSAssemblyInfo 100 | ) 101 | 102 | // -------------------------------------------------------------------------------------- 103 | // Clean build results 104 | 105 | Target "Clean" (fun _ -> 106 | CleanDirs ["bin"; "temp"] 107 | ) 108 | 109 | Target "CleanDocs" (fun _ -> 110 | CleanDirs ["docs/output"] 111 | ) 112 | 113 | // -------------------------------------------------------------------------------------- 114 | // Build library & test project 115 | 116 | Target "Build" (fun _ -> 117 | !! solutionFile 118 | |> MSBuildRelease "" "Rebuild" 119 | |> ignore 120 | ) 121 | 122 | // -------------------------------------------------------------------------------------- 123 | // Run the unit tests using test runner 124 | 125 | Target "RunTests" (fun _ -> 126 | !! testAssemblies 127 | |> NUnit3 (fun p -> 128 | { p with 129 | TimeOut = TimeSpan.FromMinutes 20. }) 130 | ) 131 | 132 | #if MONO 133 | #else 134 | // -------------------------------------------------------------------------------------- 135 | // SourceLink allows Source Indexing on the PDB generated by the compiler, this allows 136 | // the ability to step through the source code of external libraries https://github.com/ctaggart/SourceLink 137 | 138 | Target "SourceLink" (fun _ -> 139 | let baseUrl = sprintf "%s/%s/{0}/%%var2%%" gitRaw (project.ToLower()) 140 | use repo = new GitRepo(__SOURCE_DIRECTORY__) 141 | !! "src/**/*.fsproj" 142 | |> Seq.iter (fun f -> 143 | let proj = VsProj.LoadRelease f 144 | logfn "source linking %s" proj.OutputFilePdb 145 | let files = proj.Compiles -- "**/AssemblyInfo.fs" 146 | repo.VerifyChecksums files 147 | proj.VerifyPdbChecksums files 148 | proj.CreateSrcSrv baseUrl repo.Revision (repo.Paths files) 149 | Pdbstr.exec proj.OutputFilePdb proj.OutputFilePdbSrcSrv 150 | ) 151 | ) 152 | #endif 153 | 154 | // -------------------------------------------------------------------------------------- 155 | // Build a NuGet package 156 | 157 | Target "NuGet" (fun _ -> 158 | NuGet (fun p -> 159 | { p with 160 | Authors = authors 161 | Project = project 162 | Summary = summary 163 | Description = description 164 | Version = release.NugetVersion 165 | ReleaseNotes = String.Join(Environment.NewLine, release.Notes) 166 | Tags = tags 167 | OutputPath = "bin" 168 | AccessKey = getBuildParamOrDefault "nugetkey" "" 169 | Publish = hasBuildParam "nugetkey" 170 | Dependencies = [] }) 171 | ("nuget/" + project + ".nuspec") 172 | ) 173 | 174 | // -------------------------------------------------------------------------------------- 175 | // Generate the documentation 176 | 177 | Target "GenerateReferenceDocs" (fun _ -> 178 | if not <| executeFSIWithArgs "docs/tools" "generate.fsx" ["--define:RELEASE"; "--define:REFERENCE"] [] then 179 | failwith "generating reference documentation failed" 180 | ) 181 | 182 | let generateHelp' fail debug = 183 | let args = 184 | if debug then ["--define:HELP"] 185 | else ["--define:RELEASE"; "--define:HELP"] 186 | if executeFSIWithArgs "docs/tools" "generate.fsx" args [] then 187 | traceImportant "Help generated" 188 | else 189 | if fail then 190 | failwith "generating help documentation failed" 191 | else 192 | traceImportant "generating help documentation failed" 193 | 194 | let generateHelp fail = 195 | generateHelp' fail false 196 | 197 | Target "GenerateHelp" (fun _ -> 198 | DeleteFile "docs/content/release-notes.md" 199 | CopyFile "docs/content/" "RELEASE_NOTES.md" 200 | Rename "docs/content/release-notes.md" "docs/content/RELEASE_NOTES.md" 201 | 202 | DeleteFile "docs/content/license.md" 203 | CopyFile "docs/content/" "LICENSE.md" 204 | 205 | generateHelp true 206 | ) 207 | 208 | Target "GenerateHelpDebug" (fun _ -> 209 | DeleteFile "docs/content/release-notes.md" 210 | CopyFile "docs/content/" "RELEASE_NOTES.md" 211 | Rename "docs/content/release-notes.md" "docs/content/RELEASE_NOTES.md" 212 | 213 | DeleteFile "docs/content/license.md" 214 | CopyFile "docs/content/" "LICENSE.txt" 215 | Rename "docs/content/license.md" "docs/content/LICENSE.txt" 216 | 217 | generateHelp' true true 218 | ) 219 | 220 | Target "KeepRunning" (fun _ -> 221 | use watcher = new FileSystemWatcher(DirectoryInfo("docs/content").FullName,"*.*") 222 | watcher.EnableRaisingEvents <- true 223 | watcher.Changed.Add(fun e -> generateHelp false) 224 | watcher.Created.Add(fun e -> generateHelp false) 225 | watcher.Renamed.Add(fun e -> generateHelp false) 226 | watcher.Deleted.Add(fun e -> generateHelp false) 227 | 228 | traceImportant "Waiting for help edits. Press any key to stop." 229 | 230 | System.Console.ReadKey() |> ignore 231 | 232 | watcher.EnableRaisingEvents <- false 233 | watcher.Dispose() 234 | ) 235 | 236 | Target "GenerateDocs" DoNothing 237 | 238 | let createIndexFsx lang = 239 | let content = """(*** hide ***) 240 | // This block of code is omitted in the generated HTML documentation. Use 241 | // it to define helpers that you do not want to show in the documentation. 242 | #I "../../../bin" 243 | 244 | (** 245 | F# Project Scaffold ({0}) 246 | ========================= 247 | *) 248 | """ 249 | let targetDir = "docs/content" @@ lang 250 | let targetFile = targetDir @@ "index.fsx" 251 | ensureDirectory targetDir 252 | System.IO.File.WriteAllText(targetFile, System.String.Format(content, lang)) 253 | 254 | Target "AddLangDocs" (fun _ -> 255 | let args = System.Environment.GetCommandLineArgs() 256 | if args.Length < 4 then 257 | failwith "Language not specified." 258 | 259 | args.[3..] 260 | |> Seq.iter (fun lang -> 261 | if lang.Length <> 2 && lang.Length <> 3 then 262 | failwithf "Language must be 2 or 3 characters (ex. 'de', 'fr', 'ja', 'gsw', etc.): %s" lang 263 | 264 | let templateFileName = "template.cshtml" 265 | let templateDir = "docs/tools/templates" 266 | let langTemplateDir = templateDir @@ lang 267 | let langTemplateFileName = langTemplateDir @@ templateFileName 268 | 269 | if System.IO.File.Exists(langTemplateFileName) then 270 | failwithf "Documents for specified language '%s' have already been added." lang 271 | 272 | ensureDirectory langTemplateDir 273 | Copy langTemplateDir [ templateDir @@ templateFileName ] 274 | 275 | createIndexFsx lang) 276 | ) 277 | 278 | // -------------------------------------------------------------------------------------- 279 | // Release Scripts 280 | 281 | Target "ReleaseDocs" (fun _ -> 282 | let tempDocsDir = "temp/gh-pages" 283 | CleanDir tempDocsDir 284 | Repository.cloneSingleBranch "" (gitHome + "/" + gitName + ".git") "gh-pages" tempDocsDir 285 | 286 | fullclean tempDocsDir 287 | CopyRecursive "docs/output" tempDocsDir true |> tracefn "%A" 288 | StageAll tempDocsDir 289 | Git.Commit.Commit tempDocsDir (sprintf "Update generated documentation for version %s" release.NugetVersion) 290 | Branches.push tempDocsDir 291 | ) 292 | 293 | #load "paket-files/fsharp/FAKE/modules/Octokit/Octokit.fsx" 294 | open Octokit 295 | 296 | Target "Release" (fun _ -> 297 | StageAll "" 298 | Git.Commit.Commit "" (sprintf "Bump version to %s" release.NugetVersion) 299 | Branches.push "" 300 | 301 | Branches.tag "" release.NugetVersion 302 | Branches.pushTag "" "origin" release.NugetVersion 303 | 304 | // release on github 305 | // createClient (getBuildParamOrDefault "github-user" "") (getBuildParamOrDefault "github-pw" "") 306 | // |> createDraft gitOwner gitName release.NugetVersion (release.SemVer.PreRelease <> None) release.Notes 307 | // TODO: |> uploadFile "PATH_TO_FILE" 308 | // |> releaseDraft 309 | // |> Async.RunSynchronously 310 | ) 311 | 312 | Target "BuildPackage" DoNothing 313 | 314 | // -------------------------------------------------------------------------------------- 315 | // Run all targets by default. Invoke 'build ' to override 316 | 317 | Target "All" DoNothing 318 | 319 | "Clean" 320 | ==> "AssemblyInfo" 321 | ==> "Build" 322 | ==> "RunTests" 323 | =?> ("GenerateReferenceDocs",isLocalBuild && not isMono) 324 | =?> ("GenerateDocs",isLocalBuild && not isMono) 325 | ==> "All" 326 | =?> ("ReleaseDocs",isLocalBuild && not isMono) 327 | 328 | "All" 329 | #if MONO 330 | #else 331 | =?> ("SourceLink", Pdbstr.tryFind().IsSome ) 332 | #endif 333 | ==> "NuGet" 334 | ==> "BuildPackage" 335 | 336 | "CleanDocs" 337 | ==> "GenerateHelp" 338 | ==> "GenerateReferenceDocs" 339 | ==> "GenerateDocs" 340 | 341 | "CleanDocs" 342 | ==> "GenerateHelpDebug" 343 | 344 | "GenerateHelp" 345 | ==> "KeepRunning" 346 | 347 | "ReleaseDocs" 348 | ==> "Release" 349 | 350 | "BuildPackage" 351 | ==> "Release" 352 | 353 | RunTargetOrDefault "All" 354 | -------------------------------------------------------------------------------- /build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | if test "$OS" = "Windows_NT" 3 | then 4 | # use .Net 5 | 6 | .paket/paket.bootstrapper.exe 7 | exit_code=$? 8 | if [ $exit_code -ne 0 ]; then 9 | exit $exit_code 10 | fi 11 | 12 | .paket/paket.exe restore 13 | exit_code=$? 14 | if [ $exit_code -ne 0 ]; then 15 | exit $exit_code 16 | fi 17 | 18 | [ ! -e build.fsx ] && .paket/paket.exe update 19 | [ ! -e build.fsx ] && packages/FAKE/tools/FAKE.exe init.fsx 20 | packages/FAKE/tools/FAKE.exe $@ --fsiargs -d:MONO build.fsx 21 | else 22 | # use mono 23 | mono .paket/paket.bootstrapper.exe 24 | exit_code=$? 25 | if [ $exit_code -ne 0 ]; then 26 | exit $exit_code 27 | fi 28 | 29 | mono .paket/paket.exe restore 30 | exit_code=$? 31 | if [ $exit_code -ne 0 ]; then 32 | exit $exit_code 33 | fi 34 | 35 | [ ! -e build.fsx ] && mono .paket/paket.exe update 36 | [ ! -e build.fsx ] && mono packages/FAKE/tools/FAKE.exe init.fsx 37 | mono packages/FAKE/tools/FAKE.exe $@ --fsiargs -d:MONO build.fsx 38 | fi 39 | -------------------------------------------------------------------------------- /docs/content/index.fsx: -------------------------------------------------------------------------------- 1 | (*** hide ***) 2 | // This block of code is omitted in the generated HTML documentation. Use 3 | // it to define helpers that you do not want to show in the documentation. 4 | #I "../../bin" 5 | let names = [] 6 | let stats = [] 7 | (** 8 | Lightweight F# wrapper for gnuplot 9 | ================================== 10 | 11 | FnuPlot is a lightweight wrapper for the [gnuplot](http://www.gnuplot.info/) charting and 12 | visualization library, which lets you create cross-platform, publication-quality charts 13 | on Mac, Linux and Windows. FnuPlot provides two features on top of gnuplot: 14 | 15 | - First, it hides the gnuplot process, so you do not have to start and control the process. 16 | You can easily starts `gnuplot` in the background just by creating a new instance of the 17 | `GnuPlot` type. Then you can send commands to `gnuplot` easily using the `SendCommand` method. 18 | 19 | - Second, FnuPlot implements a simple domain-specific language for building a number of common 20 | chart types. This means that you can use `gp.Plot` to plot charts for functions, line charts, 21 | histograms and a few other charts and you can use `gp.Set` to configure `gnuplot`. 22 | 23 | Visualizing population of the world 24 | ----------------------------------- 25 | 26 | To give see a quick example of the DSL for building `gnuplot` charts, have a look at the following 27 | example from the [visualizing population using WorldBank data] tutorial. The tutorial downloads 28 | data from the WorldBank and then uses FnuPlot to create a single chart combining three histograms 29 | for three different years: 30 | *) 31 | // Starts 'gnuplot' process interactively 32 | #r "FnuPlot.dll" 33 | open FnuPlot 34 | let gp = new GnuPlot() 35 | 36 | // Configure chart style, ranges and titles 37 | gp.Set 38 | ( style = Style(Solid), 39 | range = RangeY.[ 5e8 .. 75e8 ], 40 | titles = Titles(x = names, xrotate = -90) ) 41 | 42 | // Create a chart combining several histograms 43 | [ for year, values, color in stats -> 44 | Series.Histogram 45 | ( data = values, title = string year, 46 | lineColor = color) ] 47 | |> gp.Plot 48 | (** 49 | 50 | The example first creates `GnuPlot` (assuming that the executable is in your `PATH`). Then it calls 51 | `gp.Set` to configure the chart, setting the Y axis range and titles. Then it creates a sequence of 52 | histograms (with different line colours) that are then passed to `gp.Plot` to display the plot. The 53 | resulting chart looks as follows: 54 | 55 | WorldBank data visualization 56 | 57 | How to get FnuPlot 58 | ------------------ 59 | 60 | * The library is available as [FnuPlot on NuGet](https://www.nuget.org/packages/FnuPlot). To get the 61 | code also, [get the code from GitHub](https://github.com/fsprojects/FnuPlot/). 62 | 63 | * All of the FnuPlot functionality is currently implemented in a single file, and so you can also copy the 64 | `FnuPlot.fs` file to your project. The recommended way to do this is to use [Paket](http://fsprojects.github.io/Paket/) 65 | for managing your references and use [GitHub reference](http://fsprojects.github.io/Paket/github-dependencies.html) 66 | specified in your `paket.dependencies` file using `github fsprojects/FnuPlot src/FnuPlot/FnuPlot.fs`. 67 | 68 | Samples & documentation 69 | ----------------------- 70 | 71 | The FnuPlot library comes with a documentation that is automatically generated from `*.fsx` files in 72 | [the content folder][content]. This means that you can also open the code in your favourite F# editor 73 | and run it interactively. 74 | 75 | * Read the [Getting started tutorial](tutorial.html), which contains more detailed description of 76 | different charts supported by the library. The [Visualizing population using WorldBank](worldbank.html) 77 | tutorial shows how to create the chart above. 78 | 79 | * [API Reference](reference/index.html) contains automatically generated documentation for all types, 80 | modules and functions in the library. This includes additional brief samples on using most of the 81 | functions. 82 | 83 | Contributing and copyright 84 | -------------------------- 85 | 86 | The project is hosted on [GitHub][gh] where you can [report issues][issues], fork 87 | the project and submit pull requests. If you're adding a new public API, please also 88 | consider adding [samples][content] that can be turned into a documentation. 89 | 90 | The library is available under Apache 2.0 license, which allows modification and 91 | redistribution for both commercial and non-commercial purposes. For more information see the 92 | [License file][license] in the GitHub repository. 93 | 94 | [content]: https://github.com/fsprojects/FnuPlot/tree/master/docs/content 95 | [gh]: https://github.com/fsprojects/FnuPlot 96 | [issues]: https://github.com/fsprojects/FnuPlot/issues 97 | [readme]: https://github.com/fsprojects/FnuPlot/blob/master/README.md 98 | [license]: https://github.com/fsprojects/FnuPlot/blob/master/LICENSE.md 99 | *) 100 | -------------------------------------------------------------------------------- /docs/content/tutorial.fsx: -------------------------------------------------------------------------------- 1 | (*** hide ***) 2 | #I "../../bin" 3 | let pathOpt = 4 | [ // MAINTAINERS: Feel free to add other paths where Gnuplot lives on your machine.. 5 | @"C:\Programs\Data\gnuplot\bin\gnuplot.exe" 6 | @"C:\Program Files (x86)\gnuplot\bin\gnuplot.exe"] 7 | |> Seq.tryFind System.IO.File.Exists 8 | let path = defaultArg pathOpt "gnuplot" 9 | (** 10 | Getting started with FnuPlot 11 | ============================ 12 | 13 | FnuPlot is a lightweight wrapper for the [gnuplot](http://www.gnuplot.info/) charting and 14 | visualization library. Since gnuplot is cross-platform (works on Mac, Linux and Windows), 15 | you can use this library on all of the platforms mentioned above. 16 | 17 | FnuPlot provides two features on top of gnuplot. First, it hides the gnuplot process, so you 18 | do not have to start and control the process; you can use the `GnuPlot` type and call it using 19 | `SendCommand`. Second, FnuPlot implements a simple domain-specific language for building a 20 | number of common chart types. 21 | 22 | Installing and configuring FnuPlot 23 | ---------------------------------- 24 | * [Install gnuplot](http://sourceforge.net/projects/gnuplot/files/) if you haven't already. 25 | 26 | * The library is available as [FnuPlot on NuGet](https://www.nuget.org/packages/FnuPlot). To get the 27 | code also, [get the code from GitHub](https://github.com/fsprojects/FnuPlot/). 28 | 29 | * Alternatively: Because FnuPlot is implemented in a single source file, you can instead just copy the 30 | `FnuPlot.fs` file into your project. A robust way to do this is to use [Paket](http://fsprojects.github.io/Paket/) 31 | for managing your references and use [GitHub reference](http://fsprojects.github.io/Paket/github-dependencies.html) 32 | specified in your `paket.dependencies` file using `github fsprojects/FnuPlot src/FnuPlot/FnuPlot.fs`. 33 | 34 | * Once you have the reference, you can either add `FnuPlot.dll` to your reference (when using 35 | a compiled project) or use `#load "FnuPlot.fs"` to load the FnuPlot file obtained using 36 | Paket. Alternatively, you can use `#r` if you're referencing FnuPlot using NuGet package: 37 | *) 38 | #r "FnuPlot.dll" 39 | open FnuPlot 40 | open System 41 | open System.Drawing 42 | (** 43 | The access to gnuplot is managed through the `GnuPlot` type. When creating an instance, you 44 | can specify the path to the `gnuplot` executable. If you do not pass a path explicitly, then 45 | FnuPlot assumes that you have gnuplot in your `PATH` variable: 46 | *) 47 | let gp_default = new GnuPlot() 48 | let gp = new GnuPlot(path) 49 | (** 50 | The `Set` method on the `GnuPlot` object provides a way to configure `gnuplot`. Here, we specify 51 | that plots should appear in a new window (using X11) and we also specify the default font: 52 | *) 53 | gp.Set(output = Output(X11, font="arial")) 54 | (** 55 | 56 | Plotting functions and line charts 57 | ---------------------------------- 58 | 59 | The `Plot` method provided by `GnuPlot` has a number of overloads. You can specify a function 60 | to be drawn (as a string), you can specify a single data series or you can specify multiple 61 | series (which can also use different chart types). 62 | 63 | The following shows how to call `Plot` with a function specified as a string: 64 | *) 65 | gp.Plot(Series.Lines "sin(x)") 66 | (** 67 | Sin function 68 | 69 | This creates a chart with a single series, created (implicitly) by specifying the function 70 | as a string. If you want to create other kinds of series, you need to use the `Series` type. 71 | The following uses `Series.Lines` to create a single line chart from a specified list of 72 | data points: 73 | *) 74 | gp.Plot(Series.Lines [2.0; 1.0; 2.0; 5.0]) 75 | (** 76 | Line series 77 | 78 | The `Series.Lines` method takes a number of optional parameters that you can use to specify 79 | the title, colour and other properties of the line chart. You can also make the call using 80 | the pipelining operator: 81 | *) 82 | Series.Lines 83 | ( title="Some plot", lineColor = Color.OliveDrab, 84 | weight = 3, data = [2.0; 1.0; 2.0; 5.0]) 85 | |> gp.Plot 86 | (** 87 | Line series with configuration 88 | 89 | When creating a line series from data points consisting of both X and Y values, you can also use 90 | the `Series.Lines` method with a series of that type (note that FnuPlot also supports time-series data sets, which are 91 | discussed below). 92 | *) 93 | Series.Lines( [0.0,1.0; 0.2,2.0; 2.0,1.5; 2.1,3.0] , title = "Some xy plot") 94 | |> gp.Plot 95 | (** 96 | Line series with X and Y values 97 | *) 98 | (** 99 | Plotting histograms and time-series 100 | ----------------------------------- 101 | 102 | Another kind of chart for which FnuPlot provides an easy-to-use wrapper is histogram. This can 103 | be created using the `Series.Histogram` function. Again, we can specify additional properties 104 | using a number of optional parameters: 105 | *) 106 | Series.Histogram 107 | ( [2.0; 5.0; 2.0; 1.0], title = "Some plot", fill = Solid, 108 | lineColor = Color.SteelBlue, weight = 3) 109 | |> gp.Plot 110 | (** 111 | Histogram 112 | 113 | As already mentioned, FnuPlot also supports time-series charts. These can be created by passing 114 | values as pairs of `DateTime` and `float`: 115 | *) 116 | let values = 117 | [ DateTime(2014,1,1), 1.0 118 | DateTime(2014,1,5), 3.0 119 | DateTime(2014,2,1), 1.5 ] 120 | 121 | Series.Lines(values, title = "Some time series" ) 122 | |> gp.Plot 123 | (** 124 | Time-series 125 | 126 | Combining multiple chart series 127 | ------------------------------- 128 | 129 | As mentioned earlier, the `Plot` function has a number of overloads. We have already 130 | seen an overload that takes a string (to plot a specified function) and an overload that 131 | takes a single series. However, you can also call `Plot` with a collection of series. 132 | In that case, gnuplot will render multiple series into a single chart. 133 | 134 | The following (slightly silly) demo combines the `sin(x*3)+3)` function specified as 135 | a string together with line chart and histogram created from values: 136 | *) 137 | [ Series.Lines 138 | ( "sin(x*3) + 3", title = "Sinus", 139 | lineColor = Color.Goldenrod, weight = 3) 140 | Series.Lines 141 | ( [2.0; 1.0; 2.0; 5.0], title = "Line", 142 | lineColor = Color.OliveDrab, weight = 3) 143 | Series.Histogram 144 | ( [2.0; 5.0; 2.0; 1.0], title = "Hist", fill = Solid, 145 | lineColor = Color.SteelBlue, weight = 3) ] 146 | |> gp.Plot 147 | (** 148 | Combining multiple charts 149 | 150 | Configuring ranges and styles 151 | ----------------------------- 152 | 153 | So far, we always specified properties of individual chart series locally using optional 154 | parameters of a `Series.` method. However, the `gp.Plot` method also takes a number 155 | of additional parameters that can be used to specify properties of the whole chart. Most 156 | importantly, you can use these to specify ranges: 157 | *) 158 | gp.Plot( 159 | range = RangeY.[-10.0 .. 10.0 ], 160 | data = Series.Lines [2.0; 1.0; 2.0; 5.0]) 161 | (** 162 | Combining multiple charts 163 | 164 | To specify a range, you can use `RangeY` (as shown in the code snippet) or `RangeX` to set 165 | the range for one of the two axes. If you want to configure both ranges, you can use the 166 | `Range` type. For example, to specify X axis range from -10 to 10 and Y axis range from 167 | -1 to 1, you can write `Range.[-10.0 .. 10.0, -1.0 .. 1.0]`. 168 | 169 | The next example shows how to specify fill style for the whole chart, so that you do not have 170 | to repeat this for every single histogram that is being combined: 171 | *) 172 | gp.Plot( 173 | style = Style(fill=Solid), 174 | range = Range.[-0.5 .. 3.7, 0.0 .. 6.0], 175 | data = 176 | [ Series.Histogram([2.0; 1.0; 2.0; 5.0], lineColor = Color.OliveDrab) 177 | Series.Histogram([1.5; 2.0; 2.5; 4.5], lineColor = Color.SteelBlue) ]) 178 | (** 179 | Combining multiple charts 180 | 181 | Saving charts to a file 182 | ----------------------- 183 | At the beginning of the tutorial, we used the `gp.Set` method to specify the output kind for 184 | gnuplot. We used `Output(X11, font="arial")` to use the X11 server, which means that all 185 | charts are created in a gnuplot window. 186 | 187 | If you want to save charts to a file, then you can use the `Png` output. The following 188 | (slightly longer) example also demonstrates other optional parameters of the `gp.Set` 189 | method. This gives you another way to specify the range and style - this time, the configuration 190 | will apply to all created charts: 191 | *) 192 | // Set global properties using the 'Set' method 193 | gp.Set(style = Style(fill = Solid), range = Range.[-0.5 .. 3.7, 0.0 .. 6.0]) 194 | // Specify the 'Png' output kind 195 | gp.Set(output = Output(Png("/home/tomas/Temp/test1.png"))) 196 | 197 | // Create a plot (which will be saved to a file) 198 | gp.Plot 199 | [ Series.Histogram([2.0; 1.0; 2.0; 5.0], lineColor = Color.OliveDrab) 200 | Series.Histogram([1.5; 2.0; 2.5; 4.5], lineColor = Color.SteelBlue) ] 201 | 202 | // Reset the configuration back to X11 plots 203 | gp.Set(output = Output(X11, font="arial")) 204 | 205 | (** 206 | 207 | Impulses and Points 208 | ------------------- 209 | Using the `Series.Impulses` and `Series.Points` methods we can plot impulses and points. 210 | *) 211 | 212 | [ Series.Impulses( "besj0(x)*0.12e1", title = "Plot as Impulses") 213 | Series.Points( "(x**besj0(x))-2.5", title = "Plot as Points")] 214 | |> gp.Plot 215 | 216 | (** 217 | Impulses and Points 218 | *) 219 | -------------------------------------------------------------------------------- /docs/content/worldbank.fsx: -------------------------------------------------------------------------------- 1 | (*** hide ***) 2 | #I "../../bin/" 3 | #I "../../packages/FSharp.Data/lib/net40" 4 | let pathOpt = 5 | [ // MAINTAINERS: Feel free to add other paths where Gnuplot lives on your machine.. 6 | "C:/Programs/Data/gnuplot/bin/gnuplot.exe" 7 | "/usr/local/bin/gnuplot" 8 | "C:/Program Files (x86)/gnuplot/bin/gnuplot.exe"] 9 | |> Seq.tryFind System.IO.File.Exists 10 | let path = defaultArg pathOpt "gnuplot" 11 | (** 12 | Visualizing population using WorldBank 13 | ===================================== 14 | 15 | In this walkthrough, we look at a larger example of data analysis that uses FnuPlot to 16 | visualize the results. We use the [WorldBank](http://data.worldbank.org) as the data source 17 | and we plot how the total population in the countries of the world changed between 1990 and 2005. The 18 | example is inspired by the [Asynchrnous and data-driven programming chapter](http://manning.com/petricek) 19 | from Real-World Functional Programming. 20 | 21 | Downloading data from the WorldBank 22 | ----------------------------------- 23 | 24 | In the chapter used as the inspiration, the data download is done using the LINQ to XML library 25 | and the `XDocument` type. Here, we use F# type providers instead. We use XML type provider to 26 | parse the data and WorldBank type provider to find the ID of the required indicator. 27 | 28 | First, we connect to the WorldBank to get the ID and write a function that sends HTTP request 29 | to download one page of data for the specified indicator: 30 | *) 31 | #r "FSharp.Data.dll" 32 | open FSharp.Data 33 | 34 | // Get indicator code from WorldBank 35 | let wb = WorldBankData.GetDataContext() 36 | let indCode = wb.Countries.World.Indicators.``Population, total``.IndicatorCode 37 | let root = "http://api.worldbank.org/countries/indicators/" 38 | let key = "hq8byg8k7t2fxc6hp7jmbx26" 39 | 40 | /// Asynchronously downloads the population 41 | /// data for the specified year & page 42 | let asyncGetPage year page = 43 | let range = sprintf "%d:%d" year year 44 | Http.AsyncRequestString 45 | ( root + indCode, 46 | query=[ "api_key", key; "per_page", "100"; 47 | "date", range; "page", string page ] ) 48 | (** 49 | Now, we want to save a sample response to a local file and use the XML type provider 50 | to parse the response. The easiest way to do this is to use `File.WriteAllText` to 51 | save a sample result, say for `asyncGetPage 2000 1` to a local file. Here, we use 52 | `worldbank.xml` in the current folder, so we can load the type provider as follows: 53 | *) 54 | #r "System.Xml.Linq.dll" 55 | type WB = XmlProvider<"worldbank.xml"> 56 | (** 57 | The generated type `WB` lets us parse the responses returned by `asyncGetPage`. To 58 | download all data, we first need to request the first page, so that we know how many 59 | pages in total are there. Then we can download the rest of the pages in parallel. This 60 | is done in the following `async` function: 61 | *) 62 | let asyncGetPopulation year = async { 63 | // Download the first page & get total no. of pages 64 | let! first = asyncGetPage year 1 65 | let parsed = WB.Parse(first) 66 | 67 | // Download the remaining pages in parallel 68 | let! rest = 69 | [ for pg in 2 .. parsed.Pages -> async { 70 | let! response = asyncGetPage year pg 71 | return WB.Parse(response) } ] 72 | |> Async.Parallel 73 | // Return all pages 74 | return Seq.append [parsed] rest } 75 | (** 76 | The return type of `asyncGetPopulation` is `Async>`, which means that it 77 | _asynchronously_ returns a collection of `` elements from the XML document. Now, 78 | we use `Async.Parallel` again to download data for 3 different years: 79 | *) 80 | let allData = 81 | [ for y in [ 1990; 2000; 2005 ] -> 82 | asyncGetPopulation y ] 83 | |> Async.Parallel 84 | |> Async.RunSynchronously 85 | |> Seq.concat 86 | (** 87 | The operation creates a list of asynchronous operations, composes them so that they are 88 | performed asynchronously, runs them and then it concatenates the results, so that we get 89 | just a single collection of `` nodes. 90 | 91 | Processing downloaded data 92 | -------------------------- 93 | 94 | Before we can do the visualization, we need to find the countries for which we have all 95 | the data. To do that, we build two lookup tables. One that maps country code and year to 96 | a value and another, which maps country code to a country name. 97 | *) 98 | // Lookup table mapping IDs to country names 99 | let idToName = 100 | [ for d in allData do 101 | for item in d.Datas do 102 | yield item.Country.Id, item.Country.Value ] 103 | |> dict 104 | 105 | // Lookup table mapping ID and Year to a value 106 | let idAndYearToValue = 107 | [ for d in allData do 108 | for item in d.Datas do 109 | if item.Value.IsSome then 110 | yield (item.Country.Id, item.Date), item.Value.Value ] 111 | |> dict 112 | 113 | (** 114 | Now that we have the two dictionaries, we can create collections of numbers in a format 115 | that can be passed to `gnuplot`. First of all, we want to display data only for some of 116 | the countries. We choose countries and regions that have data for all 3 years and have 117 | population over 500 million. This will give us large countries and aggregated regions that 118 | WorldBank monitors as a whole. 119 | 120 | Next, we need to pick the names of the regions/countries (for axis labels) and a list of 121 | collections with numerical values for each year: 122 | *) 123 | 124 | /// Returns true if data is available for all 3 monitored years 125 | /// and the country or region has over 500 million 126 | let isVisibleCountry id = 127 | [1990; 2000; 2005] |> Seq.forall (fun y -> 128 | match idAndYearToValue.TryGetValue( (id, y) ) with 129 | | true, v -> v > int64 5e8 130 | | _ -> false ) 131 | 132 | /// Names of visible countries/regions for axis labels 133 | let names = 134 | [ for KeyValue(id, name) in idToName do 135 | if isVisibleCountry id then yield name ] 136 | 137 | /// List of tuples consisting of a year and data for the year 138 | let stats = 139 | [ for y in [1990; 2000; 2005] do 140 | let data = 141 | [ for KeyValue(id, name) in idToName do 142 | if isVisibleCountry id then 143 | yield float (idAndYearToValue.[id, y]) ] 144 | yield y, data ] 145 | (** 146 | Visualizing data with gnuplot 147 | ----------------------------- 148 | 149 | To create a plot using `gnuplot`, we first need to reference the `FnuPlot.dll` 150 | library, open the required namespace and create `GnuPlot` instance. Here, we pass 151 | the path to the `gnuplot` executable as an argument. If it is available directly in 152 | your path, you can just call `new GnuPlot()` without parameters: 153 | *) 154 | #r "FnuPlot.dll" 155 | open FnuPlot 156 | open System.Drawing 157 | 158 | let gp = new GnuPlot(path) 159 | (** 160 | To make the chart nicer, we configure a number of options first. We specify the output 161 | type to X11 (to create chart in a window) and a font. Then we also set the range and 162 | the style of histogram bars (filled). Finally, we add titles and specify that the chart 163 | should be rotated (from the bottom to the top): 164 | *) 165 | gp.Set 166 | ( output = Output(X11, font = "arial"), 167 | style = Style(Solid), 168 | range = RangeY.[ 5e8 .. 75e8 ], 169 | titles = Titles(x = names, xrotate = -90) ) 170 | (** 171 | We want to create histogram using custom colors, so we'll zip the data with the following 172 | list of colors: 173 | *) 174 | let colors = [ Color.OliveDrab; Color.SteelBlue; Color.Goldenrod ] 175 | (** 176 | Now we have all we need to create the chart. We use `gp.Plot` to display the plot. As an 177 | argument, we give it a collection of series created using `Series.Histogram`. When 178 | createing a series, we specify the `lineColor` parameter to get the required color (one 179 | color for each year): 180 | *) 181 | gp.Plot 182 | [ for (y, values), clr in Seq.zip stats colors -> 183 | Series.Histogram 184 | ( data = values, title = string y, lineColor = clr) ] 185 | (** 186 | WorldBank data visualization 187 | *) 188 | -------------------------------------------------------------------------------- /docs/content/worldbank.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Population, total 5 | Arab World 6 | 2000 7 | 277561423 8 | 0 9 | 10 | 11 | Population, total 12 | Caribbean small states 13 | 2000 14 | 6431380 15 | 0 16 | 17 | 18 | Population, total 19 | Central Europe and the Baltics 20 | 2000 21 | 108405522 22 | 0 23 | 24 | 25 | Population, total 26 | East Asia & Pacific (all income levels) 27 | 2000 28 | 2043379556 29 | 0 30 | 31 | 32 | Population, total 33 | East Asia & Pacific (developing only) 34 | 2000 35 | 1812175348 36 | 0 37 | 38 | 39 | Population, total 40 | Euro area 41 | 2000 42 | 317608111 43 | 0 44 | 45 | 46 | Population, total 47 | Europe & Central Asia (all income levels) 48 | 2000 49 | 862094365 50 | 0 51 | 52 | 53 | Population, total 54 | Europe & Central Asia (developing only) 55 | 2000 56 | 256285094 57 | 0 58 | 59 | 60 | Population, total 61 | European Union 62 | 2000 63 | 487975692 64 | 0 65 | 66 | 67 | Population, total 68 | Fragile and conflict affected situations 69 | 2000 70 | 330080933 71 | 0 72 | 73 | 74 | Population, total 75 | Heavily indebted poor countries (HIPC) 76 | 2000 77 | 472726491 78 | 0 79 | 80 | 81 | Population, total 82 | High income 83 | 2000 84 | 1210722389 85 | 0 86 | 87 | 88 | Population, total 89 | High income: nonOECD 90 | 2000 91 | 231667801 92 | 0 93 | 94 | 95 | Population, total 96 | High income: OECD 97 | 2000 98 | 979054588 99 | 0 100 | 101 | 102 | Population, total 103 | Latin America & Caribbean (all income levels) 104 | 2000 105 | 525299778 106 | 0 107 | 108 | 109 | Population, total 110 | Latin America & Caribbean (developing only) 111 | 2000 112 | 500304988 113 | 0 114 | 115 | 116 | Population, total 117 | Least developed countries: UN classification 118 | 2000 119 | 663076857 120 | 0 121 | 122 | 123 | Population, total 124 | Low & middle income 125 | 2000 126 | 4891279561 127 | 0 128 | 129 | 130 | Population, total 131 | Low income 132 | 2000 133 | 636658396 134 | 0 135 | 136 | 137 | Population, total 138 | Lower middle income 139 | 2000 140 | 2089438289 141 | 0 142 | 143 | 144 | Population, total 145 | Middle East & North Africa (all income levels) 146 | 2000 147 | 311791217 148 | 0 149 | 150 | 151 | Population, total 152 | Middle East & North Africa (developing only) 153 | 2000 154 | 276589220 155 | 0 156 | 157 | 158 | Population, total 159 | Middle income 160 | 2000 161 | 4254621165 162 | 0 163 | 164 | 165 | Population, total 166 | North America 167 | 2000 168 | 312993944 169 | 0 170 | 171 | 172 | Population, total 173 | Not classified 174 | 2000 175 | 176 | 0 177 | 178 | 179 | Population, total 180 | OECD members 181 | 2000 182 | 1156313649 183 | 0 184 | 185 | 186 | Population, total 187 | Other small states 188 | 2000 189 | 16222082 190 | 0 191 | 192 | 193 | Population, total 194 | Pacific island small states 195 | 2000 196 | 1952589 197 | 0 198 | 199 | 200 | Population, total 201 | Small states 202 | 2000 203 | 24606051 204 | 0 205 | 206 | 207 | Population, total 208 | South Asia 209 | 2000 210 | 1382195669 211 | 0 212 | 213 | 214 | Population, total 215 | Sub-Saharan Africa (all income levels) 216 | 2000 217 | 664247421 218 | 0 219 | 220 | 221 | Population, total 222 | Sub-Saharan Africa (developing only) 223 | 2000 224 | 663729242 225 | 0 226 | 227 | 228 | Population, total 229 | Upper middle income 230 | 2000 231 | 2165182876 232 | 0 233 | 234 | 235 | Population, total 236 | World 237 | 2000 238 | 6102001950 239 | 0 240 | 241 | 242 | Population, total 243 | Afghanistan 244 | 2000 245 | 20595360 246 | 0 247 | 248 | 249 | Population, total 250 | Albania 251 | 2000 252 | 3089027 253 | 0 254 | 255 | 256 | Population, total 257 | Algeria 258 | 2000 259 | 31719449 260 | 0 261 | 262 | 263 | Population, total 264 | American Samoa 265 | 2000 266 | 57522 267 | 0 268 | 269 | 270 | Population, total 271 | 272 | 2000 273 | 65399 274 | 0 275 | 276 | 277 | Population, total 278 | Angola 279 | 2000 280 | 13924930 281 | 0 282 | 283 | 284 | Population, total 285 | Antigua and Barbuda 286 | 2000 287 | 77648 288 | 0 289 | 290 | 291 | Population, total 292 | Argentina 293 | 2000 294 | 36903067 295 | 0 296 | 297 | 298 | Population, total 299 | Armenia 300 | 2000 301 | 3076098 302 | 0 303 | 304 | 305 | Population, total 306 | Aruba 307 | 2000 308 | 90858 309 | 0 310 | 311 | 312 | Population, total 313 | Australia 314 | 2000 315 | 19153000 316 | 0 317 | 318 | 319 | Population, total 320 | Austria 321 | 2000 322 | 8011566 323 | 0 324 | 325 | 326 | Population, total 327 | Azerbaijan 328 | 2000 329 | 8048600 330 | 0 331 | 332 | 333 | Population, total 334 | Bahamas, The 335 | 2000 336 | 297759 337 | 0 338 | 339 | 340 | Population, total 341 | Bahrain 342 | 2000 343 | 668239 344 | 0 345 | 346 | 347 | Population, total 348 | Bangladesh 349 | 2000 350 | 132383265 351 | 0 352 | 353 | 354 | Population, total 355 | Barbados 356 | 2000 357 | 267190 358 | 0 359 | 360 | 361 | Population, total 362 | Belarus 363 | 2000 364 | 10005000 365 | 0 366 | 367 | 368 | Population, total 369 | Belgium 370 | 2000 371 | 10251250 372 | 0 373 | 374 | 375 | Population, total 376 | Belize 377 | 2000 378 | 238586 379 | 0 380 | 381 | 382 | Population, total 383 | Benin 384 | 2000 385 | 6949366 386 | 0 387 | 388 | 389 | Population, total 390 | Bermuda 391 | 2000 392 | 61833 393 | 0 394 | 395 | 396 | Population, total 397 | Bhutan 398 | 2000 399 | 564350 400 | 0 401 | 402 | 403 | Population, total 404 | Bolivia 405 | 2000 406 | 8495271 407 | 0 408 | 409 | 410 | Population, total 411 | Bosnia and Herzegovina 412 | 2000 413 | 3834364 414 | 0 415 | 416 | 417 | Population, total 418 | Botswana 419 | 2000 420 | 1755375 421 | 0 422 | 423 | 424 | Population, total 425 | Brazil 426 | 2000 427 | 174504898 428 | 0 429 | 430 | 431 | Population, total 432 | Brunei Darussalam 433 | 2000 434 | 331801 435 | 0 436 | 437 | 438 | Population, total 439 | Bulgaria 440 | 2000 441 | 8170172 442 | 0 443 | 444 | 445 | Population, total 446 | Burkina Faso 447 | 2000 448 | 11607944 449 | 0 450 | 451 | 452 | Population, total 453 | Burundi 454 | 2000 455 | 6674286 456 | 0 457 | 458 | 459 | Population, total 460 | Cabo Verde 461 | 2000 462 | 442426 463 | 0 464 | 465 | 466 | Population, total 467 | Cambodia 468 | 2000 469 | 12222871 470 | 0 471 | 472 | 473 | Population, total 474 | Cameroon 475 | 2000 476 | 15927713 477 | 0 478 | 479 | 480 | Population, total 481 | Canada 482 | 2000 483 | 30769700 484 | 0 485 | 486 | 487 | Population, total 488 | Cayman Islands 489 | 2000 490 | 41685 491 | 0 492 | 493 | 494 | Population, total 495 | Central African Republic 496 | 2000 497 | 3638316 498 | 0 499 | 500 | 501 | Population, total 502 | Chad 503 | 2000 504 | 8301151 505 | 0 506 | 507 | 508 | Population, total 509 | Channel Islands 510 | 2000 511 | 148725 512 | 0 513 | 514 | 515 | Population, total 516 | Chile 517 | 2000 518 | 15454402 519 | 0 520 | 521 | 522 | Population, total 523 | China 524 | 2000 525 | 1262645000 526 | 0 527 | 528 | 529 | Population, total 530 | Colombia 531 | 2000 532 | 39897984 533 | 0 534 | 535 | 536 | Population, total 537 | Comoros 538 | 2000 539 | 528312 540 | 0 541 | 542 | 543 | Population, total 544 | Congo, Dem. Rep. 545 | 2000 546 | 46949244 547 | 0 548 | 549 | 550 | Population, total 551 | Congo, Rep. 552 | 2000 553 | 3126204 554 | 0 555 | 556 | 557 | Population, total 558 | Costa Rica 559 | 2000 560 | 3929588 561 | 0 562 | 563 | 564 | Population, total 565 | Cote d'Ivoire 566 | 2000 567 | 16131332 568 | 0 569 | 570 | 571 | Population, total 572 | Croatia 573 | 2000 574 | 4426000 575 | 0 576 | 577 | 578 | Population, total 579 | Cuba 580 | 2000 581 | 11138416 582 | 0 583 | 584 | 585 | Population, total 586 | Curacao 587 | 2000 588 | 133860 589 | 0 590 | 591 | 592 | Population, total 593 | Cyprus 594 | 2000 595 | 943287 596 | 0 597 | 598 | 599 | Population, total 600 | Czech Republic 601 | 2000 602 | 10255063 603 | 0 604 | 605 | 606 | Population, total 607 | Denmark 608 | 2000 609 | 5339616 610 | 0 611 | 612 | 613 | Population, total 614 | Djibouti 615 | 2000 616 | 722887 617 | 0 618 | 619 | 620 | Population, total 621 | Dominica 622 | 2000 623 | 69679 624 | 0 625 | 626 | 627 | Population, total 628 | Dominican Republic 629 | 2000 630 | 8663421 631 | 0 632 | 633 | 634 | Population, total 635 | Ecuador 636 | 2000 637 | 12533087 638 | 0 639 | 640 | 641 | Population, total 642 | Egypt, Arab Rep. 643 | 2000 644 | 66136590 645 | 0 646 | 647 | 648 | Population, total 649 | El Salvador 650 | 2000 651 | 5958794 652 | 0 653 | 654 | 655 | Population, total 656 | Equatorial Guinea 657 | 2000 658 | 518179 659 | 0 660 | 661 | 662 | Population, total 663 | Eritrea 664 | 2000 665 | 3939348 666 | 0 667 | 668 | 669 | Population, total 670 | Estonia 671 | 2000 672 | 1396985 673 | 0 674 | 675 | 676 | Population, total 677 | Ethiopia 678 | 2000 679 | 66024199 680 | 0 681 | 682 | 683 | Population, total 684 | Faeroe Islands 685 | 2000 686 | 46491 687 | 0 688 | 689 | 690 | Population, total 691 | Fiji 692 | 2000 693 | 811647 694 | 0 695 | 696 | 697 | Population, total 698 | Finland 699 | 2000 700 | 5176209 701 | 0 702 | 703 | -------------------------------------------------------------------------------- /docs/files/img/logo-template.pdn: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fsprojects/FnuPlot/07c130d385a0a27e7f560574a926f768c15b4feb/docs/files/img/logo-template.pdn -------------------------------------------------------------------------------- /docs/files/img/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fsprojects/FnuPlot/07c130d385a0a27e7f560574a926f768c15b4feb/docs/files/img/logo.png -------------------------------------------------------------------------------- /docs/files/img/tutorial-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fsprojects/FnuPlot/07c130d385a0a27e7f560574a926f768c15b4feb/docs/files/img/tutorial-1.png -------------------------------------------------------------------------------- /docs/files/img/tutorial-10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fsprojects/FnuPlot/07c130d385a0a27e7f560574a926f768c15b4feb/docs/files/img/tutorial-10.png -------------------------------------------------------------------------------- /docs/files/img/tutorial-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fsprojects/FnuPlot/07c130d385a0a27e7f560574a926f768c15b4feb/docs/files/img/tutorial-2.png -------------------------------------------------------------------------------- /docs/files/img/tutorial-3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fsprojects/FnuPlot/07c130d385a0a27e7f560574a926f768c15b4feb/docs/files/img/tutorial-3.png -------------------------------------------------------------------------------- /docs/files/img/tutorial-4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fsprojects/FnuPlot/07c130d385a0a27e7f560574a926f768c15b4feb/docs/files/img/tutorial-4.png -------------------------------------------------------------------------------- /docs/files/img/tutorial-5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fsprojects/FnuPlot/07c130d385a0a27e7f560574a926f768c15b4feb/docs/files/img/tutorial-5.png -------------------------------------------------------------------------------- /docs/files/img/tutorial-6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fsprojects/FnuPlot/07c130d385a0a27e7f560574a926f768c15b4feb/docs/files/img/tutorial-6.png -------------------------------------------------------------------------------- /docs/files/img/tutorial-7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fsprojects/FnuPlot/07c130d385a0a27e7f560574a926f768c15b4feb/docs/files/img/tutorial-7.png -------------------------------------------------------------------------------- /docs/files/img/tutorial-8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fsprojects/FnuPlot/07c130d385a0a27e7f560574a926f768c15b4feb/docs/files/img/tutorial-8.png -------------------------------------------------------------------------------- /docs/files/img/tutorial-9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fsprojects/FnuPlot/07c130d385a0a27e7f560574a926f768c15b4feb/docs/files/img/tutorial-9.png -------------------------------------------------------------------------------- /docs/files/img/worldbank.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fsprojects/FnuPlot/07c130d385a0a27e7f560574a926f768c15b4feb/docs/files/img/worldbank.png -------------------------------------------------------------------------------- /docs/tools/generate.fsx: -------------------------------------------------------------------------------- 1 | // -------------------------------------------------------------------------------------- 2 | // Builds the documentation from `.fsx` and `.md` files in the 'docs/content' directory 3 | // (the generated documentation is stored in the 'docs/output' directory) 4 | // -------------------------------------------------------------------------------------- 5 | 6 | // Binaries that have XML documentation (in a corresponding generated XML file) 7 | let referenceBinaries = [ "FnuPlot.dll" ] 8 | // Web site location for the generated documentation 9 | let website = "/FnuPlot" 10 | 11 | let githubLink = "http://github.com/fsprojects/FnuPlot" 12 | 13 | // Specify more information about your project 14 | let info = 15 | [ "project-name", "FnuPlot" 16 | "project-author", "Tomas Petricek" 17 | "project-summary", "An F# wrapper for the gnuplot charting library" 18 | "project-github", githubLink 19 | "project-nuget", "http://nuget.org/packages/FnuPlot" ] 20 | 21 | // -------------------------------------------------------------------------------------- 22 | // For typical project, no changes are needed below 23 | // -------------------------------------------------------------------------------------- 24 | 25 | #I "../../packages/FSharp.Formatting/lib/net40" 26 | #I "../../packages/RazorEngine/lib/net40" 27 | #I "../../packages/FSharp.Compiler.Service/lib/net40" 28 | #r "../../packages/Microsoft.AspNet.Razor/lib/net40/System.Web.Razor.dll" 29 | #r "../../packages/FAKE/tools/NuGet.Core.dll" 30 | #r "../../packages/FAKE/tools/FakeLib.dll" 31 | #r "RazorEngine.dll" 32 | #r "FSharp.Literate.dll" 33 | #r "FSharp.CodeFormat.dll" 34 | #r "FSharp.MetadataFormat.dll" 35 | open Fake 36 | open System.IO 37 | open Fake.FileHelper 38 | open FSharp.Literate 39 | open FSharp.MetadataFormat 40 | 41 | // When called from 'build.fsx', use the public project URL as 42 | // otherwise, use the current 'output' directory. 43 | #if RELEASE 44 | let root = website 45 | #else 46 | let root = "file://" + (__SOURCE_DIRECTORY__ @@ "../output") 47 | #endif 48 | 49 | // Paths with template/source/output locations 50 | let bin = __SOURCE_DIRECTORY__ @@ "../../bin" 51 | let content = __SOURCE_DIRECTORY__ @@ "../content" 52 | let output = __SOURCE_DIRECTORY__ @@ "../output" 53 | let files = __SOURCE_DIRECTORY__ @@ "../files" 54 | let templates = __SOURCE_DIRECTORY__ @@ "templates" 55 | let formatting = __SOURCE_DIRECTORY__ @@ "../../packages/FSharp.Formatting/" 56 | let docTemplate = formatting @@ "templates/docpage.cshtml" 57 | 58 | // Where to look for *.csproj templates (in this order) 59 | let layoutRootsAll = new System.Collections.Generic.Dictionary() 60 | layoutRootsAll.Add("en",[ templates; formatting @@ "templates" 61 | formatting @@ "templates/reference" ]) 62 | subDirectories (directoryInfo templates) 63 | |> Seq.iter (fun d -> 64 | let name = d.Name 65 | if name.Length = 2 || name.Length = 3 then 66 | layoutRootsAll.Add( 67 | name, [templates @@ name 68 | formatting @@ "templates" 69 | formatting @@ "templates/reference" ])) 70 | 71 | // Copy static files and CSS + JS from F# Formatting 72 | let copyFiles () = 73 | CopyRecursive files output true |> Log "Copying file: " 74 | ensureDirectory (output @@ "content") 75 | CopyRecursive (formatting @@ "styles") (output @@ "content") true 76 | |> Log "Copying styles and scripts: " 77 | 78 | // Build API reference from XML comments 79 | let buildReference () = 80 | CleanDir (output @@ "reference") 81 | let binaries = 82 | referenceBinaries 83 | |> List.map (fun lib-> bin @@ lib) 84 | MetadataFormat.Generate 85 | ( binaries, output @@ "reference", layoutRootsAll.["en"], 86 | parameters = ("root", root)::info, 87 | sourceRepo = githubLink @@ "tree/master", 88 | sourceFolder = __SOURCE_DIRECTORY__ @@ ".." @@ "..", 89 | publicOnly = true, libDirs = [bin] ) 90 | 91 | // Build documentation from `fsx` and `md` files in `docs/content` 92 | let buildDocumentation () = 93 | let subdirs = Directory.EnumerateDirectories(content, "*", SearchOption.AllDirectories) 94 | for dir in Seq.append [content] subdirs do 95 | let sub = if dir.Length > content.Length then dir.Substring(content.Length + 1) else "." 96 | let langSpecificPath(lang, path:string) = 97 | path.Split([|'/'; '\\'|], System.StringSplitOptions.RemoveEmptyEntries) 98 | |> Array.exists(fun i -> i = lang) 99 | let layoutRoots = 100 | let key = layoutRootsAll.Keys |> Seq.tryFind (fun i -> langSpecificPath(i, dir)) 101 | match key with 102 | | Some lang -> layoutRootsAll.[lang] 103 | | None -> layoutRootsAll.["en"] // "en" is the default language 104 | Literate.ProcessDirectory 105 | ( dir, docTemplate, output @@ sub, replacements = ("root", root)::info, 106 | layoutRoots = layoutRoots, generateAnchors = true ) 107 | 108 | // Generate 109 | copyFiles() 110 | #if HELP 111 | buildDocumentation() 112 | #endif 113 | #if REFERENCE 114 | buildReference() 115 | #endif 116 | -------------------------------------------------------------------------------- /docs/tools/templates/template.cshtml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | @Title 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 21 | 22 | 23 |
24 | 34 |
35 |
36 |
37 | @RenderBody() 38 |
39 |
40 | FnuPlot 41 | 72 |
73 |
74 |
75 | Fork me on GitHub 76 | 77 | 78 | -------------------------------------------------------------------------------- /nuget/FnuPlot.nuspec: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | @project@ 5 | @build.number@ 6 | @authors@ 7 | @authors@ 8 | http://github.com/fsprojects/FnuPlot/blob/master/LICENSE.txt 9 | http://fsprojects.github.com/FnuPlot 10 | https://raw.githubusercontent.com/fsprojects/ProjectScaffold/master/docs/files/img/logo.png 11 | false 12 | @summary@ 13 | @description@ 14 | @releaseNotes@ 15 | Copyright 2013 16 | @tags@ 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /paket.dependencies: -------------------------------------------------------------------------------- 1 | source https://nuget.org/api/v2 2 | 3 | nuget FSharp.Formatting 4 | nuget NUnit 5 | nuget NUnit.Runners 6 | nuget Nuget.CommandLine 7 | nuget FAKE 8 | nuget SourceLink.Fake 9 | nuget FSharp.Data 10 | 11 | github fsharp/FAKE modules/Octokit/Octokit.fsx -------------------------------------------------------------------------------- /src/FnuPlot/AssemblyInfo.fs: -------------------------------------------------------------------------------- 1 | namespace System 2 | open System.Reflection 3 | 4 | [] 5 | [] 6 | [] 7 | [] 8 | [] 9 | do () 10 | 11 | module internal AssemblyVersionInformation = 12 | let [] Version = "0.1.1" 13 | -------------------------------------------------------------------------------- /src/FnuPlot/FnuPlot.fs: -------------------------------------------------------------------------------- 1 | // ---------------------------------------------------------------------------- 2 | // GnuPlot.fs - Provides simple wrappers for calling gnuplot from F# 3 | // ---------------------------------------------------------------------------- 4 | namespace FnuPlot 5 | 6 | open System 7 | open System.Drawing 8 | open System.Diagnostics 9 | 10 | // ---------------------------------------------------------------------------- 11 | // Various basic types for representing filling, ranges and for formatting 12 | // ---------------------------------------------------------------------------- 13 | 14 | /// Represents possible fill styles of a plot. A plot can be filled using 15 | /// a solid fill or using a specified pre-defined pattern (represented by 16 | /// an integer that `gnuplot` understands) 17 | type FillStyle = 18 | /// Fill the plot with a solid fill 19 | | Solid 20 | /// Fill the plot with a pre-defined gnuplot pattern 21 | | Pattern of int 22 | 23 | 24 | /// [omit] 25 | /// Represents an abstract command that sets some property 26 | /// of the plot (and allows undoing the change) 27 | type ICommand = 28 | abstract Command : string 29 | abstract Cleanup : string 30 | 31 | 32 | /// [omit] 33 | /// Utilities for formatting values and for working with commands 34 | module InternalUtils = 35 | /// Formats a value of type option<'a> as a string 36 | /// using the emtpy string if the value is missing 37 | let formatArg (f:'T -> string) (a:option<'T>) = 38 | match a with 39 | | None -> "" 40 | | Some(v) -> (f v) 41 | 42 | /// Turns an option value containing some class implementing 43 | /// ICommand into a list containing exaclty ICommand values 44 | let commandList (opt:option<'T>) = 45 | match opt with 46 | | Some(cmd) -> [cmd :> ICommand] 47 | | None -> [] 48 | 49 | /// Formats a value of type option 50 | let formatNum = formatArg (sprintf "%f") 51 | 52 | open InternalUtils 53 | 54 | /// [omit] 55 | module Internal = 56 | /// Type that represents a range for a plot (this type is not 57 | /// intended to be constructed directly - use 'Range.[ ... ]` instead) 58 | type Range(?xspec, ?yspec) = 59 | let xspec = sprintf "set xrange %s\n" (defaultArg xspec "[:]") 60 | let yspec = sprintf "set yrange %s\n" (defaultArg yspec "[:]") 61 | interface ICommand with 62 | member x.Command = xspec + yspec 63 | member x.Cleanup = "set autoscale xy" 64 | 65 | /// Type that allows elegant construction of ranges specifying both X and Y 66 | type RangeImplXY() = 67 | member x.GetSlice(fx, tx, fy, ty) = 68 | Range(sprintf "[%s:%s]" (formatNum fx) (formatNum tx), 69 | sprintf "[%s:%s]" (formatNum fy) (formatNum ty)) 70 | 71 | /// Type that allows elegant construction of ranges specifying only X range 72 | type RangeImplX() = 73 | member x.GetSlice(fx, tx) = 74 | Range(xspec = sprintf "[%s:%s]" (formatNum fx) (formatNum tx)) 75 | 76 | /// Type that allows elegant construction of ranges specifying only Y range 77 | type RangeImplY() = 78 | member x.GetSlice(fy, ty) = 79 | Range(yspec = sprintf "[%s:%s]" (formatNum fy) (formatNum ty)) 80 | 81 | /// Module with values for elegant construction of ranges. This module is automatically 82 | /// opened, so you do not need to open it explicitly. This lets you specify ranges using 83 | /// the following notation: 84 | /// 85 | /// // Specify the upper bound on X axis 86 | /// RangeX.[ .. 10.0] 87 | /// 88 | /// // Specify the upper bound on Y axis 89 | /// RangeY.[ .. 10.0] 90 | /// 91 | /// // Specify both X and Y axes 92 | /// Range.[-10.0 .. , 2.0 .. 8.0] 93 | /// 94 | [] 95 | module Ranges = 96 | open Internal 97 | 98 | /// Ranges can be constructed using the slicing syntax. 99 | /// For example: 100 | /// 101 | /// Range.[-10.0 .. , 2.0 .. 8.0] 102 | let Range = RangeImplXY() 103 | /// Ranges can be constructed using the slicing syntax. 104 | /// For example: 105 | /// 106 | /// RangeX.[ .. 10.0] 107 | let RangeX = RangeImplX() 108 | /// Ranges can be constructed using the slicing syntax. 109 | /// For example: 110 | /// 111 | /// RangeY.[ .. 10.0] 112 | let RangeY = RangeImplY() 113 | 114 | // ---------------------------------------------------------------------------- 115 | // Formatting of arguments passed to plot and constriction of various types 116 | // of series (Lines, Histogram, ... other options TBD.) 117 | // ---------------------------------------------------------------------------- 118 | 119 | /// [omit] 120 | /// Module that contains formatting of various gnuplot arguments 121 | module InternalFormat = 122 | let formatNumArg s = formatArg (sprintf " %s %d" s) 123 | let formatTitle = formatArg (sprintf " t '%s'") 124 | let formatColor s = formatArg (fun (color:Color) -> 125 | sprintf " %s rgb '#%02x%02x%02x'" s color.R color.G color.B) 126 | let formatFill = formatArg (function 127 | | Solid -> " fs solid" 128 | | Pattern(n) -> sprintf " fs pattern %d" n) 129 | let formatRotate s = formatArg (sprintf "set %s rotate by %d" s) 130 | let formatTitles tics = formatArg (fun list -> 131 | let titles = 132 | [ for t, n in Seq.zip list [0 .. (List.length list) - 1] do 133 | yield sprintf "\"%s\" %d" t n ] 134 | |> String.concat ", " 135 | sprintf "set %s (%s)" tics titles ) 136 | let formatTimeForXaxis = formatArg (sprintf "set timefmt \"%s\" \nset xdata time") 137 | 138 | open InternalFormat 139 | 140 | /// Data that is passed as an argument to the `Series` type. For most of the types, 141 | /// we use one of the `Data` cases; `Function` is used when specifying function as a string. 142 | /// You do not need to create `Data` values directly. Instead, use `Series.Line`, 143 | /// `Series.Points`, etc. with the appropriate input type. 144 | type Data = 145 | /// Sequence of numerical values. The index of an item is the X value, the number is the Y value 146 | | DataY of float seq 147 | /// Sequence of X and Y coordinates. The first element of the tuple is the X value, the second is the Y value 148 | | DataXY of (float*float) seq 149 | /// Sequence of X and Y coordinates where the X is `DateTime`. The `DateTime` determines the position on the 150 | /// X axis. This cannot be mixed with the other Data type options such as DataXY. 151 | | DataTimeY of (DateTime*float) seq 152 | /// A string holding a function of X in the gnuplot format, e.g. `sin(x)`. The range of X comes from the other 153 | /// Data series on the plot, or from the optional `Range` object. 154 | | Function of string 155 | 156 | /// Represents the different types or styles of series. Roughly corresponds to the gnuPlot 'with lines', 'with points' etc. 157 | type SeriesType = 158 | /// Series will be displayed as lines 159 | | Lines 160 | /// Series will be displayed as a histogram. 161 | | Histogram 162 | /// Series will be displayed as points 163 | | Points 164 | /// Series will be displayed as impulses 165 | | Impulses 166 | 167 | /// Represents a series of data for the `gp.Plot` function 168 | /// The type can be constructed directly (by setting the `plot` parameter 169 | /// to the desired series type) or indirectly using static 170 | /// members such as 'Series.Histogram' 171 | type Series(plot, data, ?title, ?lineColor, ?weight, ?fill) = 172 | let plotText = 173 | match plot with 174 | | Lines -> "lines" 175 | | Histogram -> "histogram" 176 | | Points -> "points" 177 | | Impulses -> "impulses" 178 | let cmd = 179 | (match data with 180 | | DataY _ -> " '-' using 1 with " + plotText 181 | | DataXY _ | DataTimeY _ -> " '-' using 1:2 with " + plotText 182 | | Function f -> f + " with " + plotText) 183 | + (formatTitle title) 184 | + (formatNumArg "lw" weight) 185 | + (formatColor "lc" lineColor) 186 | + (formatFill fill) 187 | 188 | /// Returns the data of the series 189 | member x.Data = data 190 | /// Returns the formatted gnuplot command 191 | member x.Command = cmd 192 | 193 | /// Creates a line data series for a plot of y values 194 | static member Lines(data, ?title, ?lineColor, ?weight) = 195 | Series(Lines, DataY data, ?title=title, ?lineColor=lineColor, ?weight=weight) 196 | /// Creates a line data series for a plot of xy values 197 | static member Lines(data, ?title, ?lineColor, ?weight) = 198 | Series(Lines, DataXY data, ?title=title, ?lineColor=lineColor, ?weight=weight) 199 | /// Creates a line data series for a function 200 | static member Lines(data, ?title, ?lineColor, ?weight) = 201 | Series(Lines, Function data, ?title=title, ?lineColor=lineColor, ?weight=weight) 202 | /// Creates a line data series for a plot of DateTime and y values. 203 | static member Lines(data, ?title, ?lineColor, ?weight) = 204 | Series(Lines, DataTimeY data, ?title=title, ?lineColor=lineColor, ?weight=weight) 205 | 206 | /// Creates a points data series for a plot of y values 207 | static member Points(data, ?title, ?lineColor, ?weight) = 208 | Series(Points, DataY data, ?title=title, ?lineColor=lineColor, ?weight=weight) 209 | /// Creates a points data series for a plot of xy values 210 | static member Points(data, ?title, ?lineColor, ?weight) = 211 | Series(Points, DataXY data, ?title=title, ?lineColor=lineColor, ?weight=weight) 212 | /// Creates a points data series for a function 213 | static member Points(data, ?title, ?lineColor, ?weight) = 214 | Series(Points, Function data, ?title=title, ?lineColor=lineColor, ?weight=weight) 215 | /// Creates a points data series for a plot of DateTime and y values 216 | static member Points(data, ?title, ?lineColor, ?weight) = 217 | Series(Points, DataTimeY data, ?title=title, ?lineColor=lineColor, ?weight=weight) 218 | 219 | /// Creates an impulse data series for a plot of y values 220 | static member Impulses(data, ?title, ?lineColor, ?weight) = 221 | Series(Impulses, DataY data, ?title=title, ?lineColor=lineColor, ?weight=weight) 222 | /// Creates an impulse data series for a plot of xy values 223 | static member Impulses(data, ?title, ?lineColor, ?weight) = 224 | Series(Impulses, DataXY data, ?title=title, ?lineColor=lineColor, ?weight=weight) 225 | /// Creates an impulse data series for a function 226 | static member Impulses(data, ?title, ?lineColor, ?weight) = 227 | Series(Impulses, Function data, ?title=title, ?lineColor=lineColor, ?weight=weight) 228 | /// Creates an impulse data series for a plot of DateTime and y values 229 | static member Impulses(data, ?title, ?lineColor, ?weight) = 230 | Series(Impulses, DataTimeY data, ?title=title, ?lineColor=lineColor, ?weight=weight) 231 | 232 | /// Creates a histogram data series for a plot 233 | static member Histogram(data, ?title, ?lineColor, ?weight, ?fill) = 234 | Series(Histogram, DataY data, ?title=title, ?lineColor=lineColor, ?weight=weight, ?fill=fill) 235 | 236 | /// Represents a style of a plot (can be passed to the Plot method 237 | /// to set style for single plotting or to the Set method to set the 238 | /// style globally) 239 | type Style(?fill) = 240 | let cmd = 241 | [ formatFill fill; ] 242 | |> List.filter (String.IsNullOrEmpty >> not) 243 | |> List.map (sprintf "set style %s\n") 244 | |> String.concat "" 245 | interface ICommand with 246 | member x.Command = cmd 247 | member x.Cleanup = "" // not implemented 248 | 249 | 250 | /// Various output types that can be specified to gnuplot. Currently, the 251 | /// wrapper supports the following options: 252 | /// 253 | /// - `OutputType.X11` for charts that are opened in a new window 254 | /// - `OutputType.Png` for saving charts to a PNG file. 255 | /// - `OutputType.Eps` for saving charts to an EPS file. 256 | type OutputType = 257 | /// Creates charts in a new window 258 | | X11 259 | /// Creates charts in a new Qt window on OS X 260 | | Qt 261 | /// Saves charts to a specified PNG file 262 | | Png of string 263 | /// Saves charts to a specified EPS file 264 | | Eps of string 265 | 266 | /// The type can be used to specify output type for `gnuplot`. The type 267 | /// combines a value of `OutputType` with additional parameters such as fonts. 268 | /// For example, to create a PNG, you can use: 269 | /// 270 | /// gp.Set(output = Output(Png("/temp/test.png"))) 271 | /// 272 | type Output(output:OutputType, ?font) = 273 | interface ICommand with 274 | member x.Command = 275 | let font = font |> formatArg (sprintf " font '%s'") 276 | match output with 277 | | X11 -> "set term x11" + font 278 | | Qt -> "set terminal qt" + font 279 | | Png(s) -> sprintf "set term png%s\nset output '%s'" font s 280 | | Eps(s) -> sprintf "set term postscript eps enhanced%s\nset output '%s'" font s 281 | member x.Cleanup = "set term x11" 282 | 283 | /// Used to specify titles for the X and Y axes. In addition to the text for the labels, 284 | /// you can also specify the rotation of the labels. For example: 285 | /// 286 | /// // specify rotated titles for x axis 287 | /// Titles(x=["one"; "two"], xrotate=-70) 288 | /// 289 | type Titles(?x, ?xrotate, ?y, ?yrotate) = 290 | let cmd = 291 | [ formatRotate "xtic" xrotate, "set xtic rotate by 0" 292 | formatRotate "ytic" yrotate, "set ytic rotate by 0" 293 | formatTitles "xtics" x, "set xtics auto" 294 | formatTitles "ytics" y, "set ytics auto" ] 295 | |> List.filter (fun (s, _) -> s <> "") 296 | interface ICommand with 297 | member x.Command = 298 | cmd |> List.map fst |> String.concat "\n" 299 | member x.Cleanup = 300 | cmd |> List.map snd |> String.concat "\n" 301 | 302 | 303 | /// Used to specify datetime format for the x and y axes, if they contain time data. 304 | /// The parameter `format` is a gnuplot time format; for more information 305 | /// [refer to the gnuplot documentation](http://gnuplot.sourceforge.net/docs_4.2/node274.html). 306 | type TimeFormatX(?format) = 307 | let cmd = 308 | [ formatTimeForXaxis format , "set xdata"] 309 | |> List.filter (fun (s, _) -> s <> "") 310 | interface ICommand with 311 | member x.Command = 312 | cmd |> List.map fst |> String.concat "\n" 313 | member x.Cleanup = 314 | cmd |> List.map snd |> String.concat "\n" 315 | 316 | /// [omit] 317 | /// The below two values control Gnuplot's display of DateTimes. They must match. 318 | [] 319 | module timeFormatting = 320 | let selectedTimeGnuplotFormat = """%d-%b-%Y-%H:%M:%S""" //format that Gnuplot will expect. see http://gnuplot.sourceforge.net/docs_4.2/node274.html 321 | let dateTimeToSelectedGnuplotFormat (t:DateTime) = t.ToString("dd-MMM-yyyy-HH:mm:ss") //converts a DateTime to a string in the above format. See http://msdn.microsoft.com/en-us/library/8kb3ddd4(v=vs.110).aspx 322 | 323 | 324 | // ---------------------------------------------------------------------------- 325 | // The main type that wraps the gnuplot process 326 | // ---------------------------------------------------------------------------- 327 | 328 | /// The main type of the library. It provides a wrapper for calling gnuplot from F#. 329 | /// Plots are drawn using the `Plot` function and can be created using the `Series` type. 330 | /// For example: 331 | /// 332 | /// // Create gnuplot process 333 | /// let gp = GnuPlot() 334 | /// 335 | /// // Plot a function specified as a string 336 | /// gp.Plot("sin(x)") 337 | /// 338 | /// // Create a simple line plot 339 | /// gp.Plot(Series.Lines [2.0; 1.0; 2.0; 5.0]) 340 | /// 341 | /// // Create a histogram plot drawn using blue color 342 | /// gp.Plot(Series.Histogram(lineColor=Color.Blue, data=[2.0; 1.0; 2.0; 5.0])) 343 | /// 344 | type GnuPlot private (actualPath:string) = 345 | // Start the gnuplot process when the class is created 346 | let gp = 347 | new ProcessStartInfo 348 | (FileName = actualPath, UseShellExecute = false, Arguments = "", 349 | RedirectStandardError = true, CreateNoWindow = true, 350 | RedirectStandardOutput = true, RedirectStandardInput = true) 351 | |> Process.Start 352 | 353 | 354 | [] 355 | let DEBUGGING = false 356 | 357 | // Provide event for reading gnuplot messages 358 | let msgEvent = 359 | Event.merge gp.OutputDataReceived gp.ErrorDataReceived 360 | |> Event.map (fun de -> de.Data) 361 | do 362 | if DEBUGGING then 363 | msgEvent.Add (fun output -> System.Diagnostics.Debug.Print(output + "\n")) 364 | gp.BeginOutputReadLine() 365 | gp.BeginErrorReadLine() 366 | gp.EnableRaisingEvents <- true 367 | 368 | // Send command to gnuplot process 369 | let sendCommand(str:string) = 370 | gp.StandardInput.Write(str + "\n") 371 | if DEBUGGING then 372 | System.Diagnostics.Debug.Print (">>" + str + "\n") 373 | 374 | /// Create a new instance of the `GnuPlot` object. This starts the `gnuplot` 375 | /// process in the background. The optional parameter `path` can be used to 376 | /// specify `gnuplot` location if it is not available in `PATH`. 377 | new(?path:string) = new GnuPlot(actualPath=defaultArg path "gnuplot") 378 | 379 | // We want to dipose of the running process when the wrapper is disposed 380 | // The following bits implement proper 'disposal' pattern 381 | member private x.Dispose(disposing) = 382 | try 383 | gp.Kill() 384 | if disposing then gp.Dispose() 385 | with 386 | _->() 387 | 388 | /// [omit] 389 | override x.Finalize() = 390 | try 391 | x.Dispose(false) 392 | with 393 | _->() 394 | 395 | interface System.IDisposable with 396 | member x.Dispose() = 397 | x.Dispose(true) 398 | System.GC.SuppressFinalize(x) 399 | 400 | // Write data to the gnuplot command line 401 | member private x.WriteData(data:Data) = 402 | match data with 403 | | DataY data -> 404 | for yPt in data do 405 | x.SendCommand(string yPt) 406 | x.SendCommand("e") 407 | | DataXY data -> 408 | for (xPt,yPt) in data do 409 | x.SendCommand((string xPt) + " " + (string yPt)) 410 | x.SendCommand("e") 411 | | DataTimeY data -> 412 | for (timePt,yPt) in data do 413 | x.SendCommand( (dateTimeToSelectedGnuplotFormat timePt) + " " + (string yPt)) 414 | x.SendCommand("e") 415 | | _ -> () 416 | 417 | // -------------------------------------------------------------------------- 418 | // Public members that can be called by the user 419 | 420 | /// Send a string command directly to the gnuplot process. 421 | member x.SendCommand(str) = sendCommand(str) 422 | 423 | /// Set a style or a range of the gnuplot session. For example: 424 | /// 425 | /// // set fill style to a numbered pattern 426 | /// gp.Set(style = Style(fill = Pattern(3))) 427 | /// 428 | /// // set the X range of the output plot to [-10:] 429 | /// gp.Set(range = RangeX.[-10.0 .. ] 430 | /// 431 | member x.Set(?style:Style, ?range:Internal.Range, ?output:Output, ?titles:Titles, ?TimeFormatX:TimeFormatX) = 432 | let commands = List.concat [ commandList output; commandList style; commandList range; commandList titles ; commandList TimeFormatX] 433 | for cmd in commands do 434 | //printfn "Setting:\n%s" cmd.Command 435 | x.SendCommand(cmd.Command) 436 | 437 | /// Reset style or range set previously (used mainly internally) 438 | member x.Unset(?style:Style, ?range:Internal.Range) = 439 | let commands = List.concat [ commandList style; commandList range ] 440 | for cmd in commands do 441 | if "" <> cmd.Cleanup then x.SendCommand(cmd.Cleanup) 442 | 443 | /// Draw a plot specified as a string. Range and style can 444 | /// be specified using optional parameters. For example: 445 | /// 446 | /// // draw sin(x) function 447 | /// gp.Plot("sin(x)") 448 | /// 449 | member x.Plot(func:string, ?style, ?range, ?output, ?titles) = 450 | x.Plot([Series.Lines(func)], ?style=style, ?range=range, ?output=output, ?titles=titles) 451 | 452 | /// Draw a plot of a single data series. Range and style can 453 | /// be specified using optional parameters. For example: 454 | /// 455 | /// // Create a simple line plot 456 | /// gp.Plot(Series.Lines [2.0; 1.0; 2.0; 5.0], 457 | /// range = RangeY.[-1.0 ..]) 458 | /// 459 | member x.Plot(data:Series, ?style, ?range, ?output, ?titles) = 460 | x.Plot([data], ?style=style, ?range=range, ?output=output, ?titles=titles) 461 | 462 | /// Draw a plot consisting of multiple data series. Range and 463 | /// style can be specified using optional parameters. For example: 464 | /// 465 | /// // Create a simple line plot 466 | /// gp.Plot 467 | /// [ Series.Lines(title="Lines", data=[2.0; 1.0; 2.0; 5.0]) 468 | /// Series.Histogram(fill=Solid, data=[2.0; 1.0; 2.0; 5.0]) ] 469 | /// 470 | member x.Plot(data:seq, ?style:Style, ?range:Internal.Range, ?output:Output, ?titles:Titles) = 471 | //Set up the plot format. 472 | match (Seq.head data).Data with 473 | | DataTimeY _ -> //Plotting time ranges requires special setup of the time format 474 | let timeFmt = Some (TimeFormatX(selectedTimeGnuplotFormat)) 475 | x.Set(?style=style, ?range=range, ?output=output, ?titles=titles, ?TimeFormatX = timeFmt) 476 | | _ -> //normal non-time plot 477 | x.Set(?style=style, ?range=range, ?output=output, ?titles=titles) 478 | 479 | //plot each Series 480 | let cmd = 481 | "plot \\\n" + 482 | ( [ for s in data -> s.Command ] 483 | |> String.concat ", \\\n" ) 484 | x.SendCommand(cmd) 485 | for s in data do 486 | x.WriteData(s.Data) 487 | //undo plot format setup 488 | x.Unset(?style=style, ?range=range) 489 | 490 | -------------------------------------------------------------------------------- /src/FnuPlot/FnuPlot.fsproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | 2.0 8 | 7e90d6ce-a10b-4858-a5bc-41df7250cbca 9 | Library 10 | FnuPlot 11 | FnuPlot 12 | v4.5 13 | 4.3.0.0 14 | FnuPlot 15 | 16 | 17 | 18 | true 19 | full 20 | false 21 | false 22 | ..\..\bin 23 | DEBUG;TRACE 24 | 3 25 | ..\..\bin\FnuPlot.xml 26 | 27 | 28 | pdbonly 29 | true 30 | true 31 | ..\..\bin 32 | TRACE 33 | 3 34 | ..\..\bin\FnuPlot.xml 35 | 36 | 37 | 38 | 39 | False 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 11 51 | 52 | 53 | 54 | 55 | $(MSBuildExtensionsPath32)\..\Microsoft SDKs\F#\3.0\Framework\v4.0\Microsoft.FSharp.Targets 56 | 57 | 58 | 59 | 60 | $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\FSharp\Microsoft.FSharp.Targets 61 | 62 | 63 | 64 | 65 | 72 | 73 | 74 | -------------------------------------------------------------------------------- /src/FnuPlot/paket.references: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fsprojects/FnuPlot/07c130d385a0a27e7f560574a926f768c15b4feb/src/FnuPlot/paket.references -------------------------------------------------------------------------------- /tests/FnuPlot.Tests/FnuPlot.Tests.fsproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Debug 7 | AnyCPU 8 | 2.0 9 | e789c72a-5cfd-436b-8ef1-61aa2852a89f 10 | Library 11 | FnuPlot.Tests 12 | FnuPlot.Tests 13 | v4.0 14 | 4.3.0.0 15 | FnuPlot.Tests 16 | 17 | ..\..\ 18 | 19 | 20 | true 21 | full 22 | false 23 | false 24 | bin\Debug\ 25 | DEBUG;TRACE 26 | 3 27 | bin\Debug\fsharp_project_scaffold_tests.XML 28 | Project 29 | 30 | 31 | 32 | 33 | 34 | 35 | pdbonly 36 | true 37 | true 38 | bin\Release\ 39 | TRACE 40 | 3 41 | bin\Release\FnuPlot.Tests.xml 42 | 43 | 44 | 11 45 | 46 | 47 | 48 | 49 | $(MSBuildExtensionsPath32)\..\Microsoft SDKs\F#\3.0\Framework\v4.0\Microsoft.FSharp.Targets 50 | 51 | 52 | 53 | 54 | $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\FSharp\Microsoft.FSharp.Targets 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | <__paket__NETStandard_Library_targets>netstandard2.0\NETStandard.Library 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | True 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | FnuPlot 83 | {7e90d6ce-a10b-4858-a5bc-41df7250cbca} 84 | True 85 | 86 | 87 | 94 | 95 | 96 | 97 | 98 | 99 | ..\..\packages\Microsoft.Win32.Primitives\ref\netstandard1.3\Microsoft.Win32.Primitives.dll 100 | False 101 | True 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | ..\..\packages\NUnit\lib\net20\NUnit.System.Linq.dll 111 | True 112 | True 113 | 114 | 115 | ..\..\packages\NUnit\lib\net20\nunit.framework.dll 116 | True 117 | True 118 | 119 | 120 | 121 | 122 | 123 | 124 | ..\..\packages\NUnit\lib\net35\nunit.framework.dll 125 | True 126 | True 127 | 128 | 129 | 130 | 131 | 132 | 133 | ..\..\packages\NUnit\lib\net40\nunit.framework.dll 134 | True 135 | True 136 | 137 | 138 | 139 | 140 | 141 | 142 | ..\..\packages\NUnit\lib\net45\nunit.framework.dll 143 | True 144 | True 145 | 146 | 147 | 148 | 149 | 150 | 151 | ..\..\packages\NUnit\lib\netstandard1.6\nunit.framework.dll 152 | True 153 | True 154 | 155 | 156 | 157 | 158 | 159 | 160 | ..\..\packages\NUnit\lib\netstandard2.0\nunit.framework.dll 161 | True 162 | True 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | ..\..\packages\System.AppContext\ref\netstandard1.3\System.AppContext.dll 172 | False 173 | True 174 | 175 | 176 | 177 | 178 | 179 | 180 | ..\..\packages\System.AppContext\lib\netstandard1.6\System.AppContext.dll 181 | True 182 | True 183 | 184 | 185 | 186 | 187 | 188 | 189 | ..\..\packages\System.AppContext\ref\netstandard1.6\System.AppContext.dll 190 | False 191 | True 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | ..\..\packages\System.Buffers\lib\netstandard1.1\System.Buffers.dll 201 | True 202 | True 203 | 204 | 205 | 206 | 207 | 208 | 209 | ..\..\packages\System.Buffers\ref\netstandard1.1\System.Buffers.dll 210 | False 211 | True 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | ..\..\packages\System.Collections\ref\netstandard1.0\System.Collections.dll 221 | False 222 | True 223 | 224 | 225 | 226 | 227 | 228 | 229 | ..\..\packages\System.Collections\ref\netstandard1.3\System.Collections.dll 230 | False 231 | True 232 | 233 | 234 | 235 | 236 | 237 | 238 | 239 | 240 | ..\..\packages\System.Collections.Concurrent\ref\netstandard1.1\System.Collections.Concurrent.dll 241 | False 242 | True 243 | 244 | 245 | 246 | 247 | 248 | 249 | ..\..\packages\System.Collections.Concurrent\lib\netstandard1.3\System.Collections.Concurrent.dll 250 | True 251 | True 252 | 253 | 254 | 255 | 256 | 257 | 258 | ..\..\packages\System.Collections.Concurrent\ref\netstandard1.3\System.Collections.Concurrent.dll 259 | False 260 | True 261 | 262 | 263 | 264 | 265 | 266 | 267 | 268 | 269 | ..\..\packages\System.Console\ref\netstandard1.3\System.Console.dll 270 | False 271 | True 272 | 273 | 274 | 275 | 276 | 277 | 278 | 279 | 280 | ..\..\packages\System.Diagnostics.Debug\ref\netstandard1.0\System.Diagnostics.Debug.dll 281 | False 282 | True 283 | 284 | 285 | 286 | 287 | 288 | 289 | ..\..\packages\System.Diagnostics.Debug\ref\netstandard1.3\System.Diagnostics.Debug.dll 290 | False 291 | True 292 | 293 | 294 | 295 | 296 | 297 | 298 | 299 | 300 | ..\..\packages\System.Diagnostics.DiagnosticSource\lib\netstandard1.3\System.Diagnostics.DiagnosticSource.dll 301 | True 302 | True 303 | 304 | 305 | 306 | 307 | 308 | 309 | 310 | 311 | ..\..\packages\System.Diagnostics.Tools\ref\netstandard1.0\System.Diagnostics.Tools.dll 312 | False 313 | True 314 | 315 | 316 | 317 | 318 | 319 | 320 | 321 | 322 | ..\..\packages\System.Diagnostics.Tracing\ref\netstandard1.1\System.Diagnostics.Tracing.dll 323 | False 324 | True 325 | 326 | 327 | 328 | 329 | 330 | 331 | ..\..\packages\System.Diagnostics.Tracing\ref\netstandard1.2\System.Diagnostics.Tracing.dll 332 | False 333 | True 334 | 335 | 336 | 337 | 338 | 339 | 340 | ..\..\packages\System.Diagnostics.Tracing\ref\netstandard1.3\System.Diagnostics.Tracing.dll 341 | False 342 | True 343 | 344 | 345 | 346 | 347 | 348 | 349 | ..\..\packages\System.Diagnostics.Tracing\ref\netstandard1.5\System.Diagnostics.Tracing.dll 350 | False 351 | True 352 | 353 | 354 | 355 | 356 | 357 | 358 | 359 | 360 | ..\..\packages\System.Globalization\ref\netstandard1.0\System.Globalization.dll 361 | False 362 | True 363 | 364 | 365 | 366 | 367 | 368 | 369 | ..\..\packages\System.Globalization\ref\netstandard1.3\System.Globalization.dll 370 | False 371 | True 372 | 373 | 374 | 375 | 376 | 377 | 378 | 379 | 380 | ..\..\packages\System.Globalization.Calendars\ref\netstandard1.3\System.Globalization.Calendars.dll 381 | False 382 | True 383 | 384 | 385 | 386 | 387 | 388 | 389 | 390 | 391 | ..\..\packages\System.Globalization.Extensions\ref\netstandard1.3\System.Globalization.Extensions.dll 392 | False 393 | True 394 | 395 | 396 | 397 | 398 | 399 | 400 | 401 | 402 | ..\..\packages\System.IO\ref\netstandard1.0\System.IO.dll 403 | False 404 | True 405 | 406 | 407 | 408 | 409 | 410 | 411 | ..\..\packages\System.IO\ref\netstandard1.3\System.IO.dll 412 | False 413 | True 414 | 415 | 416 | 417 | 418 | 419 | 420 | ..\..\packages\System.IO\ref\netstandard1.5\System.IO.dll 421 | False 422 | True 423 | 424 | 425 | 426 | 427 | 428 | 429 | 430 | 431 | ..\..\packages\System.IO.Compression\ref\netstandard1.1\System.IO.Compression.dll 432 | False 433 | True 434 | 435 | 436 | 437 | 438 | 439 | 440 | ..\..\packages\System.IO.Compression\ref\netstandard1.3\System.IO.Compression.dll 441 | False 442 | True 443 | 444 | 445 | 446 | 447 | 448 | 449 | 450 | 451 | ..\..\packages\System.IO.Compression.ZipFile\lib\netstandard1.3\System.IO.Compression.ZipFile.dll 452 | True 453 | True 454 | 455 | 456 | 457 | 458 | 459 | 460 | ..\..\packages\System.IO.Compression.ZipFile\ref\netstandard1.3\System.IO.Compression.ZipFile.dll 461 | False 462 | True 463 | 464 | 465 | 466 | 467 | 468 | 469 | 470 | 471 | ..\..\packages\System.IO.FileSystem\ref\netstandard1.3\System.IO.FileSystem.dll 472 | False 473 | True 474 | 475 | 476 | 477 | 478 | 479 | 480 | 481 | 482 | ..\..\packages\System.IO.FileSystem.Primitives\lib\netstandard1.3\System.IO.FileSystem.Primitives.dll 483 | True 484 | True 485 | 486 | 487 | 488 | 489 | 490 | 491 | ..\..\packages\System.IO.FileSystem.Primitives\ref\netstandard1.3\System.IO.FileSystem.Primitives.dll 492 | False 493 | True 494 | 495 | 496 | 497 | 498 | 499 | 500 | 501 | 502 | ..\..\packages\System.Linq\ref\netstandard1.0\System.Linq.dll 503 | False 504 | True 505 | 506 | 507 | 508 | 509 | 510 | 511 | ..\..\packages\System.Linq\lib\netstandard1.6\System.Linq.dll 512 | True 513 | True 514 | 515 | 516 | 517 | 518 | 519 | 520 | ..\..\packages\System.Linq\ref\netstandard1.6\System.Linq.dll 521 | False 522 | True 523 | 524 | 525 | 526 | 527 | 528 | 529 | 530 | 531 | ..\..\packages\System.Linq.Expressions\ref\netstandard1.0\System.Linq.Expressions.dll 532 | False 533 | True 534 | 535 | 536 | 537 | 538 | 539 | 540 | ..\..\packages\System.Linq.Expressions\ref\netstandard1.3\System.Linq.Expressions.dll 541 | False 542 | True 543 | 544 | 545 | 546 | 547 | 548 | 549 | ..\..\packages\System.Linq.Expressions\lib\netstandard1.6\System.Linq.Expressions.dll 550 | True 551 | True 552 | 553 | 554 | 555 | 556 | 557 | 558 | ..\..\packages\System.Linq.Expressions\ref\netstandard1.6\System.Linq.Expressions.dll 559 | False 560 | True 561 | 562 | 563 | 564 | 565 | 566 | 567 | 568 | 569 | ..\..\packages\System.Net.Http\ref\netstandard1.1\System.Net.Http.dll 570 | False 571 | True 572 | 573 | 574 | 575 | 576 | 577 | 578 | ..\..\packages\System.Net.Http\ref\netstandard1.3\System.Net.Http.dll 579 | False 580 | True 581 | 582 | 583 | 584 | 585 | 586 | 587 | 588 | 589 | ..\..\packages\System.Net.Primitives\ref\netstandard1.1\System.Net.Primitives.dll 590 | False 591 | True 592 | 593 | 594 | 595 | 596 | 597 | 598 | ..\..\packages\System.Net.Primitives\ref\netstandard1.3\System.Net.Primitives.dll 599 | False 600 | True 601 | 602 | 603 | 604 | 605 | 606 | 607 | 608 | 609 | ..\..\packages\System.Net.Sockets\ref\netstandard1.3\System.Net.Sockets.dll 610 | False 611 | True 612 | 613 | 614 | 615 | 616 | 617 | 618 | 619 | 620 | ..\..\packages\System.ObjectModel\ref\netstandard1.0\System.ObjectModel.dll 621 | False 622 | True 623 | 624 | 625 | 626 | 627 | 628 | 629 | ..\..\packages\System.ObjectModel\lib\netstandard1.3\System.ObjectModel.dll 630 | True 631 | True 632 | 633 | 634 | 635 | 636 | 637 | 638 | ..\..\packages\System.ObjectModel\ref\netstandard1.3\System.ObjectModel.dll 639 | False 640 | True 641 | 642 | 643 | 644 | 645 | 646 | 647 | 648 | 649 | ..\..\packages\System.Reflection\ref\netstandard1.0\System.Reflection.dll 650 | False 651 | True 652 | 653 | 654 | 655 | 656 | 657 | 658 | ..\..\packages\System.Reflection\ref\netstandard1.3\System.Reflection.dll 659 | False 660 | True 661 | 662 | 663 | 664 | 665 | 666 | 667 | ..\..\packages\System.Reflection\ref\netstandard1.5\System.Reflection.dll 668 | False 669 | True 670 | 671 | 672 | 673 | 674 | 675 | 676 | 677 | 678 | ..\..\packages\System.Reflection.Emit\ref\netstandard1.1\System.Reflection.Emit.dll 679 | False 680 | True 681 | 682 | 683 | 684 | 685 | 686 | 687 | ..\..\packages\System.Reflection.Emit\lib\netstandard1.3\System.Reflection.Emit.dll 688 | True 689 | True 690 | 691 | 692 | 693 | 694 | 695 | 696 | 697 | 698 | ..\..\packages\System.Reflection.Emit.ILGeneration\ref\netstandard1.0\System.Reflection.Emit.ILGeneration.dll 699 | False 700 | True 701 | 702 | 703 | 704 | 705 | 706 | 707 | ..\..\packages\System.Reflection.Emit.ILGeneration\lib\netstandard1.3\System.Reflection.Emit.ILGeneration.dll 708 | True 709 | True 710 | 711 | 712 | 713 | 714 | 715 | 716 | 717 | 718 | ..\..\packages\System.Reflection.Emit.Lightweight\ref\netstandard1.0\System.Reflection.Emit.Lightweight.dll 719 | False 720 | True 721 | 722 | 723 | 724 | 725 | 726 | 727 | ..\..\packages\System.Reflection.Emit.Lightweight\lib\netstandard1.3\System.Reflection.Emit.Lightweight.dll 728 | True 729 | True 730 | 731 | 732 | 733 | 734 | 735 | 736 | 737 | 738 | ..\..\packages\System.Reflection.Extensions\ref\netstandard1.0\System.Reflection.Extensions.dll 739 | False 740 | True 741 | 742 | 743 | 744 | 745 | 746 | 747 | 748 | 749 | ..\..\packages\System.Reflection.Primitives\ref\netstandard1.0\System.Reflection.Primitives.dll 750 | False 751 | True 752 | 753 | 754 | 755 | 756 | 757 | 758 | 759 | 760 | ..\..\packages\System.Reflection.TypeExtensions\lib\netcoreapp1.0\System.Reflection.TypeExtensions.dll 761 | True 762 | True 763 | 764 | 765 | 766 | 767 | 768 | 769 | ..\..\packages\System.Reflection.TypeExtensions\lib\netstandard1.5\System.Reflection.TypeExtensions.dll 770 | True 771 | True 772 | 773 | 774 | 775 | 776 | 777 | 778 | ..\..\packages\System.Reflection.TypeExtensions\ref\netstandard1.5\System.Reflection.TypeExtensions.dll 779 | False 780 | True 781 | 782 | 783 | 784 | 785 | 786 | 787 | 788 | 789 | ..\..\packages\System.Resources.ResourceManager\ref\netstandard1.0\System.Resources.ResourceManager.dll 790 | False 791 | True 792 | 793 | 794 | 795 | 796 | 797 | 798 | 799 | 800 | ..\..\packages\System.Runtime\ref\netstandard1.0\System.Runtime.dll 801 | False 802 | True 803 | 804 | 805 | 806 | 807 | 808 | 809 | ..\..\packages\System.Runtime\ref\netstandard1.2\System.Runtime.dll 810 | False 811 | True 812 | 813 | 814 | 815 | 816 | 817 | 818 | ..\..\packages\System.Runtime\ref\netstandard1.3\System.Runtime.dll 819 | False 820 | True 821 | 822 | 823 | 824 | 825 | 826 | 827 | ..\..\packages\System.Runtime\ref\netstandard1.5\System.Runtime.dll 828 | False 829 | True 830 | 831 | 832 | 833 | 834 | 835 | 836 | 837 | 838 | ..\..\packages\System.Runtime.Extensions\ref\netstandard1.0\System.Runtime.Extensions.dll 839 | False 840 | True 841 | 842 | 843 | 844 | 845 | 846 | 847 | ..\..\packages\System.Runtime.Extensions\ref\netstandard1.3\System.Runtime.Extensions.dll 848 | False 849 | True 850 | 851 | 852 | 853 | 854 | 855 | 856 | ..\..\packages\System.Runtime.Extensions\ref\netstandard1.5\System.Runtime.Extensions.dll 857 | False 858 | True 859 | 860 | 861 | 862 | 863 | 864 | 865 | 866 | 867 | ..\..\packages\System.Runtime.Handles\ref\netstandard1.3\System.Runtime.Handles.dll 868 | False 869 | True 870 | 871 | 872 | 873 | 874 | 875 | 876 | 877 | 878 | ..\..\packages\System.Runtime.InteropServices\ref\netcoreapp1.1\System.Runtime.InteropServices.dll 879 | False 880 | True 881 | 882 | 883 | 884 | 885 | 886 | 887 | ..\..\packages\System.Runtime.InteropServices\ref\netstandard1.1\System.Runtime.InteropServices.dll 888 | False 889 | True 890 | 891 | 892 | 893 | 894 | 895 | 896 | ..\..\packages\System.Runtime.InteropServices\ref\netstandard1.2\System.Runtime.InteropServices.dll 897 | False 898 | True 899 | 900 | 901 | 902 | 903 | 904 | 905 | ..\..\packages\System.Runtime.InteropServices\ref\netstandard1.3\System.Runtime.InteropServices.dll 906 | False 907 | True 908 | 909 | 910 | 911 | 912 | 913 | 914 | ..\..\packages\System.Runtime.InteropServices\ref\netstandard1.5\System.Runtime.InteropServices.dll 915 | False 916 | True 917 | 918 | 919 | 920 | 921 | 922 | 923 | 924 | 925 | ..\..\packages\System.Runtime.InteropServices.RuntimeInformation\lib\netstandard1.1\System.Runtime.InteropServices.RuntimeInformation.dll 926 | True 927 | True 928 | 929 | 930 | 931 | 932 | 933 | 934 | ..\..\packages\System.Runtime.InteropServices.RuntimeInformation\ref\netstandard1.1\System.Runtime.InteropServices.RuntimeInformation.dll 935 | False 936 | True 937 | 938 | 939 | 940 | 941 | 942 | 943 | ..\..\packages\System.Runtime.InteropServices.RuntimeInformation\lib\wpa81\System.Runtime.InteropServices.RuntimeInformation.dll 944 | True 945 | True 946 | 947 | 948 | 949 | 950 | 951 | 952 | 953 | 954 | ..\..\packages\System.Runtime.Numerics\ref\netstandard1.1\System.Runtime.Numerics.dll 955 | False 956 | True 957 | 958 | 959 | 960 | 961 | 962 | 963 | ..\..\packages\System.Runtime.Numerics\lib\netstandard1.3\System.Runtime.Numerics.dll 964 | True 965 | True 966 | 967 | 968 | 969 | 970 | 971 | 972 | 973 | 974 | ..\..\packages\System.Security.Cryptography.Algorithms\ref\netstandard1.3\System.Security.Cryptography.Algorithms.dll 975 | False 976 | True 977 | 978 | 979 | 980 | 981 | 982 | 983 | ..\..\packages\System.Security.Cryptography.Algorithms\ref\netstandard1.4\System.Security.Cryptography.Algorithms.dll 984 | False 985 | True 986 | 987 | 988 | 989 | 990 | 991 | 992 | ..\..\packages\System.Security.Cryptography.Algorithms\ref\netstandard1.6\System.Security.Cryptography.Algorithms.dll 993 | False 994 | True 995 | 996 | 997 | 998 | 999 | 1000 | 1001 | 1002 | 1003 | ..\..\packages\System.Security.Cryptography.Cng\lib\netstandard1.6\System.Security.Cryptography.Cng.dll 1004 | True 1005 | True 1006 | 1007 | 1008 | 1009 | 1010 | 1011 | 1012 | ..\..\packages\System.Security.Cryptography.Cng\ref\netstandard1.6\System.Security.Cryptography.Cng.dll 1013 | False 1014 | True 1015 | 1016 | 1017 | 1018 | 1019 | 1020 | 1021 | 1022 | 1023 | ..\..\packages\System.Security.Cryptography.Csp\ref\netstandard1.3\System.Security.Cryptography.Csp.dll 1024 | False 1025 | True 1026 | 1027 | 1028 | 1029 | 1030 | 1031 | 1032 | 1033 | 1034 | ..\..\packages\System.Security.Cryptography.Encoding\ref\netstandard1.3\System.Security.Cryptography.Encoding.dll 1035 | False 1036 | True 1037 | 1038 | 1039 | 1040 | 1041 | 1042 | 1043 | 1044 | 1045 | ..\..\packages\System.Security.Cryptography.OpenSsl\lib\netstandard1.6\System.Security.Cryptography.OpenSsl.dll 1046 | True 1047 | True 1048 | 1049 | 1050 | 1051 | 1052 | 1053 | 1054 | ..\..\packages\System.Security.Cryptography.OpenSsl\ref\netstandard1.6\System.Security.Cryptography.OpenSsl.dll 1055 | False 1056 | True 1057 | 1058 | 1059 | 1060 | 1061 | 1062 | 1063 | 1064 | 1065 | ..\..\packages\System.Security.Cryptography.Primitives\lib\netstandard1.3\System.Security.Cryptography.Primitives.dll 1066 | True 1067 | True 1068 | 1069 | 1070 | 1071 | 1072 | 1073 | 1074 | ..\..\packages\System.Security.Cryptography.Primitives\ref\netstandard1.3\System.Security.Cryptography.Primitives.dll 1075 | False 1076 | True 1077 | 1078 | 1079 | 1080 | 1081 | 1082 | 1083 | 1084 | 1085 | ..\..\packages\System.Security.Cryptography.X509Certificates\ref\netstandard1.3\System.Security.Cryptography.X509Certificates.dll 1086 | False 1087 | True 1088 | 1089 | 1090 | 1091 | 1092 | 1093 | 1094 | ..\..\packages\System.Security.Cryptography.X509Certificates\ref\netstandard1.4\System.Security.Cryptography.X509Certificates.dll 1095 | False 1096 | True 1097 | 1098 | 1099 | 1100 | 1101 | 1102 | 1103 | 1104 | 1105 | ..\..\packages\System.Text.Encoding\ref\netstandard1.0\System.Text.Encoding.dll 1106 | False 1107 | True 1108 | 1109 | 1110 | 1111 | 1112 | 1113 | 1114 | ..\..\packages\System.Text.Encoding\ref\netstandard1.3\System.Text.Encoding.dll 1115 | False 1116 | True 1117 | 1118 | 1119 | 1120 | 1121 | 1122 | 1123 | 1124 | 1125 | ..\..\packages\System.Text.Encoding.Extensions\ref\netstandard1.0\System.Text.Encoding.Extensions.dll 1126 | False 1127 | True 1128 | 1129 | 1130 | 1131 | 1132 | 1133 | 1134 | ..\..\packages\System.Text.Encoding.Extensions\ref\netstandard1.3\System.Text.Encoding.Extensions.dll 1135 | False 1136 | True 1137 | 1138 | 1139 | 1140 | 1141 | 1142 | 1143 | 1144 | 1145 | ..\..\packages\System.Text.RegularExpressions\ref\netcoreapp1.1\System.Text.RegularExpressions.dll 1146 | False 1147 | True 1148 | 1149 | 1150 | 1151 | 1152 | 1153 | 1154 | ..\..\packages\System.Text.RegularExpressions\ref\netstandard1.0\System.Text.RegularExpressions.dll 1155 | False 1156 | True 1157 | 1158 | 1159 | 1160 | 1161 | 1162 | 1163 | ..\..\packages\System.Text.RegularExpressions\ref\netstandard1.3\System.Text.RegularExpressions.dll 1164 | False 1165 | True 1166 | 1167 | 1168 | 1169 | 1170 | 1171 | 1172 | ..\..\packages\System.Text.RegularExpressions\lib\netstandard1.6\System.Text.RegularExpressions.dll 1173 | True 1174 | True 1175 | 1176 | 1177 | 1178 | 1179 | 1180 | 1181 | ..\..\packages\System.Text.RegularExpressions\ref\netstandard1.6\System.Text.RegularExpressions.dll 1182 | False 1183 | True 1184 | 1185 | 1186 | 1187 | 1188 | 1189 | 1190 | 1191 | 1192 | ..\..\packages\System.Threading\ref\netstandard1.0\System.Threading.dll 1193 | False 1194 | True 1195 | 1196 | 1197 | 1198 | 1199 | 1200 | 1201 | ..\..\packages\System.Threading\lib\netstandard1.3\System.Threading.dll 1202 | True 1203 | True 1204 | 1205 | 1206 | 1207 | 1208 | 1209 | 1210 | ..\..\packages\System.Threading\ref\netstandard1.3\System.Threading.dll 1211 | False 1212 | True 1213 | 1214 | 1215 | 1216 | 1217 | 1218 | 1219 | 1220 | 1221 | ..\..\packages\System.Threading.Tasks\ref\netstandard1.0\System.Threading.Tasks.dll 1222 | False 1223 | True 1224 | 1225 | 1226 | 1227 | 1228 | 1229 | 1230 | ..\..\packages\System.Threading.Tasks\ref\netstandard1.3\System.Threading.Tasks.dll 1231 | False 1232 | True 1233 | 1234 | 1235 | 1236 | 1237 | 1238 | 1239 | 1240 | 1241 | ..\..\packages\System.Threading.Tasks.Extensions\lib\netstandard1.0\System.Threading.Tasks.Extensions.dll 1242 | True 1243 | True 1244 | 1245 | 1246 | 1247 | 1248 | 1249 | 1250 | 1251 | 1252 | ..\..\packages\System.Threading.Timer\ref\netstandard1.2\System.Threading.Timer.dll 1253 | False 1254 | True 1255 | 1256 | 1257 | 1258 | 1259 | 1260 | 1261 | 1262 | 1263 | ..\..\packages\System.Xml.ReaderWriter\ref\netstandard1.0\System.Xml.ReaderWriter.dll 1264 | False 1265 | True 1266 | 1267 | 1268 | 1269 | 1270 | 1271 | 1272 | ..\..\packages\System.Xml.ReaderWriter\lib\netstandard1.3\System.Xml.ReaderWriter.dll 1273 | True 1274 | True 1275 | 1276 | 1277 | 1278 | 1279 | 1280 | 1281 | ..\..\packages\System.Xml.ReaderWriter\ref\netstandard1.3\System.Xml.ReaderWriter.dll 1282 | False 1283 | True 1284 | 1285 | 1286 | 1287 | 1288 | 1289 | 1290 | 1291 | 1292 | ..\..\packages\System.Xml.XDocument\ref\netstandard1.0\System.Xml.XDocument.dll 1293 | False 1294 | True 1295 | 1296 | 1297 | 1298 | 1299 | 1300 | 1301 | ..\..\packages\System.Xml.XDocument\lib\netstandard1.3\System.Xml.XDocument.dll 1302 | True 1303 | True 1304 | 1305 | 1306 | 1307 | 1308 | 1309 | 1310 | ..\..\packages\System.Xml.XDocument\ref\netstandard1.3\System.Xml.XDocument.dll 1311 | False 1312 | True 1313 | 1314 | 1315 | 1316 | 1317 | 1318 | 1319 | -------------------------------------------------------------------------------- /tests/FnuPlot.Tests/Tests.fs: -------------------------------------------------------------------------------- 1 | module FnuPlot.Tests 2 | 3 | open FnuPlot 4 | open NUnit.Framework 5 | 6 | [] 7 | let ``TODO: Add some tests here!`` () = 8 | Assert.AreEqual(0, 0) 9 | -------------------------------------------------------------------------------- /tests/FnuPlot.Tests/paket.references: -------------------------------------------------------------------------------- 1 | NUnit 2 | NUnit.Runners --------------------------------------------------------------------------------