Compare commits
195 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 0762a29de3 | |||
| d6af1da35a | |||
| bbbee44c66 | |||
| 9499cef25d | |||
| 7c8952fadf | |||
| 8b2d3e926a | |||
| fb40ed1f59 | |||
| e88654cca5 | |||
| a9b9b3c357 | |||
| 99c8bfe12d | |||
| 3eb2b783dc | |||
| a20b275eaf | |||
| c29694ae70 | |||
| ebc93b6935 | |||
| 7dcbe911b1 | |||
| c2df99cc66 | |||
| a992effa5e | |||
| e49eb9bc83 | |||
| f2d7d394bb | |||
| 87d40cd34d | |||
| 5f24f88f12 | |||
| 9c465b58db | |||
| ad4a00c055 | |||
| 54671c15d7 | |||
| fff8f84acf | |||
| 4d8ea50f69 | |||
| 43f31cbc98 | |||
| d98e76e36d | |||
| e2a5e40019 | |||
| 3c2c2c18d7 | |||
| 0ee1d867c9 | |||
| b145ea9ef5 | |||
| 73971896ee | |||
| f5f4128e30 | |||
| 70dfa52a9a | |||
| 2e53c57114 | |||
| 0485b1313a | |||
| f0f28086a9 | |||
| 580ac8a9d1 | |||
| 84fc6b0be0 | |||
| de81220c01 | |||
| ee1f948448 | |||
| 995c7d349e | |||
| 4389160a6a | |||
| 8c6295658b | |||
| a270e342b7 | |||
| 42e2266530 | |||
| 02e6d729c1 | |||
| baac9a0578 | |||
| b73dd46521 | |||
| 7bbb2070a7 | |||
| 8859518f2d | |||
| 7f063c71b5 | |||
| 1e9691a7c0 | |||
| e5269bcf95 | |||
| fdd76a6ca1 | |||
| d19525c269 | |||
| 593331dec2 | |||
| b780d90097 | |||
| 2f9ce790e4 | |||
| d8f4519b0c | |||
| 702e41f55d | |||
| 682ac29fcd | |||
| c6ce23d0af | |||
| 9ae7d2dd9d | |||
| 6ec05628d5 | |||
| f26ebdc2f1 | |||
| c97255fc08 | |||
| 9d1ede016b | |||
| 7eb8f2452c | |||
| 0a6e691222 | |||
| 238aca6a78 | |||
| 1f039b3adc | |||
| 219465d599 | |||
| 1963cee94a | |||
| ae43e05f6f | |||
| 5cd2ba7296 | |||
| 4a00018f25 | |||
| 32c725e770 | |||
| 4e2ee35125 | |||
| 35b0751714 | |||
| 28ebc0ccd8 | |||
| 3d693d88e0 | |||
| 6ddf31d465 | |||
| 5c1ea707ca | |||
| a6669f89a0 | |||
| 2a2d509c36 | |||
| fd4efb3f33 | |||
| e90ab0b898 | |||
| 44367c54da | |||
| 3273a65889 | |||
| 0aa606d835 | |||
| 40848e7432 | |||
| fe4cc4d58c | |||
| 56f90ffaf3 | |||
| dfb556339f | |||
| 61f5a7f437 | |||
| 3be9b8d076 | |||
| 2a138dee40 | |||
| 712ef74b81 | |||
| ba8ca424cf | |||
| c6784a779b | |||
| d667cb7e57 | |||
| 10a5c2ed1d | |||
| 8cce78c890 | |||
| 294ade8aad | |||
| a59e8411c9 | |||
| d973f437ef | |||
| d5ce2c1431 | |||
| 834e2a99e3 | |||
| f8e9e33347 | |||
| a0c7781296 | |||
| 2ea998983d | |||
| e44b220b84 | |||
| 756cccb114 | |||
| af9982b804 | |||
| 1b946a18d2 | |||
| a397bfd549 | |||
| d276ac6857 | |||
| 475d1c2398 | |||
| d6ae848aec | |||
| 8976fc4ae4 | |||
| 095191f8e6 | |||
| 83ad031c13 | |||
| 2b1673df6f | |||
| b867ad58f8 | |||
| 8b897c3460 | |||
| e5cb36af7a | |||
| cdaa10be27 | |||
| fe3813b5af | |||
| 311bbdc99b | |||
| c90fa4d63c | |||
| 04c1c6c0ed | |||
| 47a8294d99 | |||
| f3cf8d884a | |||
| fe2d46d1eb | |||
| a0ba0e232e | |||
| 6565515446 | |||
| 65b0f44626 | |||
| b80ba99100 | |||
| 60980f7f7f | |||
| 5132bebc7f | |||
| 275738e7ea | |||
| 5759fd61ea | |||
| 577acbdeb6 | |||
| 4d94725797 | |||
| ad4f92e36d | |||
| 577ac33826 | |||
| 3275719f12 | |||
| f636edf4c0 | |||
| 84039a79de | |||
| d64ba707e9 | |||
| 703bdf6cfe | |||
| e7f79e9144 | |||
| 79fd7f282d | |||
| 3078a44fce | |||
| ba4f2665e0 | |||
| 5504f59098 | |||
| 265439fb2b | |||
| 450b36bdde | |||
| f1e7e3a4de | |||
| becfa33ee8 | |||
| ec5fa44f2a | |||
| 3152d4b4fe | |||
| 66d2e4746a | |||
| 39b10f05b9 | |||
| 5739acd044 | |||
| d1fb11ce97 | |||
| aa46f584b6 | |||
| 7c87cbb425 | |||
| 09de2ebc0e | |||
| 64f7dc1aed | |||
| 122b4d91a8 | |||
| d9efbbcf5b | |||
| d3629f3cfe | |||
| a9c659aa21 | |||
| 5d37264487 | |||
| 2fc6f9220d | |||
| c976a6de83 | |||
| 08c0f6d9a3 | |||
| fafb0d9510 | |||
| df6fa6fd68 | |||
| 8b5fc95443 | |||
| 4e877a206e | |||
| c428dcdb3e | |||
| 77b5951037 | |||
| a1c59b7904 | |||
| 8ae8d74c42 | |||
| eba4d2442c | |||
| d1938c5e94 | |||
| 3dbe5cc3a2 | |||
| 7a6617efe3 | |||
| 123eb15434 | |||
| df13011bd3 | |||
| 3368fd2c98 |
@@ -0,0 +1,32 @@
|
||||
---
|
||||
name: Bug report
|
||||
about: Create a bug report
|
||||
title: "[BUG]"
|
||||
labels: bug
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
<!-- Please search existing issues to avoid duplicates. -->
|
||||
|
||||
## Details
|
||||
|
||||
|
||||
### Backends
|
||||
|
||||
This bug occurs on ( insert `x` below )
|
||||
|
||||
Backend | yes | no | untested
|
||||
-------------|-----|-----|---------
|
||||
gr (default) | | |
|
||||
pyplot | | |
|
||||
plotly | | |
|
||||
plotlyjs | | |
|
||||
pgfplotsx | | |
|
||||
inspectdr | | |
|
||||
|
||||
### Versions
|
||||
|
||||
Plots.jl version:
|
||||
Backend version (`]st -m`):
|
||||
Output of `versioninfo()`:
|
||||
@@ -0,0 +1,10 @@
|
||||
---
|
||||
name: Feature request
|
||||
about: Suggest a feature or enhancement
|
||||
title: "[FR]"
|
||||
labels: feature request
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
Please search existing issues to avoid duplicates.
|
||||
@@ -0,0 +1,86 @@
|
||||
name: ci
|
||||
|
||||
on:
|
||||
push:
|
||||
pull_request:
|
||||
|
||||
defaults:
|
||||
run:
|
||||
shell: bash
|
||||
|
||||
jobs:
|
||||
CI:
|
||||
if: "!contains(github.event.head_commit.message, '[skip ci]')"
|
||||
|
||||
env:
|
||||
GKS_ENCODING: "utf8"
|
||||
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
julia_version:
|
||||
- 'nightly'
|
||||
- '1'
|
||||
- '1.0'
|
||||
os:
|
||||
- ubuntu-latest
|
||||
- windows-latest
|
||||
- macos-latest
|
||||
arch:
|
||||
- x64
|
||||
# - x32
|
||||
steps:
|
||||
|
||||
# Setup environment
|
||||
- uses: actions/checkout@v2
|
||||
- uses: julia-actions/setup-julia@latest
|
||||
with:
|
||||
version: ${{ matrix.julia_version }}
|
||||
- name: Cache artifacts
|
||||
uses: actions/cache@v1
|
||||
env:
|
||||
cache-name: cache-artifacts
|
||||
with:
|
||||
path: ~/.julia/artifacts
|
||||
key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ hashFiles('**/Project.toml') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-test-${{ env.cache-name }}-
|
||||
${{ runner.os }}-test-
|
||||
${{ runner.os }}-
|
||||
|
||||
# OS Dependencies
|
||||
# - name: Ubuntu OS dependencies
|
||||
# if: startsWith(matrix.os,'ubuntu')
|
||||
# run: |
|
||||
# ./test/install_wkhtmltoimage.sh
|
||||
|
||||
# at-spi2-core, libgtk-3-dev, libgtk-3-0, and xvfb are already installed: https://github.com/actions/virtual-environments/blob/master/images/linux/scripts/installers/basic.sh
|
||||
|
||||
|
||||
# TESTCMD
|
||||
- name: Default TESTCMD
|
||||
run: echo ::set-env name=TESTCMD::"julia"
|
||||
- name: Ubuntu TESTCMD
|
||||
if: startsWith(matrix.os,'ubuntu')
|
||||
run: echo ::set-env name=TESTCMD::"xvfb-run julia"
|
||||
|
||||
# Julia Deoendencies
|
||||
- name: Install Julia dependencies
|
||||
uses: julia-actions/julia-buildpkg@latest
|
||||
|
||||
# Run tests
|
||||
- name: Run Graphical test
|
||||
run: $TESTCMD --project -e 'using Pkg; Pkg.test(coverage=true);'
|
||||
|
||||
- name: Codecov
|
||||
uses: julia-actions/julia-uploadcodecov@latest
|
||||
env:
|
||||
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
|
||||
|
||||
Skip:
|
||||
if: "contains(github.event.head_commit.message, '[skip ci]')"
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Skip CI 🚫
|
||||
run: echo skip ci
|
||||
+1
-1
@@ -4,7 +4,7 @@
|
||||
.DS_Store
|
||||
examples/.ipynb_checkpoints/*
|
||||
examples/meetup/.ipynb_checkpoints/*
|
||||
deps/plotly-latest.min.js
|
||||
deps/plotly-*
|
||||
deps/build.log
|
||||
deps/deps.jl
|
||||
Manifest.toml
|
||||
|
||||
-44
@@ -1,44 +0,0 @@
|
||||
# Documentation: http://docs.travis-ci.com/user/languages/julia/
|
||||
language: julia
|
||||
os:
|
||||
- linux
|
||||
# - osx
|
||||
julia:
|
||||
- 1.0
|
||||
- 1
|
||||
- nightly
|
||||
|
||||
matrix:
|
||||
allow_failures:
|
||||
- julia: nightly
|
||||
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- at-spi2-core
|
||||
- libgtk-3-dev
|
||||
- xauth
|
||||
- xvfb
|
||||
|
||||
env:
|
||||
- GKS_ENCODING="utf8"
|
||||
|
||||
cache:
|
||||
directories:
|
||||
- $HOME/.julia/artifacts
|
||||
|
||||
sudo: required
|
||||
before_install:
|
||||
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then pwd ; fi
|
||||
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then ./test/install_wkhtmltoimage.sh ; fi
|
||||
|
||||
notifications:
|
||||
email: true
|
||||
|
||||
after_success:
|
||||
- julia -e 'using Pkg; Pkg.add("Coverage"); using Coverage; Codecov.submit(process_folder())'
|
||||
|
||||
script:
|
||||
- if [[ -a .git/shallow ]]; then git fetch --unshallow; fi
|
||||
- if [[ `uname` = "Linux" ]]; then TESTCMD="xvfb-run julia"; else TESTCMD="julia"; fi
|
||||
- $TESTCMD -e 'using Pkg; Pkg.build(); Pkg.test(coverage=true)'
|
||||
+9
-12
@@ -1,7 +1,7 @@
|
||||
name = "Plots"
|
||||
uuid = "91a5bcdd-55d7-5caf-9e0b-520d859cae80"
|
||||
author = ["Tom Breloff (@tbreloff)"]
|
||||
version = "1.0.12"
|
||||
version = "1.4.2"
|
||||
|
||||
[deps]
|
||||
Base64 = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f"
|
||||
@@ -15,7 +15,6 @@ JSON = "682c06a0-de6a-54ab-a142-c8b1cf79cde6"
|
||||
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
|
||||
Measures = "442fdcdd-2543-5da2-b0f3-8c86c306513e"
|
||||
NaNMath = "77ba4419-2d1f-58cd-9bb1-8ffee604a2e3"
|
||||
Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
|
||||
PlotThemes = "ccf2f8ad-2431-5c83-bf29-c5338b663b6a"
|
||||
PlotUtils = "995b91a9-d308-5afd-9ec6-746e21dbc043"
|
||||
Printf = "de0858da-6303-5e67-8744-51eddeeeb8d7"
|
||||
@@ -35,25 +34,24 @@ UUIDs = "cf7118a7-6976-5b1a-9a39-7adc72f591a4"
|
||||
Contour = "0.5"
|
||||
FFMPEG = "0.2, 0.3"
|
||||
FixedPointNumbers = "0.6, 0.7, 0.8"
|
||||
GR = "0.46, 0.47, 0.48"
|
||||
GR = "0.46, 0.47, 0.48, 0.49, 0.50"
|
||||
GeometryTypes = "0.7, 0.8"
|
||||
JSON = "0.21"
|
||||
Measures = "0.3"
|
||||
NaNMath = "0.3"
|
||||
PGFPlotsX = "1.2.0"
|
||||
PlotThemes = "1"
|
||||
PlotUtils = "0.6.5"
|
||||
PGFPlotsX = "1.2.0 - 1.2.6"
|
||||
PlotThemes = "2"
|
||||
PlotUtils = "1"
|
||||
RecipesBase = "1"
|
||||
RecipesPipeline = "0.1.1"
|
||||
RecipesPipeline = "0.1.7"
|
||||
Reexport = "0.2"
|
||||
Requires = "0.5, 1"
|
||||
Requires = "1"
|
||||
Showoff = "0.3.1"
|
||||
StatsBase = "0.32, 0.33"
|
||||
julia = "1"
|
||||
julia = "1.4"
|
||||
|
||||
[extras]
|
||||
FileIO = "5789e2e9-d7fb-5bc7-8068-2c6fae9b9549"
|
||||
GeometryTypes = "4d00f742-c7ba-57c2-abde-4428a4b178cb"
|
||||
Gtk = "4c0ca9eb-093a-5379-98c5-f87ac0bbbf44"
|
||||
HDF5 = "f67ccb44-e63f-5c2f-98bd-6dc0ccc4ba2f"
|
||||
ImageMagick = "6218d12a-5da1-5696-b52f-db25d2ecc6d1"
|
||||
@@ -62,7 +60,6 @@ LibGit2 = "76f85450-5226-5b5a-8eaa-529ad045b433"
|
||||
OffsetArrays = "6fe1bfb0-de20-5000-8ca7-80f57d26f881"
|
||||
PGFPlotsX = "8314cec4-20b6-5062-9cdb-752b83310925"
|
||||
RDatasets = "ce6b1742-4840-55fa-b093-852dadbb1d8b"
|
||||
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
|
||||
StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"
|
||||
StatsPlots = "f3b207a7-027a-5e70-b257-86293d7955fd"
|
||||
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
|
||||
@@ -70,4 +67,4 @@ UnicodePlots = "b8865327-cd53-5732-bb35-84acbb429228"
|
||||
VisualRegressionTests = "34922c18-7c2a-561c-bac1-01e79b2c4c92"
|
||||
|
||||
[targets]
|
||||
test = ["FileIO", "GeometryTypes", "Gtk", "ImageMagick", "Images", "LibGit2", "OffsetArrays", "PGFPlotsX", "HDF5", "Random", "RDatasets", "StaticArrays", "StatsPlots", "Test", "UnicodePlots", "VisualRegressionTests"]
|
||||
test = ["FileIO", "Gtk", "ImageMagick", "Images", "LibGit2", "OffsetArrays", "PGFPlotsX", "HDF5", "RDatasets", "StaticArrays", "StatsPlots", "Test", "UnicodePlots", "VisualRegressionTests"]
|
||||
|
||||
@@ -1,10 +1,7 @@
|
||||
# Plots
|
||||
|
||||
[travis-img]: https://img.shields.io/travis/JuliaPlots/Plots.jl?logo=travis
|
||||
[travis-url]: https://travis-ci.org/JuliaPlots/Plots.jl
|
||||
|
||||
[appveyor-img]: https://ci.appveyor.com/api/projects/status/github/juliaplots/plots.jl?branch=master&svg=true
|
||||
[appveyor-url]: https://ci.appveyor.com/project/mkborregaard/plots-jl
|
||||
[gh-ci-img]: https://github.com/JuliaPlots/Plots.jl/workflows/ci/badge.svg?branch=master
|
||||
[gh-ci-url]: https://github.com/JuliaPlots/Plots.jl/actions?query=workflow%3Aci
|
||||
|
||||
[pkgeval-img]: https://juliaci.github.io/NanosoldierReports/pkgeval_badges/P/Plots.svg
|
||||
[pkgeval-url]: https://juliaci.github.io/NanosoldierReports/pkgeval_badges/report.html
|
||||
@@ -15,10 +12,9 @@
|
||||
[docs-img]: https://img.shields.io/badge/docs-stable-blue.svg
|
||||
[docs-url]: http://docs.juliaplots.org/latest/
|
||||
|
||||
[![][travis-img]][travis-url]
|
||||
[![][appveyor-img]][appveyor-url]
|
||||
[![][gh-ci-img]][gh-ci-url]
|
||||
[![][pkgeval-img]][pkgeval-url]
|
||||
[![][gitter-img]][gitter-url]
|
||||
[](https://julialang.zulipchat.com/#narrow/stream/236493-plots)
|
||||
[![][docs-img]][docs-url]
|
||||
[](https://codecov.io/gh/JuliaPlots/Plots.jl)
|
||||
|
||||
|
||||
@@ -1,46 +0,0 @@
|
||||
environment:
|
||||
matrix:
|
||||
- julia_version: 1.0
|
||||
- julia_version: 1
|
||||
- julia_version: nightly
|
||||
|
||||
platform:
|
||||
- x86 # 32-bit
|
||||
- x64 # 64-bit
|
||||
|
||||
# # Uncomment the following lines to allow failures on nightly julia
|
||||
# # (tests will run but not make your overall status red)
|
||||
matrix:
|
||||
allow_failures:
|
||||
- julia_version: nightly
|
||||
|
||||
branches:
|
||||
only:
|
||||
- master
|
||||
- /release-.*/
|
||||
|
||||
cache:
|
||||
- '%USERPROFILE%\.julia\artifacts'
|
||||
|
||||
notifications:
|
||||
- provider: Email
|
||||
on_build_success: false
|
||||
on_build_failure: false
|
||||
on_build_status_changed: false
|
||||
|
||||
install:
|
||||
- ps: iex ((new-object net.webclient).DownloadString("https://raw.githubusercontent.com/JuliaCI/Appveyor.jl/version-1/bin/install.ps1"))
|
||||
|
||||
build_script:
|
||||
- echo "%JL_TEST_SCRIPT%"
|
||||
- C:\julia\bin\julia -e "%JL_BUILD_SCRIPT%"
|
||||
|
||||
test_script:
|
||||
- echo "%JL_TEST_SCRIPT%"
|
||||
- C:\julia\bin\julia -e "%JL_TEST_SCRIPT%"
|
||||
|
||||
# # Uncomment to support code coverage upload. Should only be enabled for packages
|
||||
# # which would have coverage gaps without running on Windows
|
||||
# on_success:
|
||||
# - echo "%JL_CODECOV_SCRIPT%"
|
||||
# - C:\julia\bin\julia -e "%JL_CODECOV_SCRIPT%"
|
||||
Vendored
+4
-4
@@ -1,12 +1,12 @@
|
||||
|
||||
#TODO: download https://cdn.plot.ly/plotly-latest.min.js to deps/ if it doesn't exist
|
||||
#TODO: download https://cdn.plot.ly/plotly-1.54.2.min.js to deps/ if it doesn't exist
|
||||
file_path = ""
|
||||
if get(ENV, "PLOTS_HOST_DEPENDENCY_LOCAL", "false") == "true"
|
||||
global file_path
|
||||
local_fn = joinpath(dirname(@__FILE__), "plotly-latest.min.js")
|
||||
local_fn = joinpath(dirname(@__FILE__), "plotly-1.54.2.min.js")
|
||||
if !isfile(local_fn)
|
||||
@info("Cannot find deps/plotly-latest.min.js... downloading latest version.")
|
||||
download("https://cdn.plot.ly/plotly-latest.min.js", local_fn)
|
||||
@info("Cannot find deps/plotly-1.54.2.min.js... downloading latest version.")
|
||||
download("https://cdn.plot.ly/plotly-1.54.2.min.js", local_fn)
|
||||
isfile(local_fn) && (file_path = local_fn)
|
||||
else
|
||||
file_path = local_fn
|
||||
|
||||
Vendored
+2
@@ -44,7 +44,9 @@ blacklist = [
|
||||
# the following are not visible to Plots, only its dependencies
|
||||
"CategoricalArrays",
|
||||
"FixedPointNumbers",
|
||||
"OffsetArrays",
|
||||
"SparseArrays",
|
||||
"StaticArrays",
|
||||
r"#{1,2}[^\"#]+#{1,2}\d+",
|
||||
]
|
||||
|
||||
|
||||
+7
-2
@@ -10,7 +10,7 @@ using Reexport
|
||||
|
||||
import GeometryTypes
|
||||
using Dates, Printf, Statistics, Base64, LinearAlgebra, Random
|
||||
import SparseArrays: findnz
|
||||
import SparseArrays: AbstractSparseMatrix, findnz
|
||||
|
||||
using FFMPEG
|
||||
|
||||
@@ -108,6 +108,7 @@ export
|
||||
gif,
|
||||
mov,
|
||||
mp4,
|
||||
webm,
|
||||
animate,
|
||||
@animate,
|
||||
@gif,
|
||||
@@ -123,7 +124,11 @@ export
|
||||
center,
|
||||
BezierCurve,
|
||||
|
||||
plotattr
|
||||
plotattr,
|
||||
scalefontsize,
|
||||
scalefontsizes,
|
||||
resetfontsizes
|
||||
|
||||
|
||||
# ---------------------------------------------------------
|
||||
|
||||
|
||||
+4
-2
@@ -24,6 +24,7 @@ end
|
||||
giffn() = (isijulia() ? "tmp.gif" : tempname()*".gif")
|
||||
movfn() = (isijulia() ? "tmp.mov" : tempname()*".mov")
|
||||
mp4fn() = (isijulia() ? "tmp.mp4" : tempname()*".mp4")
|
||||
webmfn() = (isijulia() ? "tmp.webm" : tempname()*".webm")
|
||||
|
||||
mutable struct FrameIterator
|
||||
itr
|
||||
@@ -63,6 +64,7 @@ file_extension(fn) = Base.Filesystem.splitext(fn)[2][2:end]
|
||||
gif(anim::Animation, fn = giffn(); kw...) = buildanimation(anim, fn; kw...)
|
||||
mov(anim::Animation, fn = movfn(); kw...) = buildanimation(anim, fn, false; kw...)
|
||||
mp4(anim::Animation, fn = mp4fn(); kw...) = buildanimation(anim, fn, false; kw...)
|
||||
webm(anim::Animation, fn = webmfn(); kw...) = buildanimation(anim, fn, false; kw...)
|
||||
|
||||
ffmpeg_framerate(fps) = "$fps"
|
||||
ffmpeg_framerate(fps::Rational) = "$(fps.num)/$(fps.den)"
|
||||
@@ -110,8 +112,8 @@ function Base.show(io::IO, ::MIME"text/html", agif::AnimatedGif)
|
||||
ext = file_extension(agif.filename)
|
||||
if ext == "gif"
|
||||
html = "<img src=\"data:image/gif;base64," * base64encode(read(agif.filename)) * "\" />"
|
||||
elseif ext in ("mov", "mp4")
|
||||
mimetype = ext == "mov" ? "video/quicktime" : "video/mp4"
|
||||
elseif ext in ("mov", "mp4","webm")
|
||||
mimetype = ext == "mov" ? "video/quicktime" : "video/$ext"
|
||||
html = "<video controls><source src=\"data:$mimetype;base64," *
|
||||
base64encode(read(agif.filename)) *
|
||||
"\" type = \"$mimetype\"></video>"
|
||||
|
||||
+6
-4
@@ -70,12 +70,13 @@ const _arg_desc = KW(
|
||||
:dpi => "Number. Dots Per Inch of output figures",
|
||||
:thickness_scaling => "Number. Scale for the thickness of all line elements like lines, borders, axes, grid lines, ... defaults to 1.",
|
||||
:display_type => "Symbol (`:auto`, `:gui`, or `:inline`). When supported, `display` will either open a GUI window or plot inline.",
|
||||
:extra_kwargs => "KW (Dict{Symbol,Any}). Pass a map of extra keyword args which may be specific to a backend.",
|
||||
:extra_kwargs => "Either one of (`:plot`, `:subplot`, `:series`) to specify for which element extra keyword args are collected or a KW (Dict{Symbol,Any}) to pass a map of extra keyword args which may be specific to a backend. Default: `:series`.\n Example: `pgfplotsx(); scatter(1:5, extra_kwargs=Dict(:subplot=>Dict(\"axis line shift\" => \"10pt\"))`",
|
||||
:fontfamily => "String or Symbol. Default font family for title, legend entries, tick labels and guides",
|
||||
:warn_on_unsupported => "Bool. Warn on unsupported attributes, series types and marker shapes",
|
||||
|
||||
# subplot args
|
||||
:title => "String. Subplot title.",
|
||||
:title_location => "Symbol. Position of subplot title. Values: `:left`, `:center`, `:right`",
|
||||
:titlelocation => "Symbol. Position of subplot title. Values: `:left`, `:center`, `:right`",
|
||||
:titlefontfamily => "String or Symbol. Font family of subplot title.",
|
||||
:titlefontsize => "Integer. Font pointsize of subplot title.",
|
||||
:titlefonthalign => "Symbol. Font horizontal alignment of subplot title: :hcenter, :left, :right or :center",
|
||||
@@ -89,13 +90,14 @@ const _arg_desc = KW(
|
||||
:foreground_color_legend => "Color Type or `:match` (matches `:foreground_color_subplot`). Foreground color of the legend.",
|
||||
:foreground_color_title => "Color Type or `:match` (matches `:foreground_color_subplot`). Color of subplot title.",
|
||||
:color_palette => "Vector of colors (cycle through) or color gradient (generate list from gradient) or `:auto` (generate a color list using `Colors.distiguishable_colors` and custom seed colors chosen to contrast with the background). The color palette is a color list from which series colors are automatically chosen.",
|
||||
:legend => "Bool (show the legend?) or Symbol (legend position). Symbol values: `:none`, `:best`, `:right`, `:left`, `:top`, `:bottom`, `:inside`, `:legend`, `:topright`, `:topleft`, `:bottomleft`, `:bottomright` , `:inline` (note: only some may be supported in each backend)",
|
||||
:legend => "Bool (show the legend?) or (x,y) tuple or Symbol (legend position). Bottom left corner of legend is placed at (x,y). Symbol values: `:none`; `:best`; `:inline`; `:inside`; `:legend`; any valid combination of `:(outer ?)(top/bottom ?)(right/left ?)`, i.e.: `:top`, `:topright`, `:outerleft`, `:outerbottomright` ... (note: only some may be supported in each backend)",
|
||||
:legendfontfamily => "String or Symbol. Font family of legend entries.",
|
||||
:legendfontsize => "Integer. Font pointsize of legend entries.",
|
||||
:legendfonthalign => "Symbol. Font horizontal alignment of legend entries: :hcenter, :left, :right or :center",
|
||||
:legendfontvalign => "Symbol. Font vertical alignment of legend entries: :vcenter, :top, :bottom or :center",
|
||||
:legendfontrotation => "Real. Font rotation of legend entries",
|
||||
:legendfontcolor => "Color Type. Font color of legend entries",
|
||||
:legendtitle => "String. Legend title.",
|
||||
:legendtitlefontfamily => "String or Symbol. Font family of the legend title.",
|
||||
:legendtitlefontsize => "Integer. Font pointsize the legend title.",
|
||||
:legendtitlefonthalign => "Symbol. Font horizontal alignment of the legend title: :hcenter, :left, :right or :center",
|
||||
@@ -103,7 +105,7 @@ const _arg_desc = KW(
|
||||
:legendtitlefontrotation => "Real. Font rotation of the legend title",
|
||||
:legendtitlefontcolor => "Color Type. Font color of the legend title",
|
||||
:colorbar => "Bool (show the colorbar?) or Symbol (colorbar position). Symbol values: `:none`, `:best`, `:right`, `:left`, `:top`, `:bottom`, `:legend` (matches legend value) (note: only some may be supported in each backend)",
|
||||
:clims => "`:auto` or NTuple{2,Number}. Fixes the limits of the colorbar.",
|
||||
:clims => "`:auto`, NTuple{2,Number}, or a function that takes series data in and returns NTuple{2,Number}. Fixes the limits of the colorbar.",
|
||||
:legendfont => "Font. Font of legend items.",
|
||||
:legendtitlefont => "Font. Font of the legend title.",
|
||||
:annotations => "(x,y,text) tuple(s). Can be a single tuple or a list of them. Text can be String or PlotText (created with `text(args...)`) Add one-off text annotations at the x,y coordinates.",
|
||||
|
||||
+59
-21
@@ -20,7 +20,14 @@ function add_non_underscore_aliases!(aliases::Dict{Symbol,Symbol})
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
function add_non_underscore_aliases!(aliases::Dict{Symbol,Symbol}, args::Vector{Symbol})
|
||||
for arg in args
|
||||
s = string(arg)
|
||||
if '_' in s
|
||||
aliases[Symbol(replace(s, "_" => ""))] = arg
|
||||
end
|
||||
end
|
||||
end
|
||||
# ------------------------------------------------------------
|
||||
|
||||
const _allAxes = [:auto, :left, :right]
|
||||
@@ -281,6 +288,7 @@ const _series_defaults = KW(
|
||||
# one logical series to be broken up (path and markers, for example)
|
||||
:hover => nothing, # text to display when hovering over the data points
|
||||
:stride => (1,1), # array stride for wireframe/surface, the first element is the row stride and the second is the column stride.
|
||||
:extra_kwargs => Dict()
|
||||
)
|
||||
|
||||
|
||||
@@ -292,7 +300,7 @@ const _plot_defaults = KW(
|
||||
:fontfamily => "sans-serif",
|
||||
:size => (600,400),
|
||||
:pos => (0,0),
|
||||
:window_title => "Plots.jl",
|
||||
:window_title => "Plots.jl",
|
||||
:show => false,
|
||||
:layout => 1,
|
||||
:link => :none,
|
||||
@@ -304,13 +312,15 @@ const _plot_defaults = KW(
|
||||
:dpi => DPI, # dots per inch for images, etc
|
||||
:thickness_scaling => 1,
|
||||
:display_type => :auto,
|
||||
:extra_kwargs => KW(),
|
||||
:warn_on_unsupported => true,
|
||||
:extra_plot_kwargs => Dict(),
|
||||
:extra_kwargs => :series, # directs collection of extra_kwargs
|
||||
)
|
||||
|
||||
|
||||
const _subplot_defaults = KW(
|
||||
:title => "",
|
||||
:title_location => :center, # also :left or :right
|
||||
:titlelocation => :center, # also :left or :right
|
||||
:fontfamily_subplot => :match,
|
||||
:titlefontfamily => :match,
|
||||
:titlefontsize => 14,
|
||||
@@ -353,6 +363,7 @@ const _subplot_defaults = KW(
|
||||
:colorbar_title => "",
|
||||
:framestyle => :axes,
|
||||
:camera => (30,30),
|
||||
:extra_kwargs => Dict()
|
||||
)
|
||||
|
||||
const _axis_defaults = KW(
|
||||
@@ -480,10 +491,7 @@ is_default_attribute(k) = k in _internal_args || k in _all_args || is_axis_attr_
|
||||
|
||||
makeplural(s::Symbol) = Symbol(string(s,"s"))
|
||||
|
||||
autopick(arr::AVec, idx::Integer) = arr[mod1(idx,length(arr))]
|
||||
autopick(notarr, idx::Integer) = notarr
|
||||
|
||||
autopick_ignore_none_auto(arr::AVec, idx::Integer) = autopick(setdiff(arr, [:none, :auto]), idx)
|
||||
autopick_ignore_none_auto(arr::AVec, idx::Integer) = _cycle(setdiff(arr, [:none, :auto]), idx)
|
||||
autopick_ignore_none_auto(notarr, idx::Integer) = notarr
|
||||
|
||||
function aliasesAndAutopick(plotattributes::AKW, sym::Symbol, aliases::Dict{Symbol,Symbol}, options::AVec, plotIndex::Int)
|
||||
@@ -501,6 +509,13 @@ end
|
||||
# -----------------------------------------------------------------------------
|
||||
|
||||
|
||||
# margin
|
||||
add_aliases(:left_margin , :leftmargin )
|
||||
add_aliases(:top_margin , :topmargin)
|
||||
add_aliases(:bottom_margin , :bottommargin)
|
||||
add_aliases(:right_margin ,:rightmargin)
|
||||
|
||||
|
||||
# colors
|
||||
add_aliases(:seriescolor, :c, :color, :colour)
|
||||
add_aliases(:linecolor, :lc, :lcolor, :lcolour, :linecolour)
|
||||
@@ -582,6 +597,7 @@ add_aliases(:fill_z, :fillz, :fz, :surfacecolor, :surfacecolour, :sc, :surfcolor
|
||||
add_aliases(:legend, :leg, :key)
|
||||
add_aliases(:legendtitle, :legend_title, :labeltitle, :label_title, :leg_title, :key_title)
|
||||
add_aliases(:colorbar, :cb, :cbar, :colorkey)
|
||||
add_aliases(:colorbar_title, :colorbartitle, :cb_title, :cbtitle, :cbartitle, :cbar_title, :colorkeytitle, :colorkey_title)
|
||||
add_aliases(:clims, :clim, :cbarlims, :cbar_lims, :climits, :color_limits)
|
||||
add_aliases(:smooth, :regression, :reg)
|
||||
add_aliases(:levels, :nlevels, :nlev, :levs)
|
||||
@@ -600,7 +616,7 @@ add_aliases(:aspect_ratio, :aspectratio, :axis_ratio, :axisratio, :ratio)
|
||||
add_aliases(:match_dimensions, :transpose, :transpose_z)
|
||||
add_aliases(:subplot, :sp, :subplt, :splt)
|
||||
add_aliases(:projection, :proj)
|
||||
add_aliases(:title_location, :title_loc, :titleloc, :title_position, :title_pos, :titlepos, :titleposition, :title_align, :title_alignment)
|
||||
add_aliases(:titlelocation, :title_location, :title_loc, :titleloc, :title_position, :title_pos, :titlepos, :titleposition, :title_align, :title_alignment)
|
||||
add_aliases(:series_annotations, :series_ann, :seriesann, :series_anns, :seriesanns, :series_annotation, :text, :txt, :texts, :txts)
|
||||
add_aliases(:html_output_format, :format, :fmt, :html_format)
|
||||
add_aliases(:orientation, :direction, :dir)
|
||||
@@ -614,13 +630,14 @@ add_aliases(:framestyle, :frame_style, :frame, :axesstyle, :axes_style, :boxstyl
|
||||
add_aliases(:tick_direction, :tickdirection, :tick_dir, :tickdir, :tick_orientation, :tickorientation, :tick_or, :tickor)
|
||||
add_aliases(:camera, :cam, :viewangle, :view_angle)
|
||||
add_aliases(:contour_labels, :contourlabels, :clabels, :clabs)
|
||||
add_aliases(:warn_on_unsupported, :warn)
|
||||
|
||||
# add all pluralized forms to the _keyAliases dict
|
||||
for arg in keys(_series_defaults)
|
||||
_keyAliases[makeplural(arg)] = arg
|
||||
end
|
||||
|
||||
|
||||
add_non_underscore_aliases!(_keyAliases)
|
||||
|
||||
# -----------------------------------------------------------------------------
|
||||
|
||||
@@ -657,7 +674,7 @@ function default(k::Symbol)
|
||||
return _axis_defaults_byletter[letter][key]
|
||||
end
|
||||
k == :letter && return k # for type recipe processing
|
||||
k in _suppress_warnings || error("Unknown key: ", k)
|
||||
return missing
|
||||
end
|
||||
|
||||
function default(k::Symbol, v)
|
||||
@@ -680,7 +697,10 @@ function default(k::Symbol, v)
|
||||
k in _suppress_warnings || error("Unknown key: ", k)
|
||||
end
|
||||
|
||||
function default(; kw...)
|
||||
function default(; reset = true, kw...)
|
||||
if reset && isempty(kw)
|
||||
reset_defaults()
|
||||
end
|
||||
kw = KW(kw)
|
||||
RecipesPipeline.preprocess_attributes!(kw)
|
||||
for (k,v) in kw
|
||||
@@ -939,8 +959,9 @@ function RecipesPipeline.preprocess_attributes!(plotattributes::AKW)
|
||||
replaceAliases!(plotattributes, _keyAliases)
|
||||
|
||||
# handle axis args common to all axis
|
||||
args = RecipesPipeline.pop_kw!(plotattributes, :axis, ())
|
||||
for arg in wraptuple(args)
|
||||
args = wraptuple(RecipesPipeline.pop_kw!(plotattributes, :axis, ()))
|
||||
showarg = wraptuple(RecipesPipeline.pop_kw!(plotattributes, :showaxis, ()))
|
||||
for arg in wraptuple((args..., showarg...))
|
||||
for letter in (:x, :y, :z)
|
||||
process_axis_arg!(plotattributes, arg, letter)
|
||||
end
|
||||
@@ -1122,20 +1143,26 @@ function warn_on_unsupported_args(pkg::AbstractBackend, plotattributes)
|
||||
empty!(_to_warn)
|
||||
bend = backend_name(pkg)
|
||||
already_warned = get!(_already_warned, bend, Set{Symbol}())
|
||||
extra_kwargs = Dict{Symbol,Any}()
|
||||
for k in keys(plotattributes)
|
||||
is_attr_supported(pkg, k) && continue
|
||||
k in _suppress_warnings && continue
|
||||
if plotattributes[k] != default(k)
|
||||
default_value = default(k)
|
||||
if ismissing(default_value)
|
||||
extra_kwargs[k] = pop_kw!(plotattributes, k)
|
||||
elseif plotattributes[k] != default(k)
|
||||
k in already_warned || push!(_to_warn, k)
|
||||
end
|
||||
end
|
||||
|
||||
if !isempty(_to_warn)
|
||||
if !isempty(_to_warn) &&
|
||||
!get(plotattributes, :warn_on_unsupported, _plot_defaults[:warn_on_unsupported])
|
||||
for k in sort(collect(_to_warn))
|
||||
push!(already_warned, k)
|
||||
@warn("Keyword argument $k not supported with $pkg. Choose from: $(supported_attrs(pkg))")
|
||||
end
|
||||
end
|
||||
return extra_kwargs
|
||||
end
|
||||
|
||||
# _markershape_supported(pkg::AbstractBackend, shape::Symbol) = shape in supported_markers(pkg)
|
||||
@@ -1143,6 +1170,9 @@ end
|
||||
# _markershape_supported(pkg::AbstractBackend, shapes::AVec) = all([_markershape_supported(pkg, shape) for shape in shapes])
|
||||
|
||||
function warn_on_unsupported(pkg::AbstractBackend, plotattributes)
|
||||
if !get(plotattributes, :warn_on_unsupported, _plot_defaults[:warn_on_unsupported])
|
||||
return
|
||||
end
|
||||
if !is_seriestype_supported(pkg, plotattributes[:seriestype])
|
||||
@warn("seriestype $(plotattributes[:seriestype]) is unsupported with $pkg. Choose from: $(supported_seriestypes(pkg))")
|
||||
end
|
||||
@@ -1155,6 +1185,9 @@ function warn_on_unsupported(pkg::AbstractBackend, plotattributes)
|
||||
end
|
||||
|
||||
function warn_on_unsupported_scales(pkg::AbstractBackend, plotattributes::AKW)
|
||||
if !get(plotattributes, :warn_on_unsupported, _plot_defaults[:warn_on_unsupported])
|
||||
return
|
||||
end
|
||||
for k in (:xscale, :yscale, :zscale, :scale)
|
||||
if haskey(plotattributes, k)
|
||||
v = plotattributes[k]
|
||||
@@ -1396,8 +1429,7 @@ end
|
||||
function _update_subplot_colors(sp::Subplot)
|
||||
# background colors
|
||||
color_or_nothing!(sp.attr, :background_color_subplot)
|
||||
bg = plot_color(sp[:background_color_subplot])
|
||||
sp.attr[:color_palette] = get_color_palette(sp.attr[:color_palette], bg, 30)
|
||||
sp.attr[:color_palette] = get_color_palette(sp.attr[:color_palette], 30)
|
||||
color_or_nothing!(sp.attr, :background_color_legend)
|
||||
color_or_nothing!(sp.attr, :background_color_inside)
|
||||
|
||||
@@ -1500,9 +1532,9 @@ end
|
||||
# and assigns a color automatically
|
||||
function get_series_color(c, sp::Subplot, n::Int, seriestype)
|
||||
if c == :auto
|
||||
c = like_surface(seriestype) ? cgrad() : autopick(sp[:color_palette], n)
|
||||
c = like_surface(seriestype) ? cgrad() : _cycle(sp[:color_palette], n)
|
||||
elseif isa(c, Int)
|
||||
c = autopick(sp[:color_palette], c)
|
||||
c = _cycle(sp[:color_palette], c)
|
||||
end
|
||||
plot_color(c)
|
||||
end
|
||||
@@ -1512,7 +1544,13 @@ function get_series_color(c::AbstractArray, sp::Subplot, n::Int, seriestype)
|
||||
end
|
||||
|
||||
function ensure_gradient!(plotattributes::AKW, csym::Symbol, asym::Symbol)
|
||||
if !isa(plotattributes[csym], ColorGradient)
|
||||
if plotattributes[csym] isa ColorPalette
|
||||
α = nothing
|
||||
if !(plotattributes[asym] isa AbstractVector)
|
||||
α = plotattributes[asym]
|
||||
end
|
||||
plotattributes[csym] = cgrad(plotattributes[csym], categorical = true, alpha = α)
|
||||
elseif !(plotattributes[csym] isa ColorGradient)
|
||||
plotattributes[csym] = typeof(plotattributes[asym]) <: AbstractVector ? cgrad() : cgrad(alpha = plotattributes[asym])
|
||||
end
|
||||
end
|
||||
|
||||
+4
-23
@@ -35,7 +35,6 @@ end
|
||||
function process_axis_arg!(plotattributes::AKW, arg, letter = "")
|
||||
T = typeof(arg)
|
||||
arg = get(_scaleAliases, arg, arg)
|
||||
|
||||
if typeof(arg) <: Font
|
||||
plotattributes[Symbol(letter,:tickfont)] = arg
|
||||
plotattributes[Symbol(letter,:guidefont)] = arg
|
||||
@@ -182,16 +181,10 @@ function optimal_ticks_and_labels(sp::Subplot, axis::Axis, ticks = nothing)
|
||||
|
||||
labels = if any(isfinite, unscaled_ticks)
|
||||
formatter = axis[:formatter]
|
||||
if formatter == :auto
|
||||
# the default behavior is to make strings of the scaled values and then apply the labelfunc
|
||||
map(labelfunc(scale, backend()), Showoff.showoff(scaled_ticks, :auto))
|
||||
elseif formatter == :plain
|
||||
# Leave the numbers in plain format
|
||||
map(labelfunc(scale, backend()), Showoff.showoff(scaled_ticks, :plain))
|
||||
elseif formatter == :scientific
|
||||
Showoff.showoff(unscaled_ticks, :scientific)
|
||||
elseif formatter == :latex
|
||||
map(x -> string("\$", replace(convert_sci_unicode(x), '×' => "\\times"), "\$"), Showoff.showoff(unscaled_ticks, :auto))
|
||||
if formatter in (:auto, :plain, :scientific, :engineering)
|
||||
map(labelfunc(scale, backend()), Showoff.showoff(scaled_ticks, formatter))
|
||||
elseif formatter == :latex
|
||||
map(x -> string("\$", replace(convert_sci_unicode(x), '×' => "\\times"), "\$"), Showoff.showoff(unscaled_ticks, :auto))
|
||||
else
|
||||
# there was an override for the formatter... use that on the unscaled ticks
|
||||
map(formatter, unscaled_ticks)
|
||||
@@ -576,18 +569,6 @@ end
|
||||
|
||||
# -------------------------------------------------------------------------
|
||||
|
||||
function pie_labels(sp::Subplot, series::Series)
|
||||
plotattributes = series.plotattributes
|
||||
if haskey(plotattributes,:x_discrete_indices)
|
||||
dvals = sp.attr[:xaxis].plotattributes[:discrete_values]
|
||||
[dvals[idx] for idx in plotattributes[:x_discrete_indices]]
|
||||
else
|
||||
plotattributes[:x]
|
||||
end
|
||||
end
|
||||
|
||||
# -------------------------------------------------------------------------
|
||||
|
||||
# compute the line segments which should be drawn for this axis
|
||||
function axis_drawing_info(sp::Subplot)
|
||||
xaxis, yaxis = sp[:xaxis], sp[:yaxis]
|
||||
|
||||
+90
-28
@@ -1,5 +1,3 @@
|
||||
using Pkg
|
||||
|
||||
struct NoBackend <: AbstractBackend end
|
||||
|
||||
const _backendType = Dict{Symbol, DataType}(:none => NoBackend)
|
||||
@@ -30,7 +28,7 @@ macro init_backend(s)
|
||||
esc(quote
|
||||
struct $T <: AbstractBackend end
|
||||
export $sym
|
||||
$sym(; kw...) = (default(; kw...); backend($T()))
|
||||
$sym(; kw...) = (default(; reset = false, kw...); backend($T()))
|
||||
backend_name(::$T) = Symbol($str)
|
||||
backend_package_name(pkg::$T) = backend_package_name(Symbol($str))
|
||||
push!(_backends, Symbol($str))
|
||||
@@ -190,11 +188,15 @@ function backend(sym::Symbol)
|
||||
end
|
||||
end
|
||||
|
||||
const _deprecated_backends = [:qwt, :winston, :bokeh, :gadfly, :immerse, :glvisualize]
|
||||
const _deprecated_backends = [:qwt, :winston, :bokeh, :gadfly, :immerse, :glvisualize, :pgfplots]
|
||||
|
||||
function warn_on_deprecated_backend(bsym::Symbol)
|
||||
if bsym in _deprecated_backends
|
||||
@warn("Backend $bsym has been deprecated.")
|
||||
if bsym == :pgfplots
|
||||
@warn("Backend $bsym has been deprecated. Use pgfplotsx instead.")
|
||||
else
|
||||
@warn("Backend $bsym has been deprecated.")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -341,10 +343,18 @@ const _gr_attr = merge_with_base_supported([
|
||||
:contour_labels,
|
||||
])
|
||||
const _gr_seriestype = [
|
||||
:path, :scatter, :straightline,
|
||||
:heatmap, :pie, :image,
|
||||
:contour, :path3d, :scatter3d, :surface, :wireframe, :volume,
|
||||
:shape
|
||||
:path,
|
||||
:scatter,
|
||||
:straightline,
|
||||
:heatmap,
|
||||
:image,
|
||||
:contour,
|
||||
:path3d,
|
||||
:scatter3d,
|
||||
:surface,
|
||||
:wireframe,
|
||||
:volume,
|
||||
:shape,
|
||||
]
|
||||
const _gr_style = [:auto, :solid, :dash, :dot, :dashdot, :dashdotdot]
|
||||
const _gr_marker = _allMarkers
|
||||
@@ -378,7 +388,7 @@ const _plotly_attr = merge_with_base_supported([
|
||||
:markerstrokewidth, :markerstrokecolor, :markerstrokealpha, :markerstrokestyle,
|
||||
:fillrange, :fillcolor, :fillalpha,
|
||||
:bins,
|
||||
:title, :title_location,
|
||||
:title, :titlelocation,
|
||||
:titlefontfamily, :titlefontsize, :titlefonthalign, :titlefontvalign,
|
||||
:titlefontcolor,
|
||||
:legendfontfamily, :legendfontsize, :legendfontcolor,
|
||||
@@ -408,9 +418,17 @@ const _plotly_attr = merge_with_base_supported([
|
||||
])
|
||||
|
||||
const _plotly_seriestype = [
|
||||
:path, :scatter, :pie, :heatmap,
|
||||
:contour, :surface, :wireframe, :path3d, :scatter3d, :shape, :scattergl,
|
||||
:straightline
|
||||
:path,
|
||||
:scatter,
|
||||
:heatmap,
|
||||
:contour,
|
||||
:surface,
|
||||
:wireframe,
|
||||
:path3d,
|
||||
:scatter3d,
|
||||
:shape,
|
||||
:scattergl,
|
||||
:straightline,
|
||||
]
|
||||
const _plotly_style = [:auto, :solid, :dash, :dot, :dashdot]
|
||||
const _plotly_marker = [
|
||||
@@ -505,7 +523,7 @@ const _pyplot_attr = merge_with_base_supported([
|
||||
:markerstrokewidth, :markerstrokecolor, :markerstrokealpha,
|
||||
:fillrange, :fillcolor, :fillalpha,
|
||||
:bins, :bar_width, :bar_edges, :bar_position,
|
||||
:title, :title_location, :titlefont,
|
||||
:title, :titlelocation, :titlefont,
|
||||
:window_title,
|
||||
:guide, :guide_position, :lims, :ticks, :scale, :flip, :rotation,
|
||||
:titlefontfamily, :titlefontsize, :titlefontcolor,
|
||||
@@ -533,12 +551,22 @@ const _pyplot_attr = merge_with_base_supported([
|
||||
:contour_labels,
|
||||
])
|
||||
const _pyplot_seriestype = [
|
||||
:path, :steppre, :steppost, :shape, :straightline,
|
||||
:scatter, :hexbin, #:histogram2d, :histogram,
|
||||
# :bar,
|
||||
:heatmap, :pie, :image,
|
||||
:contour, :contour3d, :path3d, :scatter3d, :surface, :wireframe
|
||||
]
|
||||
:path,
|
||||
:steppre,
|
||||
:steppost,
|
||||
:shape,
|
||||
:straightline,
|
||||
:scatter,
|
||||
:hexbin,
|
||||
:heatmap,
|
||||
:image,
|
||||
:contour,
|
||||
:contour3d,
|
||||
:path3d,
|
||||
:scatter3d,
|
||||
:surface,
|
||||
:wireframe,
|
||||
]
|
||||
const _pyplot_style = [:auto, :solid, :dash, :dot, :dashdot]
|
||||
const _pyplot_marker = vcat(_allMarkers, :pixel)
|
||||
const _pyplot_scale = [:identity, :ln, :log2, :log10]
|
||||
@@ -568,6 +596,9 @@ const _unicodeplots_style = [:auto, :solid]
|
||||
const _unicodeplots_marker = [:none, :auto, :circle]
|
||||
const _unicodeplots_scale = [:identity]
|
||||
|
||||
# Additional constants
|
||||
const _canvas_type = Ref(:auto)
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
# hdf5
|
||||
|
||||
@@ -582,7 +613,7 @@ const _hdf5_attr = merge_with_base_supported([
|
||||
:markerstrokewidth, :markerstrokecolor, :markerstrokealpha,
|
||||
:fillrange, :fillcolor, :fillalpha,
|
||||
:bins, :bar_width, :bar_edges, :bar_position,
|
||||
:title, :title_location, :titlefont,
|
||||
:title, :titlelocation, :titlefont,
|
||||
:window_title,
|
||||
:guide, :lims, :ticks, :scale, :flip, :rotation,
|
||||
:tickfont, :guidefont, :legendfont,
|
||||
@@ -602,16 +633,43 @@ const _hdf5_attr = merge_with_base_supported([
|
||||
:colorbar_title,
|
||||
])
|
||||
const _hdf5_seriestype = [
|
||||
:path, :steppre, :steppost, :shape, :straightline,
|
||||
:scatter, :hexbin, #:histogram2d, :histogram,
|
||||
# :bar,
|
||||
:heatmap, :pie, :image,
|
||||
:contour, :contour3d, :path3d, :scatter3d, :surface, :wireframe
|
||||
]
|
||||
:path,
|
||||
:steppre,
|
||||
:steppost,
|
||||
:shape,
|
||||
:straightline,
|
||||
:scatter,
|
||||
:hexbin,
|
||||
:heatmap,
|
||||
:image,
|
||||
:contour,
|
||||
:contour3d,
|
||||
:path3d,
|
||||
:scatter3d,
|
||||
:surface,
|
||||
:wireframe,
|
||||
]
|
||||
const _hdf5_style = [:auto, :solid, :dash, :dot, :dashdot]
|
||||
const _hdf5_marker = vcat(_allMarkers, :pixel)
|
||||
const _hdf5_scale = [:identity, :ln, :log2, :log10]
|
||||
|
||||
# Additional constants
|
||||
#Dict has problems using "Types" as keys. Initialize in "_initialize_backend":
|
||||
const HDF5PLOT_MAP_STR2TELEM = Dict{String, Type}()
|
||||
const HDF5PLOT_MAP_TELEM2STR = Dict{Type, String}()
|
||||
|
||||
#Don't really like this global variable... Very hacky
|
||||
mutable struct HDF5Plot_PlotRef
|
||||
ref::Union{Plot, Nothing}
|
||||
end
|
||||
const HDF5PLOT_PLOTREF = HDF5Plot_PlotRef(nothing)
|
||||
|
||||
#Simple sub-structures that can just be written out using _hdf5plot_gwritefields:
|
||||
const HDF5PLOT_SIMPLESUBSTRUCT = Union{Font, BoundingBox,
|
||||
GridLayout, RootLayout, ColorGradient, SeriesAnnotations, PlotText,
|
||||
Shape,
|
||||
}
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
# inspectdr
|
||||
|
||||
@@ -629,7 +687,7 @@ const _inspectdr_attr = merge_with_base_supported([
|
||||
:markerstrokestyle, #Causes warning not to have it... what is this?
|
||||
:fillcolor, :fillalpha, #:fillrange,
|
||||
# :bins, :bar_width, :bar_edges, :bar_position,
|
||||
:title, :title_location,
|
||||
:title, :titlelocation,
|
||||
:window_title,
|
||||
:guide, :lims, :scale, #:ticks, :flip, :rotation,
|
||||
:titlefontfamily, :titlefontsize, :titlefontcolor,
|
||||
@@ -772,6 +830,7 @@ const _pgfplotsx_seriestype = [
|
||||
:heatmap,
|
||||
:contour,
|
||||
:contour3d,
|
||||
:quiver,
|
||||
:shape,
|
||||
:steppre,
|
||||
:stepmid,
|
||||
@@ -800,3 +859,6 @@ const _pgfplotsx_marker = [
|
||||
]
|
||||
const _pgfplotsx_scale = [:identity, :ln, :log2, :log10]
|
||||
is_marker_supported(::PGFPlotsXBackend, shape::Shape) = true
|
||||
|
||||
# additional constants
|
||||
const _pgfplotsx_series_ids = KW()
|
||||
|
||||
+350
-354
File diff suppressed because it is too large
Load Diff
+16
-43
@@ -37,33 +37,6 @@ import FixedPointNumbers: N0f8 #In core Julia
|
||||
struct HDF5PlotNative; end #Indentifies a data element that can natively be handled by HDF5
|
||||
struct HDF5CTuple; end #Identifies a "complex" tuple structure
|
||||
|
||||
mutable struct HDF5Plot_PlotRef
|
||||
ref::Union{Plot, Nothing}
|
||||
end
|
||||
|
||||
|
||||
#==Useful constants
|
||||
===============================================================================#
|
||||
const _hdf5_nullable{T} = Union{T, Nothing}
|
||||
const _hdf5_plotroot = "plot"
|
||||
const _hdf5_dataroot = "data" #TODO: Eventually move data to different root (easier to locate)?
|
||||
const _hdf5plot_datatypeid = "TYPE" #Attribute identifying type
|
||||
const _hdf5plot_countid = "COUNT" #Attribute for storing count
|
||||
|
||||
#Dict has problems using "Types" as keys. Initialize in "_initialize_backend":
|
||||
const HDF5PLOT_MAP_STR2TELEM = Dict{String, Type}()
|
||||
const HDF5PLOT_MAP_TELEM2STR = Dict{Type, String}()
|
||||
|
||||
#Don't really like this global variable... Very hacky
|
||||
const HDF5PLOT_PLOTREF = HDF5Plot_PlotRef(nothing)
|
||||
|
||||
#Simple sub-structures that can just be written out using _hdf5plot_gwritefields:
|
||||
const HDF5PLOT_SIMPLESUBSTRUCT = Union{Font, BoundingBox,
|
||||
GridLayout, RootLayout, ColorGradient, SeriesAnnotations, PlotText,
|
||||
Shape,
|
||||
}
|
||||
|
||||
|
||||
#==
|
||||
===============================================================================#
|
||||
is_marker_supported(::HDF5Backend, shape::Shape) = true
|
||||
@@ -95,7 +68,7 @@ if length(HDF5PLOT_MAP_TELEM2STR) < 1
|
||||
"AXIS" => Axis,
|
||||
"SURFACE" => Surface,
|
||||
"SUBPLOT" => Subplot,
|
||||
"NULLABLE" => _hdf5_nullable,
|
||||
"NULLABLE" => Union{Nothing, T} where T,
|
||||
)
|
||||
merge!(HDF5PLOT_MAP_STR2TELEM, telem2str)
|
||||
merge!(HDF5PLOT_MAP_TELEM2STR, Dict{Type, String}(v=>k for (k,v) in HDF5PLOT_MAP_STR2TELEM))
|
||||
@@ -105,8 +78,8 @@ end
|
||||
#==Helper functions
|
||||
===============================================================================#
|
||||
|
||||
_hdf5_plotelempath(subpath::String) = "$_hdf5_plotroot/$subpath"
|
||||
_hdf5_datapath(subpath::String) = "$_hdf5_dataroot/$subpath"
|
||||
_hdf5_plotelempath(subpath::String) = "plot/$subpath"
|
||||
_hdf5_datapath(subpath::String) = "data/$subpath"
|
||||
_hdf5_map_str2telem(k::String) = HDF5PLOT_MAP_STR2TELEM[k]
|
||||
_hdf5_map_str2telem(v::Vector) = HDF5PLOT_MAP_STR2TELEM[v[1]]
|
||||
|
||||
@@ -201,38 +174,38 @@ end
|
||||
|
||||
function _hdf5plot_writetype(grp, k::String, tstr::Array{String})
|
||||
d = HDF5.d_open(grp, k)
|
||||
HDF5.a_write(d, _hdf5plot_datatypeid, tstr)
|
||||
HDF5.a_write(d, "TYPE", tstr)
|
||||
end
|
||||
function _hdf5plot_writetype(grp, k::String, T::Type)
|
||||
tstr = HDF5PLOT_MAP_TELEM2STR[T]
|
||||
d = HDF5.d_open(grp, k)
|
||||
HDF5.a_write(d, _hdf5plot_datatypeid, tstr)
|
||||
HDF5.a_write(d, "TYPE", tstr)
|
||||
end
|
||||
function _hdf5plot_overwritetype(grp, k::String, T::Type)
|
||||
tstr = HDF5PLOT_MAP_TELEM2STR[T]
|
||||
d = HDF5.d_open(grp, k)
|
||||
HDF5.a_delete(d, _hdf5plot_datatypeid)
|
||||
HDF5.a_write(d, _hdf5plot_datatypeid, tstr)
|
||||
HDF5.a_delete(d, "TYPE")
|
||||
HDF5.a_write(d, "TYPE", tstr)
|
||||
end
|
||||
function _hdf5plot_writetype(grp, T::Type) #Write directly to group
|
||||
tstr = HDF5PLOT_MAP_TELEM2STR[T]
|
||||
HDF5.a_write(grp, _hdf5plot_datatypeid, tstr)
|
||||
HDF5.a_write(grp, "TYPE", tstr)
|
||||
end
|
||||
function _hdf5plot_overwritetype(grp, T::Type) #Write directly to group
|
||||
tstr = HDF5PLOT_MAP_TELEM2STR[T]
|
||||
HDF5.a_delete(grp, _hdf5plot_datatypeid)
|
||||
HDF5.a_write(grp, _hdf5plot_datatypeid, tstr)
|
||||
HDF5.a_delete(grp, "TYPE")
|
||||
HDF5.a_write(grp, "TYPE", tstr)
|
||||
end
|
||||
function _hdf5plot_writetype(grp, ::Type{Array{T}}) where T<:Any
|
||||
tstr = HDF5PLOT_MAP_TELEM2STR[Array] #ANY
|
||||
HDF5.a_write(grp, _hdf5plot_datatypeid, tstr)
|
||||
HDF5.a_write(grp, "TYPE", tstr)
|
||||
end
|
||||
function _hdf5plot_writetype(grp, ::Type{T}) where T<:BoundingBox
|
||||
tstr = HDF5PLOT_MAP_TELEM2STR[BoundingBox]
|
||||
HDF5.a_write(grp, _hdf5plot_datatypeid, tstr)
|
||||
HDF5.a_write(grp, "TYPE", tstr)
|
||||
end
|
||||
function _hdf5plot_writecount(grp, n::Int) #Write directly to group
|
||||
HDF5.a_write(grp, _hdf5plot_countid, n)
|
||||
HDF5.a_write(grp, "COUNT", n)
|
||||
end
|
||||
function _hdf5plot_gwritefields(grp, k::String, v)
|
||||
grp = HDF5.g_create(grp, k)
|
||||
@@ -372,7 +345,7 @@ function _hdf5plot_gwrite(grp, k::String, v::Surface)
|
||||
_hdf5plot_writetype(grp, Surface)
|
||||
end
|
||||
# #TODO: "Properly" support Nullable using _hdf5plot_writetype?
|
||||
# function _hdf5plot_gwrite(grp, k::String, v::_hdf5_nullable)
|
||||
# function _hdf5plot_gwrite(grp, k::String, v::Union{Nothing, T} where T)
|
||||
# if isnull(v)
|
||||
# _hdf5plot_gwrite(grp, k, nothing)
|
||||
# else
|
||||
@@ -448,7 +421,7 @@ hdf5plot_write(path::AbstractString) = hdf5plot_write(current(), path)
|
||||
===============================================================================#
|
||||
|
||||
function _hdf5plot_readcount(grp) #Read directly from group
|
||||
return HDF5.a_read(grp, _hdf5plot_countid)
|
||||
return HDF5.a_read(grp, "COUNT")
|
||||
end
|
||||
|
||||
_hdf5plot_convert(T::Type{HDF5PlotNative}, v) = v
|
||||
@@ -589,7 +562,7 @@ function _hdf5plot_read(grp, k::String, T::Type{Length}, dtid::Vector)
|
||||
return Length{TU,T}(v)
|
||||
end
|
||||
function _hdf5plot_read(grp, k::String)
|
||||
dtid = HDF5.a_read(grp[k], _hdf5plot_datatypeid)
|
||||
dtid = HDF5.a_read(grp[k], "TYPE")
|
||||
T = _hdf5_map_str2telem(dtid) #expect exception
|
||||
return _hdf5plot_read(grp, k, T, dtid)
|
||||
end
|
||||
|
||||
+10
-16
@@ -429,29 +429,23 @@ end
|
||||
|
||||
# ----------------------------------------------------------------
|
||||
|
||||
const _inspectdr_mimeformats_dpi = Dict(
|
||||
"image/png" => "png"
|
||||
)
|
||||
const _inspectdr_mimeformats_nodpi = Dict(
|
||||
"image/svg+xml" => "svg",
|
||||
"application/eps" => "eps",
|
||||
"image/eps" => "eps",
|
||||
# "application/postscript" => "ps", #TODO: support once Cairo supports PSSurface
|
||||
"application/pdf" => "pdf"
|
||||
)
|
||||
_inspectdr_show(io::IO, mime::MIME, ::Nothing, w, h) =
|
||||
throw(ErrorException("Cannot show(::IO, ...) plot - not yet generated"))
|
||||
function _inspectdr_show(io::IO, mime::MIME, mplot, w, h)
|
||||
InspectDR._show(io, mime, mplot, Float64(w), Float64(h))
|
||||
end
|
||||
|
||||
for (mime, fmt) in _inspectdr_mimeformats_dpi
|
||||
@eval function _show(io::IO, mime::MIME{Symbol($mime)}, plt::Plot{InspectDRBackend})
|
||||
dpi = plt[:dpi]#TODO: support
|
||||
_inspectdr_show(io, mime, _inspectdr_getmplot(plt.o), plt[:size]...)
|
||||
end
|
||||
function _show(io::IO, mime::MIME{Symbol("image/png")}, plt::Plot{InspectDRBackend})
|
||||
dpi = plt[:dpi] # TODO: support
|
||||
_inspectdr_show(io, mime, _inspectdr_getmplot(plt.o), plt[:size]...)
|
||||
end
|
||||
for (mime, fmt) in _inspectdr_mimeformats_nodpi
|
||||
for (mime, fmt) in (
|
||||
"image/svg+xml" => "svg",
|
||||
"application/eps" => "eps",
|
||||
"image/eps" => "eps",
|
||||
# "application/postscript" => "ps", # TODO: support once Cairo supports PSSurface
|
||||
"application/pdf" => "pdf",
|
||||
)
|
||||
@eval function _show(io::IO, mime::MIME{Symbol($mime)}, plt::Plot{InspectDRBackend})
|
||||
_inspectdr_show(io, mime, _inspectdr_getmplot(plt.o), plt[:size]...)
|
||||
end
|
||||
|
||||
@@ -12,13 +12,12 @@ function plotlybase_syncplot(plt::Plot)
|
||||
return plt.o
|
||||
end
|
||||
|
||||
const _orca_mimeformats = Dict(
|
||||
for (mime, fmt) in (
|
||||
"application/pdf" => "pdf",
|
||||
"image/png" => "png",
|
||||
"image/svg+xml" => "svg",
|
||||
"image/eps" => "eps",
|
||||
"image/png" => "png",
|
||||
"image/svg+xml" => "svg",
|
||||
"image/eps" => "eps",
|
||||
)
|
||||
|
||||
for (mime, fmt) in _orca_mimeformats
|
||||
@eval _show(io::IO, ::MIME{Symbol($mime)}, plt::Plot{PlotlyBackend}) = ORCA.PlotlyBase.savefig(io, plotlybase_syncplot(plt), format = $fmt)
|
||||
@eval _show(io::IO, ::MIME{Symbol($mime)}, plt::Plot{PlotlyBackend}) =
|
||||
ORCA.PlotlyBase.savefig(io, plotlybase_syncplot(plt), format = $fmt)
|
||||
end
|
||||
|
||||
+200
-143
@@ -86,7 +86,16 @@ end
|
||||
function (pgfx_plot::PGFPlotsXPlot)(plt::Plot{PGFPlotsXBackend})
|
||||
if !pgfx_plot.is_created || pgfx_plot.was_shown
|
||||
pgfx_sanitize_plot!(plt)
|
||||
the_plot = PGFPlotsX.TikzPicture(PGFPlotsX.Options())
|
||||
# extract extra kwargs
|
||||
extra_plot_opt = plt[:extra_plot_kwargs]
|
||||
extra_plot = nothing
|
||||
if haskey(extra_plot_opt, :add)
|
||||
extra_plot = wraptuple(pop!(extra_plot_opt,:add))
|
||||
end
|
||||
the_plot = PGFPlotsX.TikzPicture(PGFPlotsX.Options(extra_plot_opt...))
|
||||
if extra_plot !== nothing
|
||||
push!(the_plot, extra_plot...)
|
||||
end
|
||||
bgc = plt.attr[:background_color_outside] == :match ?
|
||||
plt.attr[:background_color] : plt.attr[:background_color_outside]
|
||||
if bgc isa Colors.Colorant
|
||||
@@ -123,21 +132,16 @@ function (pgfx_plot::PGFPlotsXPlot)(plt::Plot{PGFPlotsXBackend})
|
||||
fg_alpha = alpha(plot_color(sp[:foreground_color_legend]))
|
||||
title_cstr = plot_color(sp[:titlefontcolor])
|
||||
title_a = alpha(title_cstr)
|
||||
title_loc = sp[:title_location]
|
||||
title_loc = sp[:titlelocation]
|
||||
bgc_inside = plot_color(sp[:background_color_inside])
|
||||
bgc_inside_a = alpha(bgc_inside)
|
||||
axis_opt = PGFPlotsX.Options(
|
||||
"point meta max" => get_clims(sp)[2],
|
||||
"point meta min" => get_clims(sp)[1],
|
||||
"legend cell align" => "left",
|
||||
"title" => sp[:title],
|
||||
"title style" => PGFPlotsX.Options(
|
||||
"at" => if title_loc == :left
|
||||
"{(0,1)}"
|
||||
elseif title_loc == :right
|
||||
"{(1,1)}"
|
||||
elseif title_loc isa Tuple
|
||||
"{$(string(title_loc))}"
|
||||
else
|
||||
"{(0.5,1)}"
|
||||
end,
|
||||
pgfx_get_title_pos(title_loc)...,
|
||||
"font" => pgfx_font(
|
||||
sp[:titlefontsize],
|
||||
pgfx_thickness_scaling(sp),
|
||||
@@ -175,15 +179,7 @@ function (pgfx_plot::PGFPlotsXPlot)(plt::Plot{PGFPlotsXBackend})
|
||||
sp_height > 0 * mm ? push!(axis_opt, "height" => string(axis_height)) :
|
||||
nothing
|
||||
# legend position
|
||||
if sp[:legend] isa Tuple
|
||||
x, y = sp[:legend]
|
||||
push!(axis_opt["legend style"], "at={($x, $y)}")
|
||||
else
|
||||
push!(
|
||||
axis_opt["legend style"],
|
||||
get(_pgfplotsx_legend_pos, sp[:legend], ("at" => string((1.02, 1)), "anchor" => "north west"))...
|
||||
)
|
||||
end
|
||||
push!(axis_opt["legend style"], pgfx_get_legend_pos(sp[:legend])...)
|
||||
for letter in (:x, :y, :z)
|
||||
if letter != :z || RecipesPipeline.is3d(sp)
|
||||
pgfx_axis!(axis_opt, sp, letter)
|
||||
@@ -200,34 +196,48 @@ function (pgfx_plot::PGFPlotsXPlot)(plt::Plot{PGFPlotsXBackend})
|
||||
# As it is likely that all series within the same axis use the same
|
||||
# colormap this should not cause any problem.
|
||||
for series in series_list(sp)
|
||||
for col in (:markercolor, :fillcolor, :linecolor)
|
||||
if typeof(series.plotattributes[col]) == ColorGradient
|
||||
PGFPlotsX.push_preamble!(
|
||||
pgfx_plot.the_plot,
|
||||
"""\\pgfplotsset{
|
||||
colormap={plots$(sp.attr[:subplot_index])}{$(pgfx_colormap(series.plotattributes[col]))},
|
||||
}""",
|
||||
)
|
||||
if hascolorbar(series)
|
||||
cg = get_colorgradient(series)
|
||||
cm = pgfx_colormap(get_colorgradient(series))
|
||||
PGFPlotsX.push_preamble!(
|
||||
pgfx_plot.the_plot,
|
||||
"""\\pgfplotsset{
|
||||
colormap={plots$(sp.attr[:subplot_index])}{$cm},
|
||||
}""",
|
||||
)
|
||||
push!(axis_opt, "colormap name" => "plots$(sp.attr[:subplot_index])")
|
||||
if cg isa PlotUtils.CategoricalColorGradient
|
||||
push!(
|
||||
axis_opt,
|
||||
"colorbar" => nothing,
|
||||
"colormap name" => "plots$(sp.attr[:subplot_index])",
|
||||
"colormap access" => "piecewise const",
|
||||
"colorbar sampled" => nothing,
|
||||
)
|
||||
# goto is needed to break out of col and series for
|
||||
@goto colorbar_end
|
||||
end
|
||||
# goto is needed to break out of col and series for
|
||||
@goto colorbar_end
|
||||
end
|
||||
end
|
||||
@label colorbar_end
|
||||
|
||||
push!(
|
||||
axis_opt,
|
||||
"colorbar style" => PGFPlotsX.Options(
|
||||
if hascolorbar(sp)
|
||||
colorbar_style = PGFPlotsX.Options(
|
||||
"title" => sp[:colorbar_title],
|
||||
),
|
||||
"point meta max" => get_clims(sp)[2],
|
||||
"point meta min" => get_clims(sp)[1],
|
||||
)
|
||||
"xticklabel style" => pgfx_get_ticklabel_style(sp, sp[:xaxis]),
|
||||
"yticklabel style" => pgfx_get_ticklabel_style(sp, sp[:yaxis]),
|
||||
)
|
||||
if sp[:colorbar] === :top
|
||||
push!(colorbar_style,
|
||||
"at" => string((0.5, 1.05)),
|
||||
"anchor" => "south",
|
||||
"xticklabel pos" => "upper",
|
||||
)
|
||||
end
|
||||
push!(
|
||||
axis_opt,
|
||||
string("colorbar", pgfx_get_colorbar_pos(sp[:colorbar])) => nothing,
|
||||
"colorbar style" => colorbar_style,
|
||||
)
|
||||
end
|
||||
if RecipesPipeline.is3d(sp)
|
||||
azim, elev = sp[:camera]
|
||||
push!(axis_opt, "view" => (azim, elev))
|
||||
@@ -239,7 +249,15 @@ function (pgfx_plot::PGFPlotsXPlot)(plt::Plot{PGFPlotsXBackend})
|
||||
else
|
||||
PGFPlotsX.Axis
|
||||
end
|
||||
axis = axisf(axis_opt)
|
||||
extra_sp_opt = sp[:extra_kwargs]
|
||||
extra_sp = nothing
|
||||
if haskey(extra_sp_opt, :add)
|
||||
extra_sp = wraptuple(pop!(extra_sp_opt,:add))
|
||||
end
|
||||
axis = axisf(merge(axis_opt, PGFPlotsX.Options(extra_sp_opt...)))
|
||||
if extra_sp !== nothing
|
||||
push!(axis, extra_sp...)
|
||||
end
|
||||
if sp[:legendtitle] !== nothing
|
||||
push!(axis, PGFPlotsX.Options("\\addlegendimage{empty legend}" => nothing))
|
||||
push!(
|
||||
@@ -261,7 +279,13 @@ function (pgfx_plot::PGFPlotsXPlot)(plt::Plot{PGFPlotsXBackend})
|
||||
"color" => single_color(opt[:linecolor]),
|
||||
"name path" => string(series_id),
|
||||
)
|
||||
if RecipesPipeline.is3d(series) || st == :heatmap
|
||||
extra_series_opt = series[:extra_kwargs]
|
||||
extra_series = nothing
|
||||
if haskey(extra_series_opt, :add)
|
||||
extra_series = wraptuple(pop!(extra_series_opt,:add))
|
||||
end
|
||||
series_opt = merge(series_opt, PGFPlotsX.Options(extra_series_opt...))
|
||||
if RecipesPipeline.is3d(series) || st in (:heatmap, :contour)
|
||||
series_func = PGFPlotsX.Plot3
|
||||
else
|
||||
series_func = PGFPlotsX.Plot
|
||||
@@ -270,7 +294,7 @@ function (pgfx_plot::PGFPlotsXPlot)(plt::Plot{PGFPlotsXBackend})
|
||||
!isfilledcontour(series) && series[:ribbon] === nothing
|
||||
push!(series_opt, "area legend" => nothing)
|
||||
end
|
||||
if st == :heatmap
|
||||
if st in (:heatmap, :contour)
|
||||
push!(axis.options, "view" => "{0}{90}")
|
||||
end
|
||||
# treat segments
|
||||
@@ -315,12 +339,13 @@ function (pgfx_plot::PGFPlotsXPlot)(plt::Plot{PGFPlotsXBackend})
|
||||
end
|
||||
segment_opt = merge(segment_opt, pgfx_marker(opt, i))
|
||||
end
|
||||
if st == :shape || isfilledcontour(series)
|
||||
if st == :shape
|
||||
segment_opt = merge(segment_opt, pgfx_fillstyle(opt, i))
|
||||
end
|
||||
# add fillrange
|
||||
if sf !== nothing &&
|
||||
!isfilledcontour(series) && series[:ribbon] === nothing
|
||||
!isfilledcontour(series) &&
|
||||
series[:ribbon] === nothing
|
||||
if sf isa Number || sf isa AVec
|
||||
pgfx_fillrange_series!(
|
||||
axis,
|
||||
@@ -340,6 +365,9 @@ function (pgfx_plot::PGFPlotsXPlot)(plt::Plot{PGFPlotsXBackend})
|
||||
pgfx_series_coordinates!(sp, series, segment_opt, opt, rng)
|
||||
segment_plot =
|
||||
series_func(merge(series_opt, segment_opt), coordinates)
|
||||
if extra_series !== nothing
|
||||
push!(segment_plot, extra_series...)
|
||||
end
|
||||
push!(axis, segment_plot)
|
||||
# fill between functions
|
||||
if sf isa Tuple && series[:ribbon] === nothing
|
||||
@@ -566,8 +594,8 @@ function pgfx_series_coordinates!(
|
||||
xs, ys, zs = collect(args)
|
||||
push!(
|
||||
segment_opt,
|
||||
"contour filled" => PGFPlotsX.Options("labels" => opt[:contour_labels]),
|
||||
"point meta" => "explicit",
|
||||
"contour filled" => PGFPlotsX.Options(), # labels not supported
|
||||
"patch type" => "bilinear",
|
||||
"shader" => "flat",
|
||||
)
|
||||
if opt[:levels] isa Number
|
||||
@@ -576,75 +604,115 @@ function pgfx_series_coordinates!(
|
||||
push!(segment_opt["contour filled"], "levels" => opt[:levels])
|
||||
end
|
||||
|
||||
cs = join(
|
||||
[
|
||||
join(["($x, $y) [$(zs[j, i])]" for (j, x) in enumerate(xs)], " ") for (i, y) in enumerate(ys)
|
||||
],
|
||||
"\n\n",
|
||||
)
|
||||
"""
|
||||
coordinates {
|
||||
$cs
|
||||
};
|
||||
"""
|
||||
PGFPlotsX.Coordinates(args...)
|
||||
end
|
||||
##
|
||||
const _pgfplotsx_linestyles = KW(
|
||||
:solid => "solid",
|
||||
:dash => "dashed",
|
||||
:dot => "dotted",
|
||||
:dashdot => "dashdotted",
|
||||
:dashdotdot => "dashdotdotted",
|
||||
pgfx_get_linestyle(k) = get(
|
||||
(
|
||||
solid = "solid",
|
||||
dash = "dashed",
|
||||
dot = "dotted",
|
||||
dashdot = "dashdotted",
|
||||
dashdotdot = "dashdotdotted",
|
||||
),
|
||||
Symbol(k),
|
||||
"solid",
|
||||
)
|
||||
|
||||
const _pgfplotsx_series_ids = KW()
|
||||
|
||||
const _pgfplotsx_markers = KW(
|
||||
:none => "none",
|
||||
:cross => "+",
|
||||
:xcross => "x",
|
||||
:+ => "+",
|
||||
:x => "x",
|
||||
:utriangle => "triangle*",
|
||||
:dtriangle => "triangle*",
|
||||
:rtriangle => "triangle*",
|
||||
:ltriangle => "triangle*",
|
||||
:circle => "*",
|
||||
:rect => "square*",
|
||||
:star5 => "star",
|
||||
:star6 => "asterisk",
|
||||
:diamond => "diamond*",
|
||||
:pentagon => "pentagon*",
|
||||
:hline => "-",
|
||||
:vline => "|",
|
||||
pgfx_get_marker(k) = get(
|
||||
(
|
||||
none = "none",
|
||||
cross = "+",
|
||||
xcross = "x",
|
||||
+ = "+",
|
||||
x = "x",
|
||||
utriangle = "triangle*",
|
||||
dtriangle = "triangle*",
|
||||
rtriangle = "triangle*",
|
||||
ltriangle = "triangle*",
|
||||
circle = "*",
|
||||
rect = "square*",
|
||||
star5 = "star",
|
||||
star6 = "asterisk",
|
||||
diamond = "diamond*",
|
||||
pentagon = "pentagon*",
|
||||
hline = "-",
|
||||
vline = "|",
|
||||
),
|
||||
Symbol(k),
|
||||
"*",
|
||||
)
|
||||
|
||||
const _pgfplotsx_legend_pos = KW(
|
||||
:top => ("at" => string((0.5, 0.98)), "anchor" => "north"),
|
||||
:bottom => ("at" => string((0.5, 0.02)), "anchor" => "south"),
|
||||
:left => ("at" => string((0.02, 0.5)), "anchor" => "west"),
|
||||
:right => ("at" => string((0.98, 0.5)), "anchor" => "east"),
|
||||
:bottomleft => ("at" => string((0.02, 0.02)), "anchor" => "south west"),
|
||||
:bottomright => ("at" => string((0.98, 0.02)), "anchor" => "south east"),
|
||||
:topright => ("at" => string((0.98, 0.98)), "anchor" => "north east"),
|
||||
:topleft => ("at" => string((-0.02, 0.98)), "anchor" => "north west"),
|
||||
:outertop => ("at" => string((0.5, 1.02)), "anchor" => "south"),
|
||||
:outerbottom => ("at" => string((0.5, -0.02)), "anchor" => "north"),
|
||||
:outerleft => ("at" => string((-0.02, 0.5)), "anchor" => "east"),
|
||||
:outerright => ("at" => string((1.02, 0.5)), "anchor" => "west"),
|
||||
:outerbottomleft => ("at" => string((-0.02, -0.02)), "anchor" => "north east"),
|
||||
:outerbottomright => ("at" => string((1.02, -0.02)), "anchor" => "north west"),
|
||||
:outertopright => ("at" => string((1.02, 1)), "anchor" => "north west"),
|
||||
:outertopleft => ("at" => string((-0.02, 1)), "anchor" => "north east"),
|
||||
pgfx_get_xguide_pos(k) = get(
|
||||
(
|
||||
top = "at={(0.5,1)},above,",
|
||||
right = "at={(ticklabel* cs:1.02)}, anchor=west,",
|
||||
left = "at={(ticklabel* cs:-0.02)}, anchor=east,",
|
||||
),
|
||||
k,
|
||||
"at={(ticklabel cs:0.5)}, anchor=near ticklabel"
|
||||
)
|
||||
|
||||
const _pgfx_framestyles = [:box, :axes, :origin, :zerolines, :grid, :none]
|
||||
const _pgfx_framestyle_defaults = Dict(:semi => :box)
|
||||
pgfx_get_yguide_pos(k) = get(
|
||||
(
|
||||
top = "at={(ticklabel* cs:1.02)}, anchor=south",
|
||||
right = "at={(1,0.5)},below,",
|
||||
bottom = "at={(ticklabel* cs:-0.02)}, anchor=north,",
|
||||
),
|
||||
k,
|
||||
"at={(ticklabel cs:0.5)}, anchor=near ticklabel"
|
||||
)
|
||||
|
||||
pgfx_get_legend_pos(k) = get(
|
||||
(
|
||||
top = ("at" => string((0.5, 0.98)), "anchor" => "north"),
|
||||
bottom = ("at" => string((0.5, 0.02)), "anchor" => "south"),
|
||||
left = ("at" => string((0.02, 0.5)), "anchor" => "west"),
|
||||
right = ("at" => string((0.98, 0.5)), "anchor" => "east"),
|
||||
bottomleft = ("at" => string((0.02, 0.02)), "anchor" => "south west"),
|
||||
bottomright = ("at" => string((0.98, 0.02)), "anchor" => "south east"),
|
||||
topright = ("at" => string((0.98, 0.98)), "anchor" => "north east"),
|
||||
topleft = ("at" => string((0.02, 0.98)), "anchor" => "north west"),
|
||||
outertop = ("at" => string((0.5, 1.02)), "anchor" => "south"),
|
||||
outerbottom = ("at" => string((0.5, -0.02)), "anchor" => "north"),
|
||||
outerleft = ("at" => string((-0.02, 0.5)), "anchor" => "east"),
|
||||
outerright = ("at" => string((1.02, 0.5)), "anchor" => "west"),
|
||||
outerbottomleft = ("at" => string((-0.02, -0.02)), "anchor" => "north east"),
|
||||
outerbottomright = ("at" => string((1.02, -0.02)), "anchor" => "north west"),
|
||||
outertopright = ("at" => string((1.02, 1)), "anchor" => "north west"),
|
||||
outertopleft = ("at" => string((-0.02, 1)), "anchor" => "north east"),
|
||||
),
|
||||
Symbol(k),
|
||||
("at" => string((1.02, 1)), "anchor" => "north west"),
|
||||
)
|
||||
pgfx_get_legend_pos(t::Tuple) = ("at" => "{$(string(t))}", "anchor" => "north west")
|
||||
pgfx_get_legend_pos(nt::NamedTuple) = ("at" => "{$(string(nt.at))}", "anchor" => string(nt.anchor))
|
||||
|
||||
pgfx_get_colorbar_pos(s) =
|
||||
get((left = " left", bottom = " horizontal", top = " horizontal"), s, "")
|
||||
pgfx_get_colorbar_pos(b::Bool) = ""
|
||||
|
||||
pgfx_get_title_pos(s) =
|
||||
get((
|
||||
left = ("at" => "{(0,1)}", "anchor" => "south west"),
|
||||
right = ("at" => "{(1,1)}", "anchor" => "south east"),
|
||||
), s,
|
||||
("at" => "{(0.5,1)}", "anchor" => "south"))
|
||||
pgfx_get_title_pos(t::Tuple) = ("at" => "{$(string(t))}", "anchor" => "south")
|
||||
pgfx_get_title_pos(nt::NamedTuple) = ("at" => "{$(string(nt.at))}", "anchor" => string(nt.anchor))
|
||||
|
||||
function pgfx_get_ticklabel_style(sp, axis)
|
||||
cstr = plot_color(axis[:tickfontcolor])
|
||||
return PGFPlotsX.Options(
|
||||
"font" => pgfx_font(
|
||||
axis[:tickfontsize], pgfx_thickness_scaling(sp)
|
||||
),
|
||||
"color" => cstr,
|
||||
"draw opacity" => alpha(cstr),
|
||||
"rotate" => axis[:tickfontrotation],
|
||||
)
|
||||
end
|
||||
|
||||
# we use the anchors to define orientations for example to align left
|
||||
# one needs to use the right edge as anchor
|
||||
const _pgfx_annotation_halign =
|
||||
KW(:center => "", :left => "right", :right => "left")
|
||||
## --------------------------------------------------------------------------------------
|
||||
# Generates a colormap for pgfplots based on a ColorGradient
|
||||
pgfx_arrow(::Nothing) = "every arrow/.append style={-}"
|
||||
@@ -677,22 +745,24 @@ function pgfx_filllegend!(series_opt, opt)
|
||||
}""")
|
||||
end
|
||||
|
||||
function pgfx_colormap(grad::ColorGradient)
|
||||
join(map(grad.colors) do c
|
||||
pgfx_colormap(cl::PlotUtils.AbstractColorList) = pgfx_colormap(color_list(cl))
|
||||
function pgfx_colormap(v::Vector{<:Colorant})
|
||||
join(map(v) do c
|
||||
@sprintf("rgb=(%.8f,%.8f,%.8f)", red(c), green(c), blue(c))
|
||||
end, "\n")
|
||||
end
|
||||
function pgfx_colormap(grad::Vector{<:Colorant})
|
||||
join(map(grad) do c
|
||||
@sprintf("rgb=(%.8f,%.8f,%.8f)", red(c), green(c), blue(c))
|
||||
function pgfx_colormap(cg::ColorGradient)
|
||||
join(map(1:length(cg)) do i
|
||||
@sprintf("rgb(%.8fcm)=(%.8f,%.8f,%.8f)", cg.values[i], red(cg.colors[i]), green(cg.colors[i]), blue(cg.colors[i]))
|
||||
end, "\n")
|
||||
end
|
||||
|
||||
|
||||
function pgfx_framestyle(style::Symbol)
|
||||
if style in _pgfx_framestyles
|
||||
if style in (:box, :axes, :origin, :zerolines, :grid, :none)
|
||||
return style
|
||||
else
|
||||
default_style = get(_pgfx_framestyle_defaults, style, :axes)
|
||||
default_style = get((semi = :box,), style, :axes)
|
||||
@warn( "Framestyle :$style is not (yet) supported by the PGFPlotsX backend. :$default_style was cosen instead.",)
|
||||
default_style
|
||||
end
|
||||
@@ -711,14 +781,14 @@ function pgfx_fillstyle(plotattributes, i = 1)
|
||||
PGFPlotsX.Options("fill" => cstr, "fill opacity" => a)
|
||||
end
|
||||
|
||||
function pgfx_linestyle(linewidth::Real, color, α = 1, linestyle = "solid")
|
||||
function pgfx_linestyle(linewidth::Real, color, α = 1, linestyle = :solid)
|
||||
cstr = plot_color(color, α)
|
||||
a = alpha(cstr)
|
||||
return PGFPlotsX.Options(
|
||||
"color" => cstr,
|
||||
"draw opacity" => a,
|
||||
"line width" => linewidth,
|
||||
get(_pgfplotsx_linestyles, linestyle, "solid") => nothing,
|
||||
pgfx_get_linestyle(linestyle) => nothing,
|
||||
)
|
||||
end
|
||||
|
||||
@@ -748,7 +818,6 @@ function pgfx_should_add_to_legend(series::Series)
|
||||
:contourf,
|
||||
:contour3d,
|
||||
:heatmap,
|
||||
:pie,
|
||||
:image,
|
||||
)
|
||||
)
|
||||
@@ -756,10 +825,8 @@ end
|
||||
|
||||
function pgfx_marker(plotattributes, i = 1)
|
||||
shape = _cycle(plotattributes[:markershape], i)
|
||||
cstr = plot_color(
|
||||
get_markercolor(plotattributes, i),
|
||||
get_markeralpha(plotattributes, i),
|
||||
)
|
||||
cstr =
|
||||
plot_color(get_markercolor(plotattributes, i), get_markeralpha(plotattributes, i))
|
||||
a = alpha(cstr)
|
||||
cstr_stroke = plot_color(
|
||||
get_markerstrokecolor(plotattributes, i),
|
||||
@@ -771,8 +838,7 @@ function pgfx_marker(plotattributes, i = 1)
|
||||
0.75 *
|
||||
_cycle(plotattributes[:markersize], i)
|
||||
return PGFPlotsX.Options(
|
||||
"mark" =>
|
||||
shape isa Shape ? "PlotsShape$i" : get(_pgfplotsx_markers, shape, "*"),
|
||||
"mark" => shape isa Shape ? "PlotsShape$i" : pgfx_get_marker(shape),
|
||||
"mark size" => "$mark_size pt",
|
||||
"mark options" => PGFPlotsX.Options(
|
||||
"color" => cstr_stroke,
|
||||
@@ -780,7 +846,8 @@ function pgfx_marker(plotattributes, i = 1)
|
||||
"fill" => cstr,
|
||||
"fill opacity" => a,
|
||||
"line width" =>
|
||||
pgfx_thickness_scaling(plotattributes) * 0.75 *
|
||||
pgfx_thickness_scaling(plotattributes) *
|
||||
0.75 *
|
||||
_cycle(plotattributes[:markerstrokewidth], i),
|
||||
"rotate" => if shape == :dtriangle
|
||||
180
|
||||
@@ -791,11 +858,7 @@ function pgfx_marker(plotattributes, i = 1)
|
||||
else
|
||||
0
|
||||
end,
|
||||
get(
|
||||
_pgfplotsx_linestyles,
|
||||
_cycle(plotattributes[:markerstrokestyle], i),
|
||||
"solid",
|
||||
) => nothing,
|
||||
pgfx_get_linestyle(_cycle(plotattributes[:markerstrokestyle], i)) => nothing,
|
||||
),
|
||||
)
|
||||
end
|
||||
@@ -809,7 +872,8 @@ function pgfx_add_annotation!(o, x, y, val, thickness_scaling = 1)
|
||||
[
|
||||
"\\node",
|
||||
PGFPlotsX.Options(
|
||||
get(_pgfx_annotation_halign, val.font.halign, "") => nothing,
|
||||
get((center = "", left = "right", right = "left"), val.font.halign, "") =>
|
||||
nothing,
|
||||
"color" => cstr,
|
||||
"draw opacity" => convert(Float16, a),
|
||||
"rotate" => val.font.rotation,
|
||||
@@ -924,6 +988,7 @@ end
|
||||
function pgfx_sanitize_string(s::LaTeXString)
|
||||
s = replace(s, r"\\?\#" => "\\#")
|
||||
s = replace(s, r"\\?\%" => "\\%")
|
||||
return LaTeXString(s)
|
||||
end
|
||||
end
|
||||
function pgfx_sanitize_plot!(plt)
|
||||
@@ -989,10 +1054,10 @@ function pgfx_axis!(opt::PGFPlotsX.Options, sp::Subplot, letter)
|
||||
|
||||
# axis label position
|
||||
labelpos = ""
|
||||
if letter == :x && axis[:guide_position] == :top
|
||||
labelpos = "at={(0.5,1)},above,"
|
||||
elseif letter == :y && axis[:guide_position] == :right
|
||||
labelpos = "at={(1,0.5)},below,"
|
||||
if letter == :x
|
||||
labelpos = pgfx_get_xguide_pos(axis[:guide_position])
|
||||
elseif letter == :y
|
||||
labelpos = pgfx_get_yguide_pos(axis[:guide_position])
|
||||
end
|
||||
|
||||
# Add label font
|
||||
@@ -1085,17 +1150,8 @@ function pgfx_axis!(opt::PGFPlotsX.Options, sp::Subplot, letter)
|
||||
string(letter, "tick align") =>
|
||||
(axis[:tick_direction] == :out ? "outside" : "inside"),
|
||||
)
|
||||
cstr = plot_color(axis[:tickfontcolor])
|
||||
α = alpha(cstr)
|
||||
push!(
|
||||
opt,
|
||||
string(letter, "ticklabel style") => PGFPlotsX.Options(
|
||||
"font" =>
|
||||
pgfx_font(axis[:tickfontsize], pgfx_thickness_scaling(sp)),
|
||||
"color" => cstr,
|
||||
"draw opacity" => α,
|
||||
"rotate" => axis[:tickfontrotation],
|
||||
),
|
||||
opt, string(letter, "ticklabel style") => pgfx_get_ticklabel_style(sp, axis)
|
||||
)
|
||||
push!(
|
||||
opt,
|
||||
@@ -1183,6 +1239,7 @@ function pgfx_axis!(opt::PGFPlotsX.Options, sp::Subplot, letter)
|
||||
)
|
||||
end
|
||||
end
|
||||
|
||||
# --------------------------------------------------------------------------------------
|
||||
# display calls this and then _display, its called 3 times for plot(1:5)
|
||||
# Set the (left, top, right, bottom) minimum padding around the plot area
|
||||
|
||||
+90
-66
@@ -3,13 +3,11 @@
|
||||
|
||||
is_subplot_supported(::PlotlyBackend) = true
|
||||
# is_string_supported(::PlotlyBackend) = true
|
||||
const _plotly_framestyles = [:box, :axes, :zerolines, :grid, :none]
|
||||
const _plotly_framestyle_defaults = Dict(:semi => :box, :origin => :zerolines)
|
||||
function _plotly_framestyle(style::Symbol)
|
||||
if style in _plotly_framestyles
|
||||
if style in (:box, :axes, :zerolines, :grid, :none)
|
||||
return style
|
||||
else
|
||||
default_style = get(_plotly_framestyle_defaults, style, :axes)
|
||||
default_style = get((semi = :box, origin = :zerolines), style, :axes)
|
||||
@warn("Framestyle :$style is not supported by Plotly and PlotlyJS. :$default_style was cosen instead.")
|
||||
default_style
|
||||
end
|
||||
@@ -17,31 +15,11 @@ end
|
||||
|
||||
|
||||
# --------------------------------------------------------------------------------------
|
||||
const plotly_remote_file_path = "https://cdn.plot.ly/plotly-latest.min.js"
|
||||
|
||||
|
||||
# if isatom()
|
||||
# import Atom
|
||||
# Atom.@msg evaljs(_js_code)
|
||||
# end
|
||||
using UUIDs
|
||||
|
||||
# ----------------------------------------------------------------
|
||||
|
||||
const _plotly_legend_pos = KW(
|
||||
:right => [1., 0.5],
|
||||
:left => [0., 0.5],
|
||||
:top => [0.5, 1.],
|
||||
:bottom => [0.5, 0.],
|
||||
:bottomleft => [0., 0.],
|
||||
:bottomright => [1., 0.],
|
||||
:topright => [1., 1.],
|
||||
:topleft => [0., 1.]
|
||||
)
|
||||
|
||||
plotly_legend_pos(pos::Symbol) = get(_plotly_legend_pos, pos, [1.,1.])
|
||||
plotly_legend_pos(v::Tuple{S,T}) where {S<:Real, T<:Real} = v
|
||||
|
||||
function plotly_font(font::Font, color = font.color)
|
||||
KW(
|
||||
:family => font.family,
|
||||
@@ -245,7 +223,7 @@ function plotly_layout(plt::Plot)
|
||||
# but vertically just below the top of the subplot bounding box
|
||||
if sp[:title] != ""
|
||||
bb = plotarea(sp)
|
||||
tpos = sp[:title_location]
|
||||
tpos = sp[:titlelocation]
|
||||
xmm = if tpos == :left
|
||||
left(bb)
|
||||
elseif tpos == :right
|
||||
@@ -291,18 +269,7 @@ function plotly_layout(plt::Plot)
|
||||
end
|
||||
|
||||
# legend
|
||||
plotattributes_out[:showlegend] = sp[:legend] != :none
|
||||
xpos,ypos = plotly_legend_pos(sp[:legend])
|
||||
if sp[:legend] != :none
|
||||
plotattributes_out[:legend] = KW(
|
||||
:bgcolor => rgba_string(sp[:background_color_legend]),
|
||||
:bordercolor => rgba_string(sp[:foreground_color_legend]),
|
||||
:font => plotly_font(legendfont(sp)),
|
||||
:tracegroupgap => 0,
|
||||
:x => xpos,
|
||||
:y => ypos
|
||||
)
|
||||
end
|
||||
plotly_add_legend!(plotattributes_out, sp)
|
||||
|
||||
# annotations
|
||||
for ann in sp[:annotations]
|
||||
@@ -342,38 +309,95 @@ function plotly_layout(plt::Plot)
|
||||
plotattributes_out[:hovermode] = "none"
|
||||
end
|
||||
|
||||
plotattributes_out
|
||||
plotattributes_out = recursive_merge(plotattributes_out, plt.attr[:extra_plot_kwargs])
|
||||
end
|
||||
|
||||
|
||||
function plotly_add_legend!(plotattributes_out::KW, sp::Subplot)
|
||||
plotattributes_out[:showlegend] = sp[:legend] != :none
|
||||
legend_position = plotly_legend_pos(sp[:legend])
|
||||
if sp[:legend] != :none
|
||||
plotattributes_out[:legend] = KW(
|
||||
:bgcolor => rgba_string(sp[:background_color_legend]),
|
||||
:bordercolor => rgba_string(sp[:foreground_color_legend]),
|
||||
:borderwidth => 1,
|
||||
:traceorder => "normal",
|
||||
:xanchor => legend_position.xanchor,
|
||||
:yanchor => legend_position.yanchor,
|
||||
:font => plotly_font(legendfont(sp)),
|
||||
:tracegroupgap => 0,
|
||||
:x => legend_position.coords[1],
|
||||
:y => legend_position.coords[2]
|
||||
)
|
||||
end
|
||||
end
|
||||
|
||||
function plotly_legend_pos(pos::Symbol)
|
||||
xleft = 0.07
|
||||
ybot = 0.07
|
||||
ycenter = 0.52
|
||||
xcenter = 0.55
|
||||
plotly_legend_position_mapping = (
|
||||
right = (coords = [1.0, ycenter], xanchor = "right", yanchor = "middle"),
|
||||
left = (coords = [xleft, ycenter], xanchor = "left", yanchor = "middle"),
|
||||
top = (coords = [xcenter, 1.0], xanchor = "center", yanchor = "top"),
|
||||
bottom = (coords = [xcenter, ybot], xanchor = "center", yanchor = "bottom"),
|
||||
bottomleft = (coords = [xleft, ybot], xanchor = "left", yanchor = "bottom"),
|
||||
bottomright = (coords = [1.0, ybot], xanchor = "right", yanchor = "bottom"),
|
||||
topright = (coords = [1.0, 1.0], xanchor = "right", yanchor = "top"),
|
||||
topleft = (coords = [xleft, 1.0], xanchor = "left", yanchor = "top"),
|
||||
default = (coords = [1.02, 1.0], xanchor = "auto", yanchor = "auto")
|
||||
)
|
||||
|
||||
legend_position = get(plotly_legend_position_mapping, pos, plotly_legend_position_mapping.default)
|
||||
end
|
||||
|
||||
plotly_legend_pos(v::Tuple{S,T}) where {S<:Real, T<:Real} = (coords=v, xanchor="left", yanchor="top")
|
||||
|
||||
|
||||
function plotly_layout_json(plt::Plot)
|
||||
JSON.json(plotly_layout(plt), 4)
|
||||
end
|
||||
|
||||
|
||||
function plotly_colorscale(grad::ColorGradient, α)
|
||||
[[grad.values[i], rgba_string(plot_color(grad.colors[i], α))] for i in eachindex(grad.colors)]
|
||||
end
|
||||
plotly_colorscale(c::Colorant,α) = plotly_colorscale(_as_gradient(c),α)
|
||||
function plotly_colorscale(c::AbstractVector{<:RGBA}, α)
|
||||
plotly_colorscale(cg::ColorGradient, α = nothing) =
|
||||
[[v, rgba_string(plot_color(cg.colors[v], α))] for v in cg.values]
|
||||
function plotly_colorscale(c::AbstractVector{<:Colorant}, α = nothing)
|
||||
if length(c) == 1
|
||||
return [[0.0, rgba_string(plot_color(c[1], α))], [1.0, rgba_string(plot_color(c[1], α))]]
|
||||
return [
|
||||
[0.0, rgba_string(plot_color(c[1], α))],
|
||||
[1.0, rgba_string(plot_color(c[1], α))],
|
||||
]
|
||||
else
|
||||
vals = range(0.0, stop=1.0, length=length(c))
|
||||
vals = range(0.0, stop = 1.0, length = length(c))
|
||||
return [[vals[i], rgba_string(plot_color(c[i], α))] for i in eachindex(c)]
|
||||
end
|
||||
end
|
||||
# plotly_colorscale(c, alpha = nothing) = plotly_colorscale(cgrad(), alpha)
|
||||
function plotly_colorscale(cg::PlotUtils.CategoricalColorGradient, α = nothing)
|
||||
n = length(cg)
|
||||
cinds = repeat(1:n, inner = 2)
|
||||
vinds = vcat((i:(i + 1) for i in 1:n)...)
|
||||
return [
|
||||
[cg.values[vinds[i]], rgba_string(plot_color(color_list(cg)[cinds[i]], α))]
|
||||
for i in eachindex(cinds)
|
||||
]
|
||||
end
|
||||
plotly_colorscale(c, α = nothing) = plotly_colorscale(_as_gradient(c), α)
|
||||
|
||||
|
||||
const _plotly_markers = KW(
|
||||
:rect => "square",
|
||||
:xcross => "x",
|
||||
:x => "x",
|
||||
:utriangle => "triangle-up",
|
||||
:dtriangle => "triangle-down",
|
||||
:star5 => "star-triangle-up",
|
||||
:vline => "line-ns",
|
||||
:hline => "line-ew",
|
||||
get_plotly_marker(k, def) = get(
|
||||
(
|
||||
rect = "square",
|
||||
xcross = "x",
|
||||
x = "x",
|
||||
utriangle = "triangle-up",
|
||||
dtriangle = "triangle-down",
|
||||
star5 = "star-triangle-up",
|
||||
vline = "line-ns",
|
||||
hline = "line-ew",
|
||||
),
|
||||
k,
|
||||
def,
|
||||
)
|
||||
|
||||
# find indicies of axes to which the supblot links to
|
||||
@@ -535,12 +559,6 @@ function plotly_series(plt::Plot, series::Series)
|
||||
plotattributes_out[:showscale] = hascolorbar(sp)
|
||||
end
|
||||
|
||||
elseif st == :pie
|
||||
plotattributes_out[:type] = "pie"
|
||||
plotattributes_out[:labels] = pie_labels(sp, series)
|
||||
plotattributes_out[:values] = y
|
||||
plotattributes_out[:hoverinfo] = "label+percent+name"
|
||||
|
||||
else
|
||||
@warn("Plotly: seriestype $st isn't supported.")
|
||||
return KW()
|
||||
@@ -550,7 +568,7 @@ function plotly_series(plt::Plot, series::Series)
|
||||
if hasmarker
|
||||
inds = eachindex(x)
|
||||
plotattributes_out[:marker] = KW(
|
||||
:symbol => get(_plotly_markers, series[:markershape], string(series[:markershape])),
|
||||
:symbol => get_plotly_marker(series[:markershape], string(series[:markershape])),
|
||||
# :opacity => series[:markeralpha],
|
||||
:size => 2 * _cycle(series[:markersize], inds),
|
||||
:color => rgba_string.(plot_color.(get_markercolor.(series, inds), get_markeralpha.(series, inds))),
|
||||
@@ -670,7 +688,7 @@ function plotly_series_segments(series::Series, plotattributes_base::KW, x, y, z
|
||||
# add "marker"
|
||||
if hasmarker
|
||||
plotattributes_out[:marker] = KW(
|
||||
:symbol => get(_plotly_markers, _cycle(series[:markershape], i), string(_cycle(series[:markershape], i))),
|
||||
:symbol => get_plotly_marker(_cycle(series[:markershape], i), string(_cycle(series[:markershape], i))),
|
||||
# :opacity => series[:markeralpha],
|
||||
:size => 2 * _cycle(series[:markersize], i),
|
||||
:color => rgba_string(plot_color(get_markercolor(series, clims, i), get_markeralpha(series, i))),
|
||||
@@ -808,8 +826,14 @@ html_body(plt::Plot{PlotlyBackend}) = plotly_html_body(plt)
|
||||
const ijulia_initialized = Ref(false)
|
||||
|
||||
function plotly_html_head(plt::Plot)
|
||||
local_file = ("file://" * plotly_local_file_path)
|
||||
plotly = use_local_dependencies[] ? local_file : plotly_remote_file_path
|
||||
local_file = ("file:///" * plotly_local_file_path)
|
||||
plotly =
|
||||
use_local_dependencies[] ? local_file : "https://cdn.plot.ly/plotly-1.54.2.min.js"
|
||||
|
||||
include_mathjax = get(plt[:extra_plot_kwargs], :include_mathjax, "")
|
||||
mathjax_file = include_mathjax != "cdn" ? ("file://" * include_mathjax) : "https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.7/MathJax.js?config=TeX-MML-AM_CHTML"
|
||||
mathjax_head = include_mathjax == "" ? "" : "<script src=\"$mathjax_file\"></script>\n\t\t"
|
||||
|
||||
if isijulia() && !ijulia_initialized[]
|
||||
# using requirejs seems to be key to load a js depency in IJulia!
|
||||
# https://requirejs.org/docs/start.html
|
||||
@@ -823,7 +847,7 @@ function plotly_html_head(plt::Plot)
|
||||
""")
|
||||
ijulia_initialized[] = true
|
||||
end
|
||||
return "<script src=$(repr(plotly))></script>"
|
||||
return "$mathjax_head<script src=$(repr(plotly))></script>"
|
||||
end
|
||||
|
||||
function plotly_html_body(plt, style = nothing)
|
||||
|
||||
@@ -19,14 +19,12 @@ end
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
const _plotlyjs_mimeformats = Dict(
|
||||
for (mime, fmt) in (
|
||||
"application/pdf" => "pdf",
|
||||
"image/png" => "png",
|
||||
"image/svg+xml" => "svg",
|
||||
"image/eps" => "eps",
|
||||
)
|
||||
|
||||
for (mime, fmt) in _plotlyjs_mimeformats
|
||||
@eval _show(io::IO, ::MIME{Symbol($mime)}, plt::Plot{PlotlyJSBackend}) = PlotlyJS.savefig(io, plotlyjs_syncplot(plt), format = $fmt)
|
||||
end
|
||||
|
||||
|
||||
+167
-121
@@ -1,6 +1,3 @@
|
||||
# Do "using PyPlot: PyCall, LaTeXStrings" without dependency warning:
|
||||
const PyCall = PyPlot.PyCall
|
||||
const LaTeXStrings = PyPlot.LaTeXStrings
|
||||
|
||||
# https://github.com/stevengj/PyPlot.jl
|
||||
|
||||
@@ -16,6 +13,7 @@ append!(Base.Multimedia.displays, otherdisplays)
|
||||
pycolors = PyPlot.pyimport("matplotlib.colors")
|
||||
pypath = PyPlot.pyimport("matplotlib.path")
|
||||
mplot3d = PyPlot.pyimport("mpl_toolkits.mplot3d")
|
||||
axes_grid1 = PyPlot.pyimport("mpl_toolkits.axes_grid1")
|
||||
pypatches = PyPlot.pyimport("matplotlib.patches")
|
||||
pyfont = PyPlot.pyimport("matplotlib.font_manager")
|
||||
pyticker = PyPlot.pyimport("matplotlib.ticker")
|
||||
@@ -35,7 +33,7 @@ else
|
||||
end
|
||||
|
||||
# PyCall API changes in v1.90.0
|
||||
if !isdefined(PyCall, :_setproperty!)
|
||||
if !isdefined(PyPlot.PyCall, :_setproperty!)
|
||||
@warn "Plots no longer supports PyCall < 1.90.0 and PyPlot < 2.8.0. Either update PyCall and PyPlot or pin Plots to a version <= 0.23.2."
|
||||
end
|
||||
|
||||
@@ -64,16 +62,23 @@ end
|
||||
py_color(s) = py_color(parse(Colorant, string(s)))
|
||||
py_color(c::Colorant) = (red(c), green(c), blue(c), alpha(c))
|
||||
py_color(cs::AVec) = map(py_color, cs)
|
||||
py_color(grad::ColorGradient) = py_color(grad.colors)
|
||||
py_color(grad::PlotUtils.AbstractColorList) = py_color(color_list(grad))
|
||||
py_color(c::Colorant, α) = py_color(plot_color(c, α))
|
||||
|
||||
function py_colormap(grad::ColorGradient)
|
||||
pyvals = [(z, py_color(grad[z])) for z in grad.values]
|
||||
function py_colormap(cg::ColorGradient)
|
||||
pyvals = collect(zip(cg.values, py_color(PlotUtils.color_list(cg))))
|
||||
cm = pycolors."LinearSegmentedColormap"."from_list"("tmp", pyvals)
|
||||
cm."set_bad"(color=(0,0,0,0.0), alpha=0.0)
|
||||
cm
|
||||
end
|
||||
py_colormap(c::Colorant) = py_colormap(_as_gradient(c))
|
||||
function py_colormap(cg::PlotUtils.CategoricalColorGradient)
|
||||
r = range(0, stop = 1, length = 256)
|
||||
pyvals = collect(zip(r, py_color(cg[r])))
|
||||
cm = pycolors."LinearSegmentedColormap"."from_list"("tmp", pyvals)
|
||||
cm."set_bad"(color=(0,0,0,0.0), alpha=0.0)
|
||||
cm
|
||||
end
|
||||
py_colormap(c) = py_colormap(_as_gradient(c))
|
||||
|
||||
|
||||
function py_shading(c, z)
|
||||
@@ -105,32 +110,6 @@ function py_marker(marker::Shape)
|
||||
pypath."Path"(mat)
|
||||
end
|
||||
|
||||
const _path_MOVETO = UInt8(1)
|
||||
const _path_LINETO = UInt8(2)
|
||||
const _path_CLOSEPOLY = UInt8(79)
|
||||
|
||||
# # see http://matplotlib.org/users/path_tutorial.html
|
||||
# # and http://matplotlib.org/api/path_api.html#matplotlib.path.Path
|
||||
# function py_path(x, y)
|
||||
# n = length(x)
|
||||
# mat = zeros(n+1, 2)
|
||||
# codes = zeros(UInt8, n+1)
|
||||
# lastnan = true
|
||||
# for i=1:n
|
||||
# mat[i,1] = x[i]
|
||||
# mat[i,2] = y[i]
|
||||
# nan = !ok(x[i], y[i])
|
||||
# codes[i] = if nan && i>1
|
||||
# _path_CLOSEPOLY
|
||||
# else
|
||||
# lastnan ? _path_MOVETO : _path_LINETO
|
||||
# end
|
||||
# lastnan = nan
|
||||
# end
|
||||
# codes[n+1] = _path_CLOSEPOLY
|
||||
# pypath["Path"](mat, codes)
|
||||
# end
|
||||
|
||||
# get the marker shape
|
||||
function py_marker(marker::Symbol)
|
||||
marker == :none && return " "
|
||||
@@ -197,19 +176,19 @@ end
|
||||
|
||||
function labelfunc(scale::Symbol, backend::PyPlotBackend)
|
||||
if scale == :log10
|
||||
x -> LaTeXStrings.latexstring("10^{$x}")
|
||||
x -> PyPlot.LaTeXStrings.latexstring("10^{$x}")
|
||||
elseif scale == :log2
|
||||
x -> LaTeXStrings.latexstring("2^{$x}")
|
||||
x -> PyPlot.LaTeXStrings.latexstring("2^{$x}")
|
||||
elseif scale == :ln
|
||||
x -> LaTeXStrings.latexstring("e^{$x}")
|
||||
x -> PyPlot.LaTeXStrings.latexstring("e^{$x}")
|
||||
else
|
||||
string
|
||||
x -> PyPlot.LaTeXStrings.latexstring(convert_sci_unicode(x))
|
||||
end
|
||||
end
|
||||
|
||||
function py_mask_nans(z)
|
||||
# pynp["ma"][:masked_invalid](z)))
|
||||
PyCall.pycall(pynp."ma"."masked_invalid", Any, z)
|
||||
PyPlot.PyCall.pycall(pynp."ma"."masked_invalid", Any, z)
|
||||
# pynp["ma"][:masked_where](pynp["isnan"](z),z)
|
||||
end
|
||||
|
||||
@@ -539,7 +518,7 @@ function py_add_series(plt::Plot{PyPlotBackend}, series::Series)
|
||||
label = series[:label],
|
||||
zorder = series[:series_plotindex] + 0.5,
|
||||
marker = py_marker(_cycle(shapes,i)),
|
||||
s = py_thickness_scale(plt, _cycle(series[:markersize],i) .^ 2),
|
||||
s = py_thickness_scale(plt, _cycle(series[:markersize],i)).^ 2,
|
||||
facecolors = py_color(get_markercolor(series, i), get_markercoloralpha(series, i)),
|
||||
edgecolors = msc,
|
||||
linewidths = lw,
|
||||
@@ -570,7 +549,7 @@ function py_add_series(plt::Plot{PyPlotBackend}, series::Series)
|
||||
push!(cur_y_list, _cycle(y,i))
|
||||
|
||||
push!(cur_color_list, _cycle(markercolor, i))
|
||||
push!(cur_scale_list, py_thickness_scale(plt, _cycle(series[:markersize],i) .^ 2))
|
||||
push!(cur_scale_list, py_thickness_scale(plt, _cycle(series[:markersize],i)).^ 2)
|
||||
|
||||
continue
|
||||
end
|
||||
@@ -580,7 +559,7 @@ function py_add_series(plt::Plot{PyPlotBackend}, series::Series)
|
||||
zorder = series[:series_plotindex] + 0.5,
|
||||
marker = prev_marker,
|
||||
s = cur_scale_list,
|
||||
edgecolors = py_color(get_markerstrokecolor(series), get_markerstrokealpha(series)), # Do we need include i?
|
||||
edgecolors = py_color(get_markerstrokecolor(series), get_markerstrokealpha(series)),
|
||||
linewidths = py_thickness_scale(plt, series[:markerstrokewidth]),
|
||||
facecolors = cur_color_list,
|
||||
extrakw...
|
||||
@@ -590,7 +569,7 @@ function py_add_series(plt::Plot{PyPlotBackend}, series::Series)
|
||||
cur_y_list = [_cycle(y,i)]
|
||||
|
||||
cur_color_list = [_cycle(markercolor, i)]
|
||||
cur_scale_list = [py_thickness_scale(plt, _cycle(series[:markersize],i) .^ 2)]
|
||||
cur_scale_list = [py_thickness_scale(plt, _cycle(series[:markersize],i)) .^ 2]
|
||||
|
||||
prev_marker = cur_marker
|
||||
end
|
||||
@@ -611,11 +590,17 @@ function py_add_series(plt::Plot{PyPlotBackend}, series::Series)
|
||||
push!(handles, handle)
|
||||
else
|
||||
# do a normal scatter plot
|
||||
|
||||
# Add depthshade option for 3d plots
|
||||
if RecipesPipeline.is3d(sp)
|
||||
extrakw[:depthshade] = get(series[:extra_kwargs], :depthshade, false)
|
||||
end
|
||||
|
||||
handle = ax."scatter"(xyargs...;
|
||||
label = series[:label],
|
||||
zorder = series[:series_plotindex] + 0.5,
|
||||
marker = py_marker(series[:markershape]),
|
||||
s = py_thickness_scale(plt, series[:markersize] .^ 2),
|
||||
s = py_thickness_scale(plt, series[:markersize]) .^2,
|
||||
edgecolors = py_color(get_markerstrokecolor(series), get_markerstrokealpha(series)),
|
||||
linewidths = py_thickness_scale(plt, series[:markerstrokewidth]),
|
||||
extrakw...
|
||||
@@ -625,14 +610,16 @@ function py_add_series(plt::Plot{PyPlotBackend}, series::Series)
|
||||
end
|
||||
|
||||
if st == :hexbin
|
||||
handle = ax."hexbin"(x, y;
|
||||
handle = ax."hexbin"(x, y,
|
||||
label = series[:label],
|
||||
zorder = series[:series_plotindex],
|
||||
gridsize = series[:bins],
|
||||
C = series[:weights],
|
||||
gridsize = series[:bins]==:auto ? 100 : series[:bins], # 100 is the default value
|
||||
linewidths = py_thickness_scale(plt, series[:linewidth]),
|
||||
edgecolors = py_color(get_linecolor(series)),
|
||||
alpha = series[:fillalpha],
|
||||
cmap = py_fillcolormap(series), # applies to the pcolorfast object
|
||||
extrakw...
|
||||
zorder = series[:series_plotindex],
|
||||
# extrakw... # We are not supporting clims for hexbin as calculation of bins is not trivial
|
||||
)
|
||||
push!(handles, handle)
|
||||
end
|
||||
@@ -665,7 +652,7 @@ function py_add_series(plt::Plot{PyPlotBackend}, series::Series)
|
||||
extrakw...
|
||||
)
|
||||
if series[:contour_labels] == true
|
||||
PyPlot."clabel"(handle, handle.levels)
|
||||
ax."clabel"(handle, handle.levels)
|
||||
end
|
||||
push!(handles, handle)
|
||||
|
||||
@@ -674,6 +661,7 @@ function py_add_series(plt::Plot{PyPlotBackend}, series::Series)
|
||||
handle = ax."contourf"(x, y, z, levelargs...;
|
||||
label = series[:label],
|
||||
zorder = series[:series_plotindex] + 0.5,
|
||||
alpha = series[:fillalpha],
|
||||
extrakw...
|
||||
)
|
||||
push!(handles, handle)
|
||||
@@ -751,7 +739,7 @@ function py_add_series(plt::Plot{PyPlotBackend}, series::Series)
|
||||
end
|
||||
handle = ax."imshow"(z;
|
||||
zorder = series[:series_plotindex],
|
||||
cmap = py_colormap(cgrad([:black, :white])),
|
||||
cmap = py_colormap(cgrad(plot_color([:black, :white]))),
|
||||
vmin = 0.0,
|
||||
vmax = 1.0,
|
||||
extent = (xmin-0.5, xmax+0.5, ymax+0.5, ymin-0.5)
|
||||
@@ -806,21 +794,6 @@ function py_add_series(plt::Plot{PyPlotBackend}, series::Series)
|
||||
push!(handles, handle)
|
||||
end
|
||||
|
||||
if st == :pie
|
||||
handle = ax."pie"(y;
|
||||
# colors = # a vector of colors?
|
||||
labels = pie_labels(sp, series)
|
||||
)[1]
|
||||
push!(handles, handle)
|
||||
|
||||
# # expand extrema... get list of Wedge objects
|
||||
# for wedge in handle
|
||||
# path = wedge[:get_path]()
|
||||
# for
|
||||
lim = 1.1
|
||||
expand_extrema!(sp, -lim, lim, -lim, lim)
|
||||
end
|
||||
|
||||
series[:serieshandle] = handles
|
||||
|
||||
# # smoothing
|
||||
@@ -937,7 +910,7 @@ function py_set_axis_colors(sp, ax, a::Axis)
|
||||
spine."set_color"(py_color(a[:foreground_color_border]))
|
||||
end
|
||||
axissym = Symbol(a[:letter], :axis)
|
||||
if PyCall.hasproperty(ax, axissym)
|
||||
if PyPlot.PyCall.hasproperty(ax, axissym)
|
||||
tickcolor = sp[:framestyle] in (:zerolines, :grid) ? py_color(plot_color(a[:foreground_color_grid], a[:gridalpha])) : py_color(a[:foreground_color_axis])
|
||||
ax."tick_params"(axis=string(a[:letter]), which="both",
|
||||
colors=tickcolor,
|
||||
@@ -987,7 +960,7 @@ function _before_layout_calcs(plt::Plot{PyPlotBackend})
|
||||
|
||||
# title
|
||||
if sp[:title] != ""
|
||||
loc = lowercase(string(sp[:title_location]))
|
||||
loc = lowercase(string(sp[:titlelocation]))
|
||||
func = if loc == "left"
|
||||
:_left_title
|
||||
elseif loc == "right"
|
||||
@@ -1032,12 +1005,53 @@ function _before_layout_calcs(plt::Plot{PyPlotBackend})
|
||||
end
|
||||
kw[:spacing] = "proportional"
|
||||
|
||||
# create and store the colorbar object (handle) and the axis that it is drawn on.
|
||||
# note: the colorbar axis is positioned independently from the subplot axis
|
||||
fig = plt.o
|
||||
cbax = fig."add_axes"([0.8,0.1,0.03,0.8], label = string(gensym()))
|
||||
cb = fig."colorbar"(handle; cax = cbax, kw...)
|
||||
|
||||
if RecipesPipeline.is3d(sp)
|
||||
cbax = fig."add_axes"([0.9, 0.1, 0.03, 0.8])
|
||||
cb = fig."colorbar"(handle; cax=cbax, kw...)
|
||||
else
|
||||
# divider approach works only with 2d plots
|
||||
divider = axes_grid1.make_axes_locatable(ax)
|
||||
# width = axes_grid1.axes_size.AxesY(ax, aspect=1.0 / 3.5)
|
||||
# pad = axes_grid1.axes_size.Fraction(0.5, width) # Colorbar is spaced 0.5 of its size away from the ax
|
||||
# cbax = divider.append_axes("right", size=width, pad=pad) # This approach does not work well in subplots
|
||||
colorbar_position = "right"
|
||||
colorbar_pad = "2.5%"
|
||||
colorbar_orientation="vertical"
|
||||
|
||||
if sp[:colorbar] == :left
|
||||
colorbar_position = string(sp[:colorbar])
|
||||
colorbar_pad = "5%"
|
||||
elseif sp[:colorbar] == :top
|
||||
colorbar_position = string(sp[:colorbar])
|
||||
colorbar_pad = "2.5%"
|
||||
colorbar_orientation="horizontal"
|
||||
elseif sp[:colorbar] == :bottom
|
||||
colorbar_position = string(sp[:colorbar])
|
||||
colorbar_pad = "5%"
|
||||
colorbar_orientation="horizontal"
|
||||
end
|
||||
|
||||
cbax = divider.append_axes(colorbar_position, size="5%", pad=colorbar_pad) # Reasonable value works most of the usecases
|
||||
cb = fig."colorbar"(handle; cax=cbax, orientation = colorbar_orientation, kw...)
|
||||
|
||||
if sp[:colorbar] == :left
|
||||
cbax.yaxis.set_ticks_position("left")
|
||||
elseif sp[:colorbar] == :top
|
||||
cbax.xaxis.set_ticks_position("top")
|
||||
elseif sp[:colorbar] == :bottom
|
||||
cbax.xaxis.set_ticks_position("bottom")
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
cb."set_label"(sp[:colorbar_title],size=py_thickness_scale(plt, sp[:yaxis][:guidefontsize]),family=sp[:yaxis][:guidefontfamily], color = py_color(sp[:yaxis][:guidefontcolor]))
|
||||
|
||||
# cb."formatter".set_useOffset(false) # This for some reason does not work, must be a pyplot bug, instead this is a workaround:
|
||||
cb."formatter".set_powerlimits((-Inf, Inf))
|
||||
cb."update_ticks"()
|
||||
|
||||
for lab in cb."ax"."yaxis"."get_ticklabels"()
|
||||
lab."set_fontsize"(py_thickness_scale(plt, sp[:yaxis][:tickfontsize]))
|
||||
lab."set_family"(sp[:yaxis][:tickfontfamily])
|
||||
@@ -1078,7 +1092,7 @@ function _before_layout_calcs(plt::Plot{PyPlotBackend})
|
||||
# axis attributes
|
||||
for letter in (:x, :y, :z)
|
||||
axissym = Symbol(letter, :axis)
|
||||
PyCall.hasproperty(ax, axissym) || continue
|
||||
PyPlot.PyCall.hasproperty(ax, axissym) || continue
|
||||
axis = sp[axissym]
|
||||
pyaxis = getproperty(ax, axissym)
|
||||
if axis[:mirror] && letter != :z
|
||||
@@ -1101,7 +1115,10 @@ function _before_layout_calcs(plt::Plot{PyPlotBackend})
|
||||
ticks[2][ticks[1] .== 0] .= ""
|
||||
end
|
||||
axis[:ticks] != :native ? py_set_ticks(ax, ticks, letter) : nothing
|
||||
pyaxis."set_tick_params"(direction = axis[:tick_direction] == :out ? "out" : "in")
|
||||
|
||||
intensity = 0.5 # This value corresponds to scaling of other grid elements
|
||||
pyaxis."set_tick_params"(direction = axis[:tick_direction] == :out ? "out" : "in", width=py_thickness_scale(plt, intensity))
|
||||
|
||||
getproperty(ax, Symbol("set_", letter, "label"))(axis[:guide])
|
||||
if get(axis.plotattributes, :flip, false)
|
||||
getproperty(ax, Symbol("invert_", letter, "axis"))()
|
||||
@@ -1109,6 +1126,10 @@ function _before_layout_calcs(plt::Plot{PyPlotBackend})
|
||||
pyaxis."label"."set_fontsize"(py_thickness_scale(plt, axis[:guidefontsize]))
|
||||
pyaxis."label"."set_family"(axis[:guidefontfamily])
|
||||
|
||||
if (RecipesPipeline.is3d(sp))
|
||||
pyaxis."set_rotate_label"(false)
|
||||
end
|
||||
|
||||
if (letter == :y && !RecipesPipeline.is3d(sp))
|
||||
pyaxis."label"."set_rotation"(axis[:guidefontrotation] + 90)
|
||||
else
|
||||
@@ -1131,6 +1152,35 @@ function _before_layout_calcs(plt::Plot{PyPlotBackend})
|
||||
else
|
||||
pyaxis."grid"(false)
|
||||
end
|
||||
#
|
||||
|
||||
if axis[:minorticks] > 1
|
||||
pyaxis."set_minor_locator"(PyPlot.matplotlib.ticker.AutoMinorLocator(axis[:minorticks]))
|
||||
pyaxis."set_tick_params"(
|
||||
which = "minor",
|
||||
direction = axis[:tick_direction] == :out ? "out" : "in",
|
||||
width=py_thickness_scale(plt, intensity))
|
||||
end
|
||||
|
||||
if axis[:minorgrid]
|
||||
if !(axis[:minorticks] > 1) # Check if ticks were already configured
|
||||
ax."minorticks_on"()
|
||||
end
|
||||
pyaxis."set_tick_params"(
|
||||
which = "minor",
|
||||
direction = axis[:tick_direction] == :out ? "out" : "in",
|
||||
width=py_thickness_scale(plt, intensity))
|
||||
|
||||
pyaxis."grid"(true,
|
||||
which = "minor",
|
||||
color = fgcolor,
|
||||
linestyle = py_linestyle(:line, axis[:minorgridstyle]),
|
||||
linewidth = py_thickness_scale(plt, axis[:minorgridlinewidth]),
|
||||
alpha = axis[:minorgridalpha])
|
||||
end
|
||||
|
||||
|
||||
|
||||
py_set_axis_colors(sp, ax, axis)
|
||||
end
|
||||
|
||||
@@ -1213,7 +1263,7 @@ function _update_min_padding!(sp::Subplot{PyPlotBackend})
|
||||
# optionally add the width of colorbar labels and colorbar to rightpad
|
||||
if haskey(sp.attr, :cbar_ax)
|
||||
bb = py_bbox(sp.attr[:cbar_handle]."ax"."get_yticklabels"())
|
||||
sp.attr[:cbar_width] = _cbar_width + width(bb) + 2.3mm + (sp[:colorbar_title] == "" ? 0px : 30px)
|
||||
sp.attr[:cbar_width] = _cbar_width + width(bb) + (sp[:colorbar_title] == "" ? 0px : 30px)
|
||||
rightpad = rightpad + sp.attr[:cbar_width]
|
||||
end
|
||||
|
||||
@@ -1254,43 +1304,44 @@ end
|
||||
|
||||
# -----------------------------------------------------------------
|
||||
|
||||
const _pyplot_legend_pos = KW(
|
||||
:right => "right",
|
||||
:left => "center left",
|
||||
:top => "upper center",
|
||||
:bottom => "lower center",
|
||||
:bottomleft => "lower left",
|
||||
:bottomright => "lower right",
|
||||
:topright => "upper right",
|
||||
:topleft => "upper left"
|
||||
)
|
||||
|
||||
const _pyplot_legend_pos_outer = KW(
|
||||
:outerright => "center left",
|
||||
:outerleft => "right",
|
||||
:outertop => "lower center",
|
||||
:outerbottom => "upper center",
|
||||
:outerbottomleft => "lower right",
|
||||
:outerbottomright => "lower left",
|
||||
:outertopright => "upper left",
|
||||
:outertopleft => "upper right"
|
||||
py_legend_pos(pos::Symbol) = get(
|
||||
(
|
||||
right = "right",
|
||||
left = "center left",
|
||||
top = "upper center",
|
||||
bottom = "lower center",
|
||||
bottomleft = "lower left",
|
||||
bottomright = "lower right",
|
||||
topright = "upper right",
|
||||
topleft = "upper left",
|
||||
outerright = "center left",
|
||||
outerleft = "right",
|
||||
outertop = "lower center",
|
||||
outerbottom = "upper center",
|
||||
outerbottomleft = "lower right",
|
||||
outerbottomright = "lower left",
|
||||
outertopright = "upper left",
|
||||
outertopleft = "upper right",
|
||||
),
|
||||
pos,
|
||||
"best",
|
||||
)
|
||||
|
||||
py_legend_pos(pos::Symbol) = get(_pyplot_legend_pos, pos, get(_pyplot_legend_pos_outer, pos, "best"))
|
||||
py_legend_pos(pos) = "lower left"
|
||||
|
||||
const _pyplot_legend_bbox_outer = KW(
|
||||
:outerright => (1.0, 0.5, 0.0, 0.0),
|
||||
:outerleft => (-0.15, 0.5, 0.0, 0.0),
|
||||
:outertop => (0.5, 1.0, 0.0, 0.0),
|
||||
:outerbottom => (0.5, -0.15, 0.0, 0.0),
|
||||
:outerbottomleft => (-0.15, 0.0, 0.0, 0.0),
|
||||
:outerbottomright => (1.0, 0.0, 0.0, 0.0),
|
||||
:outertopright => (1.0, 1.0, 0.0, 0.0),
|
||||
:outertopleft => (-0.15, 1.0, 0.0, 0.0)
|
||||
py_legend_bbox(pos::Symbol) = get(
|
||||
(
|
||||
outerright = (1.0, 0.5, 0.0, 0.0),
|
||||
outerleft = (-0.15, 0.5, 0.0, 0.0),
|
||||
outertop = (0.5, 1.0, 0.0, 0.0),
|
||||
outerbottom = (0.5, -0.15, 0.0, 0.0),
|
||||
outerbottomleft = (-0.15, 0.0, 0.0, 0.0),
|
||||
outerbottomright = (1.0, 0.0, 0.0, 0.0),
|
||||
outertopright = (1.0, 1.0, 0.0, 0.0),
|
||||
outertopleft = (-0.15, 1.0, 0.0, 0.0),
|
||||
),
|
||||
pos,
|
||||
(0.0, 0.0, 1.0, 1.0),
|
||||
)
|
||||
|
||||
py_legend_bbox(pos::Symbol) = get(_pyplot_legend_bbox_outer, pos, (0.0, 0.0, 1.0, 1.0))
|
||||
py_legend_bbox(pos) = pos
|
||||
|
||||
function py_add_legend(plt::Plot, sp::Subplot, ax)
|
||||
@@ -1311,16 +1362,17 @@ function py_add_legend(plt::Plot, sp::Subplot, ax)
|
||||
linewidth = py_thickness_scale(plt, clamp(get_linewidth(series), 0, 5)),
|
||||
linestyle = py_linestyle(series[:seriestype], get_linestyle(series))
|
||||
)
|
||||
elseif series[:seriestype] in (:path, :straightline, :scatter)
|
||||
elseif series[:seriestype] in (:path, :straightline, :scatter, :steppre, :steppost)
|
||||
hasline = get_linewidth(series) > 0
|
||||
PyPlot.plt."Line2D"((0,1),(0,0),
|
||||
color = py_color(single_color(get_linecolor(series, clims)), get_linealpha(series)),
|
||||
linewidth = py_thickness_scale(plt, clamp(get_linewidth(series), 0, 5)),
|
||||
linewidth = py_thickness_scale(plt, hasline * sp[:legendfontsize] / 8),
|
||||
linestyle = py_linestyle(:path, get_linestyle(series)),
|
||||
marker = py_marker(_cycle(series[:markershape], 1)),
|
||||
# markersize = py_thickness_scale(plt, series[:markersize]), # In case we decide that markersize needs to be scaled in the legend too
|
||||
markersize = py_thickness_scale(plt, 0.8 * sp[:legendfontsize]),
|
||||
markeredgecolor = py_color(single_color(get_markerstrokecolor(series)), get_markerstrokealpha(series)),
|
||||
markerfacecolor = py_color(single_color(get_markercolor(series, clims)), get_markeralpha(series)),
|
||||
markeredgewidth = py_thickness_scale(plt, series[:markerstrokewidth])
|
||||
markeredgewidth = py_thickness_scale(plt, 0.8 * get_markerstrokewidth(series) * sp[:legendfontsize] / first(series[:markersize])) # retain the markersize/markerstroke ratio from the markers on the plot
|
||||
)
|
||||
else
|
||||
series[:serieshandle][1]
|
||||
@@ -1341,6 +1393,7 @@ function py_add_legend(plt::Plot, sp::Subplot, ax)
|
||||
facecolor = py_color(sp[:background_color_legend]),
|
||||
edgecolor = py_color(sp[:foreground_color_legend]),
|
||||
framealpha = alpha(plot_color(sp[:background_color_legend])),
|
||||
fancybox = false # makes the legend box square
|
||||
)
|
||||
frame = leg."get_frame"()
|
||||
frame."set_linewidth"(py_thickness_scale(plt, 1))
|
||||
@@ -1371,13 +1424,10 @@ function _update_plot_object(plt::Plot{PyPlotBackend})
|
||||
pcts = bbox_to_pcts(sp.plotarea, figw, figh)
|
||||
ax."set_position"(pcts)
|
||||
|
||||
# set the cbar position if there is one
|
||||
if haskey(sp.attr, :cbar_ax)
|
||||
if haskey(sp.attr, :cbar_ax) && RecipesPipeline.is3d(sp) # 2D plots are completely handled by axis dividers
|
||||
cbw = sp.attr[:cbar_width]
|
||||
# this is the bounding box of just the colors of the colorbar (not labels)
|
||||
ex = sp[:zaxis][:extrema]
|
||||
has_toplabel = !(1e-7 < max(abs(ex.emax), abs(ex.emin)) < 1e7)
|
||||
cb_bbox = BoundingBox(right(sp.bbox)-cbw+1mm, top(sp.bbox) + (has_toplabel ? 4mm : 2mm), _cbar_width-1mm, height(sp.bbox) - (has_toplabel ? 6mm : 4mm))
|
||||
cb_bbox = BoundingBox(right(sp.bbox)-cbw - 2mm, top(sp.bbox) + 2mm, _cbar_width-1mm, height(sp.bbox) - 4mm)
|
||||
pcts = bbox_to_pcts(cb_bbox, figw, figh)
|
||||
sp.attr[:cbar_ax]."set_position"(pcts)
|
||||
end
|
||||
@@ -1391,8 +1441,7 @@ end
|
||||
_display(plt::Plot{PyPlotBackend}) = plt.o."show"()
|
||||
|
||||
|
||||
|
||||
const _pyplot_mimeformats = Dict(
|
||||
for (mime, fmt) in (
|
||||
"application/eps" => "eps",
|
||||
"image/eps" => "eps",
|
||||
"application/pdf" => "pdf",
|
||||
@@ -1401,9 +1450,6 @@ const _pyplot_mimeformats = Dict(
|
||||
"image/svg+xml" => "svg",
|
||||
"application/x-tex" => "pgf"
|
||||
)
|
||||
|
||||
|
||||
for (mime, fmt) in _pyplot_mimeformats
|
||||
@eval function _show(io::IO, ::MIME{Symbol($mime)}, plt::Plot{PyPlotBackend})
|
||||
fig = plt.o
|
||||
fig."canvas"."print_figure"(
|
||||
|
||||
@@ -3,19 +3,17 @@
|
||||
|
||||
|
||||
# don't warn on unsupported... there's just too many warnings!!
|
||||
warnOnUnsupported_args(::UnicodePlotsBackend, plotattributes::KW) = nothing
|
||||
warn_on_unsupported_args(::UnicodePlotsBackend, plotattributes::KW) = nothing
|
||||
|
||||
# --------------------------------------------------------------------------------------
|
||||
|
||||
const _canvas_type = Ref(:auto)
|
||||
|
||||
function _canvas_map()
|
||||
KW(
|
||||
:braille => UnicodePlots.BrailleCanvas,
|
||||
:ascii => UnicodePlots.AsciiCanvas,
|
||||
:block => UnicodePlots.BlockCanvas,
|
||||
:dot => UnicodePlots.DotCanvas,
|
||||
:density => UnicodePlots.DensityCanvas,
|
||||
(
|
||||
braille = UnicodePlots.BrailleCanvas,
|
||||
ascii = UnicodePlots.AsciiCanvas,
|
||||
block = UnicodePlots.BlockCanvas,
|
||||
dot = UnicodePlots.DotCanvas,
|
||||
density = UnicodePlots.DensityCanvas,
|
||||
)
|
||||
end
|
||||
|
||||
|
||||
+27
-9
@@ -358,9 +358,15 @@ end
|
||||
Scales all **current** font sizes by `factor`. For example `scalefontsizes(1.1)` increases all current font sizes by 10%. To reset to initial sizes, use `scalefontsizes()`
|
||||
"""
|
||||
function scalefontsizes(factor::Number)
|
||||
for k in (:titlefontsize, :guidefontsize, :tickfontsize, :legendfontsize)
|
||||
for k in (:titlefontsize, :legendfontsize, :legendtitlefontsize)
|
||||
scalefontsize(k, factor)
|
||||
end
|
||||
|
||||
for letter in (:x,:y,:z)
|
||||
for k in (:guidefontsize, :tickfontsize)
|
||||
scalefontsize(Symbol(letter, k), factor)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
"""
|
||||
@@ -369,15 +375,27 @@ end
|
||||
Resets font sizes to initial default values.
|
||||
"""
|
||||
function scalefontsizes()
|
||||
for k in (:titlefontsize, :guidefontsize, :tickfontsize, :legendfontsize)
|
||||
f = default(k)
|
||||
if k in keys(_initial_fontsizes)
|
||||
factor = f / _initial_fontsizes[k]
|
||||
scalefontsize(k, 1.0/factor)
|
||||
end
|
||||
end
|
||||
for k in (:titlefontsize, :legendfontsize, :legendtitlefontsize)
|
||||
f = default(k)
|
||||
if k in keys(_initial_fontsizes)
|
||||
factor = f / _initial_fontsizes[k]
|
||||
scalefontsize(k, 1.0/factor)
|
||||
end
|
||||
end
|
||||
|
||||
for letter in (:x,:y,:z)
|
||||
for k in (:guidefontsize, :tickfontsize)
|
||||
if k in keys(_initial_fontsizes)
|
||||
f = default(Symbol(letter, k))
|
||||
factor = f / _initial_fontsizes[k]
|
||||
scalefontsize(Symbol(letter, k), 1.0/factor)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
resetfontsizes() = scalefontsizes()
|
||||
|
||||
"Wrap a string with font info"
|
||||
struct PlotText
|
||||
str::AbstractString
|
||||
@@ -752,7 +770,7 @@ end
|
||||
|
||||
@deprecate curve_points coords
|
||||
|
||||
coords(curve::BezierCurve, n::Integer = 30; range = [0,1]) = map(curve, Base.range(range..., length=n))
|
||||
coords(curve::BezierCurve, n::Integer = 30; range = [0,1]) = map(curve, Base.range(first(range), stop=last(range), length=n))
|
||||
|
||||
# build a BezierCurve which leaves point p vertically upwards and arrives point q vertically upwards.
|
||||
# may create a loop if necessary. Assumes the view is [0,1]
|
||||
|
||||
+5
-6
@@ -74,7 +74,7 @@ const _examples = PlotExample[
|
||||
rand(11, 4),
|
||||
lab = "lines",
|
||||
w = 3,
|
||||
palette = :grays,
|
||||
palette = cgrad(:grays),
|
||||
fill = 0,
|
||||
α = 0.6,
|
||||
)
|
||||
@@ -322,7 +322,7 @@ const _examples = PlotExample[
|
||||
plot(
|
||||
Plots.fakedata(100, 10),
|
||||
layout = 4,
|
||||
palette = [:grays :blues :heat :lightrainbow],
|
||||
palette = cgrad.([:grays :blues :heat :lightrainbow]),
|
||||
bg_inside = [:orange :pink :darkblue :black],
|
||||
)
|
||||
end
|
||||
@@ -586,7 +586,7 @@ const _examples = PlotExample[
|
||||
rand(100, 6),
|
||||
layout = @layout([a b; c]),
|
||||
title = ["A" "B" "C"],
|
||||
title_location = :left,
|
||||
titlelocation = :left,
|
||||
left_margin = [20mm 0mm],
|
||||
bottom_margin = 10px,
|
||||
xrotation = 60,
|
||||
@@ -998,12 +998,11 @@ _backend_skips = Dict(
|
||||
6, # images
|
||||
10, # histogram2d
|
||||
16, # pgfplots thinks the upper panel is too small
|
||||
22, # contourf
|
||||
23, # pie
|
||||
25, # @df
|
||||
30, # @df
|
||||
31, # animation
|
||||
32, # spy
|
||||
38, # histogram2d
|
||||
45, # wireframe
|
||||
],
|
||||
)
|
||||
|
||||
|
||||
+1
-9
@@ -29,49 +29,41 @@ function __init__()
|
||||
@require HDF5 = "f67ccb44-e63f-5c2f-98bd-6dc0ccc4ba2f" begin
|
||||
fn = joinpath(@__DIR__, "backends", "hdf5.jl")
|
||||
include(fn)
|
||||
@require Revise = "295af30f-e4ad-537b-8983-00126c2a3abe" Revise.track(Plots, fn)
|
||||
end
|
||||
|
||||
@require InspectDR = "d0351b0e-4b05-5898-87b3-e2a8edfddd1d" begin
|
||||
fn = joinpath(@__DIR__, "backends", "inspectdr.jl")
|
||||
include(fn)
|
||||
@require Revise = "295af30f-e4ad-537b-8983-00126c2a3abe" Revise.track(Plots, fn)
|
||||
end
|
||||
|
||||
@require PGFPlots = "3b7a836e-365b-5785-a47d-02c71176b4aa" begin
|
||||
fn = joinpath(@__DIR__, "backends", "pgfplots.jl")
|
||||
fn = joinpath(@__DIR__, "backends", "deprecated", "pgfplots.jl")
|
||||
include(fn)
|
||||
@require Revise = "295af30f-e4ad-537b-8983-00126c2a3abe" Revise.track(Plots, fn)
|
||||
end
|
||||
|
||||
@require ORCA = "47be7bcc-f1a6-5447-8b36-7eeeff7534fd" begin
|
||||
fn = joinpath(@__DIR__, "backends", "orca.jl")
|
||||
include(fn)
|
||||
@require Revise = "295af30f-e4ad-537b-8983-00126c2a3abe" Revise.track(Plots, fn)
|
||||
end
|
||||
|
||||
@require PGFPlotsX = "8314cec4-20b6-5062-9cdb-752b83310925" begin
|
||||
fn = joinpath(@__DIR__, "backends", "pgfplotsx.jl")
|
||||
include(fn)
|
||||
@require Revise = "295af30f-e4ad-537b-8983-00126c2a3abe" Revise.track(Plots, fn)
|
||||
end
|
||||
|
||||
@require PlotlyJS = "f0f68f2c-4968-5e81-91da-67840de0976a" begin
|
||||
fn = joinpath(@__DIR__, "backends", "plotlyjs.jl")
|
||||
include(fn)
|
||||
@require Revise = "295af30f-e4ad-537b-8983-00126c2a3abe" Revise.track(Plots, fn)
|
||||
end
|
||||
|
||||
@require PyPlot = "d330b81b-6aea-500a-939a-2ce795aea3ee" begin
|
||||
fn = joinpath(@__DIR__, "backends", "pyplot.jl")
|
||||
include(fn)
|
||||
@require Revise = "295af30f-e4ad-537b-8983-00126c2a3abe" Revise.track(Plots, fn)
|
||||
end
|
||||
|
||||
@require UnicodePlots = "b8865327-cd53-5732-bb35-84acbb429228" begin
|
||||
fn = joinpath(@__DIR__, "backends", "unicodeplots.jl")
|
||||
include(fn)
|
||||
@require Revise = "295af30f-e4ad-537b-8983-00126c2a3abe" Revise.track(Plots, fn)
|
||||
end
|
||||
|
||||
@require IJulia = "7073ff75-c697-5162-941a-fcdaad2a7d2a" begin
|
||||
|
||||
+90
-90
@@ -1,54 +1,51 @@
|
||||
|
||||
|
||||
defaultOutputFormat(plt::Plot) = "png"
|
||||
|
||||
function png(plt::Plot, fn::AbstractString)
|
||||
fn = addExtension(fn, "png")
|
||||
io = open(fn, "w")
|
||||
show(io, MIME("image/png"), plt)
|
||||
close(io)
|
||||
fn = addExtension(fn, "png")
|
||||
io = open(fn, "w")
|
||||
show(io, MIME("image/png"), plt)
|
||||
close(io)
|
||||
end
|
||||
png(fn::AbstractString) = png(current(), fn)
|
||||
|
||||
function svg(plt::Plot, fn::AbstractString)
|
||||
fn = addExtension(fn, "svg")
|
||||
io = open(fn, "w")
|
||||
show(io, MIME("image/svg+xml"), plt)
|
||||
close(io)
|
||||
fn = addExtension(fn, "svg")
|
||||
io = open(fn, "w")
|
||||
show(io, MIME("image/svg+xml"), plt)
|
||||
close(io)
|
||||
end
|
||||
svg(fn::AbstractString) = svg(current(), fn)
|
||||
|
||||
|
||||
function pdf(plt::Plot, fn::AbstractString)
|
||||
fn = addExtension(fn, "pdf")
|
||||
io = open(fn, "w")
|
||||
show(io, MIME("application/pdf"), plt)
|
||||
close(io)
|
||||
fn = addExtension(fn, "pdf")
|
||||
io = open(fn, "w")
|
||||
show(io, MIME("application/pdf"), plt)
|
||||
close(io)
|
||||
end
|
||||
pdf(fn::AbstractString) = pdf(current(), fn)
|
||||
|
||||
|
||||
function ps(plt::Plot, fn::AbstractString)
|
||||
fn = addExtension(fn, "ps")
|
||||
io = open(fn, "w")
|
||||
show(io, MIME("application/postscript"), plt)
|
||||
close(io)
|
||||
fn = addExtension(fn, "ps")
|
||||
io = open(fn, "w")
|
||||
show(io, MIME("application/postscript"), plt)
|
||||
close(io)
|
||||
end
|
||||
ps(fn::AbstractString) = ps(current(), fn)
|
||||
|
||||
function eps(plt::Plot, fn::AbstractString)
|
||||
fn = addExtension(fn, "eps")
|
||||
io = open(fn, "w")
|
||||
show(io, MIME("image/eps"), plt)
|
||||
close(io)
|
||||
fn = addExtension(fn, "eps")
|
||||
io = open(fn, "w")
|
||||
show(io, MIME("image/eps"), plt)
|
||||
close(io)
|
||||
end
|
||||
eps(fn::AbstractString) = eps(current(), fn)
|
||||
|
||||
function tex(plt::Plot, fn::AbstractString)
|
||||
fn = addExtension(fn, "tex")
|
||||
io = open(fn, "w")
|
||||
show(io, MIME("application/x-tex"), plt)
|
||||
close(io)
|
||||
fn = addExtension(fn, "tex")
|
||||
io = open(fn, "w")
|
||||
show(io, MIME("application/x-tex"), plt)
|
||||
close(io)
|
||||
end
|
||||
tex(fn::AbstractString) = tex(current(), fn)
|
||||
|
||||
@@ -69,48 +66,39 @@ end
|
||||
html(fn::AbstractString) = html(current(), fn)
|
||||
|
||||
function txt(plt::Plot, fn::AbstractString)
|
||||
fn = addExtension(fn, "txt")
|
||||
io = open(fn, "w")
|
||||
show(io, MIME("text/plain"), plt)
|
||||
close(io)
|
||||
fn = addExtension(fn, "txt")
|
||||
io = open(fn, "w")
|
||||
show(io, MIME("text/plain"), plt)
|
||||
close(io)
|
||||
end
|
||||
txt(fn::AbstractString) = txt(current(), fn)
|
||||
|
||||
# ----------------------------------------------------------------
|
||||
|
||||
# ----------------------------------------------------------------
|
||||
|
||||
const _savemap = Dict(
|
||||
"png" => png,
|
||||
"svg" => svg,
|
||||
"pdf" => pdf,
|
||||
"ps" => ps,
|
||||
"ps" => ps,
|
||||
"eps" => eps,
|
||||
"tex" => tex,
|
||||
"json" => json,
|
||||
"html" => html,
|
||||
"tikz" => tex,
|
||||
"txt" => txt,
|
||||
)
|
||||
)
|
||||
|
||||
function getExtension(fn::AbstractString)
|
||||
pieces = split(fn, ".")
|
||||
length(pieces) > 1 || error("Can't extract file extension: ", fn)
|
||||
ext = pieces[end]
|
||||
haskey(_savemap, ext) || error("Invalid file extension: ", fn)
|
||||
ext
|
||||
end
|
||||
const _extension_map = Dict("tikz" => "tex")
|
||||
|
||||
function addExtension(fn::AbstractString, ext::AbstractString)
|
||||
try
|
||||
oldext = getExtension(fn)
|
||||
if oldext == ext
|
||||
return fn
|
||||
oldfn, oldext = splitext(fn)
|
||||
oldext = chop(oldext, head = 1, tail = 0)
|
||||
if get(_extension_map, oldext, oldext) == ext
|
||||
return fn
|
||||
else
|
||||
return "$fn.$ext"
|
||||
return string(fn, ".", ext)
|
||||
end
|
||||
catch
|
||||
return "$fn.$ext"
|
||||
end
|
||||
end
|
||||
|
||||
"""
|
||||
@@ -121,27 +109,28 @@ type is inferred from the file extension. All backends support png and pdf
|
||||
file types, some also support svg, ps, eps, html and tex.
|
||||
"""
|
||||
function savefig(plt::Plot, fn::AbstractString)
|
||||
fn = abspath(expanduser(fn))
|
||||
# get the extension
|
||||
local ext
|
||||
try
|
||||
ext = getExtension(fn)
|
||||
catch
|
||||
# if we couldn't extract the extension, add the default
|
||||
ext = defaultOutputFormat(plt)
|
||||
fn = addExtension(fn, ext)
|
||||
end
|
||||
fn = abspath(expanduser(fn))
|
||||
|
||||
# save it
|
||||
func = get(_savemap, ext) do
|
||||
error("Unsupported extension $ext with filename ", fn)
|
||||
end
|
||||
func(plt, fn)
|
||||
# get the extension
|
||||
fn, ext = splitext(fn)
|
||||
ext = chop(ext, head = 1, tail = 0)
|
||||
if isempty(ext)
|
||||
ext = defaultOutputFormat(plt)
|
||||
end
|
||||
|
||||
# save it
|
||||
if haskey(_savemap, ext)
|
||||
func = _savemap[ext]
|
||||
return func(plt, fn)
|
||||
else
|
||||
error("Invalid file extension: ", fn)
|
||||
end
|
||||
end
|
||||
savefig(fn::AbstractString) = savefig(current(), fn)
|
||||
|
||||
|
||||
# ---------------------------------------------------------
|
||||
|
||||
"""
|
||||
gui([plot])
|
||||
|
||||
@@ -164,17 +153,13 @@ end
|
||||
_do_plot_show(plt, showval::Bool) = showval && gui(plt)
|
||||
function _do_plot_show(plt, showval::Symbol)
|
||||
showval == :gui && gui(plt)
|
||||
showval in (:inline,:ijulia) && inline(plt)
|
||||
showval in (:inline, :ijulia) && inline(plt)
|
||||
end
|
||||
|
||||
# ---------------------------------------------------------
|
||||
|
||||
const _best_html_output_type = KW(
|
||||
:pyplot => :png,
|
||||
:unicodeplots => :txt,
|
||||
:plotlyjs => :html,
|
||||
:plotly => :html
|
||||
)
|
||||
const _best_html_output_type =
|
||||
KW(:pyplot => :png, :unicodeplots => :txt, :plotlyjs => :html, :plotly => :html)
|
||||
|
||||
# a backup for html... passes to svg or png depending on the html_output_format arg
|
||||
function _show(io::IO, ::MIME"text/html", plt::Plot)
|
||||
@@ -184,7 +169,12 @@ function _show(io::IO, ::MIME"text/html", plt::Plot)
|
||||
end
|
||||
if output_type == :png
|
||||
# @info("writing png to html output")
|
||||
print(io, "<img src=\"data:image/png;base64,", base64encode(show, MIME("image/png"), plt), "\" />")
|
||||
print(
|
||||
io,
|
||||
"<img src=\"data:image/png;base64,",
|
||||
base64encode(show, MIME("image/png"), plt),
|
||||
"\" />",
|
||||
)
|
||||
elseif output_type == :svg
|
||||
# @info("writing svg to html output")
|
||||
show(io, MIME("image/svg+xml"), plt)
|
||||
@@ -196,7 +186,7 @@ function _show(io::IO, ::MIME"text/html", plt::Plot)
|
||||
end
|
||||
|
||||
# delegate showable to _show instead
|
||||
function Base.showable(m::M, plt::P) where {M<:MIME, P<:Plot}
|
||||
function Base.showable(m::M, plt::P) where {M <: MIME, P <: Plot}
|
||||
return hasmethod(_show, Tuple{IO, M, P})
|
||||
end
|
||||
|
||||
@@ -205,21 +195,31 @@ function _display(plt::Plot)
|
||||
end
|
||||
|
||||
# for writing to io streams... first prepare, then callback
|
||||
for mime in ("text/plain", "text/html", "image/png", "image/eps", "image/svg+xml",
|
||||
"application/eps", "application/pdf", "application/postscript",
|
||||
"application/x-tex", "application/vnd.plotly.v1+json")
|
||||
for mime in (
|
||||
"text/plain",
|
||||
"text/html",
|
||||
"image/png",
|
||||
"image/eps",
|
||||
"image/svg+xml",
|
||||
"application/eps",
|
||||
"application/pdf",
|
||||
"application/postscript",
|
||||
"application/x-tex",
|
||||
"application/vnd.plotly.v1+json",
|
||||
)
|
||||
@eval function Base.show(io::IO, m::MIME{Symbol($mime)}, plt::Plot)
|
||||
if haskey(io, :juno_plotsize)
|
||||
showjuno(io, m, plt)
|
||||
showjuno(io, m, plt)
|
||||
else
|
||||
prepare_output(plt)
|
||||
_show(io, m, plt)
|
||||
prepare_output(plt)
|
||||
_show(io, m, plt)
|
||||
end
|
||||
return nothing
|
||||
end
|
||||
end
|
||||
|
||||
Base.show(io::IO, m::MIME"application/prs.juno.plotpane+html", plt::Plot) = showjuno(io, MIME("text/html"), plt)
|
||||
Base.show(io::IO, m::MIME"application/prs.juno.plotpane+html", plt::Plot) =
|
||||
showjuno(io, MIME("text/html"), plt)
|
||||
|
||||
# default text/plain for all backends
|
||||
_show(io::IO, ::MIME{Symbol("text/plain")}, plt::Plot) = show(io, plt)
|
||||
@@ -258,25 +258,25 @@ function showjuno(io::IO, m, plt)
|
||||
|
||||
scale = minimum(jsize[i] / sz[i] for i in 1:2)
|
||||
plt[:size] = [s * scale for s in sz]
|
||||
plt[:dpi] = jratio*Plots.DPI
|
||||
plt[:dpi] = jratio * Plots.DPI
|
||||
plt[:thickness_scaling] *= scale
|
||||
|
||||
prepare_output(plt)
|
||||
try
|
||||
_showjuno(io, m, plt)
|
||||
_showjuno(io, m, plt)
|
||||
finally
|
||||
plt[:size] = sz
|
||||
plt[:dpi] = dpi
|
||||
plt[:thickness_scaling] = thickness_scaling
|
||||
plt[:size] = sz
|
||||
plt[:dpi] = dpi
|
||||
plt[:thickness_scaling] = thickness_scaling
|
||||
end
|
||||
end
|
||||
|
||||
function _showjuno(io::IO, m::MIME"image/svg+xml", plt)
|
||||
if Symbol(plt.attr[:html_output_format]) ≠ :svg
|
||||
throw(MethodError(show, (typeof(m), typeof(plt))))
|
||||
else
|
||||
_show(io, m, plt)
|
||||
end
|
||||
if Symbol(plt.attr[:html_output_format]) ≠ :svg
|
||||
throw(MethodError(show, (typeof(m), typeof(plt))))
|
||||
else
|
||||
_show(io, m, plt)
|
||||
end
|
||||
end
|
||||
|
||||
Base.showable(::MIME"application/prs.juno.plotpane+html", plt::Plot) = false
|
||||
|
||||
+31
-2
@@ -155,8 +155,23 @@ RecipesPipeline.type_alias(plt::Plot) = get(_typeAliases, st, st)
|
||||
function RecipesPipeline.plot_setup!(plt::Plot, plotattributes, kw_list)
|
||||
_plot_setup(plt, plotattributes, kw_list)
|
||||
_subplot_setup(plt, plotattributes, kw_list)
|
||||
return nothing
|
||||
end
|
||||
|
||||
function RecipesPipeline.process_sliced_series_attributes!(plt::Plots.Plot, kw_list)
|
||||
# swap errors
|
||||
err_inds = findall(kw -> get(kw, :seriestype, :path) in (:xerror, :yerror, :zerror), kw_list)
|
||||
for ind in err_inds
|
||||
if get(kw_list[ind-1],:seriestype,:path) == :scatter
|
||||
tmp = copy(kw_list[ind])
|
||||
kw_list[ind] = copy(kw_list[ind-1])
|
||||
kw_list[ind-1] = tmp
|
||||
end
|
||||
end
|
||||
return nothing
|
||||
end
|
||||
|
||||
|
||||
# TODO: Should some of this logic be moved to RecipesPipeline?
|
||||
function _plot_setup(plt::Plot, plotattributes::AKW, kw_list::Vector{KW})
|
||||
# merge in anything meant for the Plot
|
||||
@@ -274,6 +289,7 @@ function RecipesPipeline.slice_series_attributes!(plt::Plot, kw_list, kw)
|
||||
# in series attributes given as vector with one element per series,
|
||||
# select the value for current series
|
||||
_slice_series_args!(kw, plt, sp, series_idx(kw_list, kw))
|
||||
return nothing
|
||||
end
|
||||
|
||||
RecipesPipeline.series_defaults(plt::Plot) = _series_defaults # in args.jl
|
||||
@@ -330,7 +346,7 @@ function _expand_subplot_extrema(sp::Subplot, plotattributes::AKW, st::Symbol)
|
||||
ymin, ymax = ignorenan_extrema(plotattributes[:y])
|
||||
expand_extrema!(sp[:xaxis], (xmin, xmax))
|
||||
expand_extrema!(sp[:yaxis], (ymin, ymax))
|
||||
elseif !(st in (:pie, :histogram, :bins2d, :histogram2d))
|
||||
elseif !(st in (:histogram, :bins2d, :histogram2d))
|
||||
expand_extrema!(sp, plotattributes)
|
||||
end
|
||||
# expand for zerolines (axes through origin)
|
||||
@@ -341,7 +357,20 @@ function _expand_subplot_extrema(sp::Subplot, plotattributes::AKW, st::Symbol)
|
||||
end
|
||||
|
||||
function _add_the_series(plt, sp, plotattributes)
|
||||
warn_on_unsupported_args(plt.backend, plotattributes)
|
||||
extra_kwargs = warn_on_unsupported_args(plt.backend, plotattributes)
|
||||
if (kw = plt[:extra_kwargs]) isa AbstractDict
|
||||
plt[:extra_plot_kwargs] = get(kw,:plot,KW())
|
||||
sp[:extra_kwargs] = get(kw,:subplot, KW())
|
||||
plotattributes[:extra_kwargs] = get(kw,:series,KW())
|
||||
elseif plt[:extra_kwargs] == :plot
|
||||
plt[:extra_plot_kwargs] = extra_kwargs
|
||||
elseif plt[:extra_kwargs] == :subplot
|
||||
sp[:extra_kwargs] = extra_kwargs
|
||||
elseif plt[:extra_kwargs] == :series
|
||||
plotattributes[:extra_kwargs] = extra_kwargs
|
||||
else
|
||||
ArgumentError("Unsupported type for extra keyword arguments")
|
||||
end
|
||||
warn_on_unsupported(plt.backend, plotattributes)
|
||||
series = Series(plotattributes)
|
||||
push!(plt.series_list, series)
|
||||
|
||||
+42
-42
@@ -9,7 +9,6 @@ function _precompile_()
|
||||
isdefined(Plots, Symbol("#attr!##kw")) && precompile(Tuple{getfield(Plots, Symbol("#attr!##kw")), NamedTuple{(:formatter,), Tuple{typeof(RecipesPipeline.datetimeformatter)}}, typeof(Plots.attr!), Plots.Axis})
|
||||
isdefined(Plots, Symbol("#attr!##kw")) && precompile(Tuple{getfield(Plots, Symbol("#attr!##kw")), NamedTuple{(:grid, :lims), Tuple{Bool, Tuple{Int64, Int64}}}, typeof(Plots.attr!), Plots.Axis})
|
||||
isdefined(Plots, Symbol("#attr!##kw")) && precompile(Tuple{getfield(Plots, Symbol("#attr!##kw")), NamedTuple{(:grid, :lims, :flip), Tuple{Bool, Tuple{Int64, Int64}, Bool}}, typeof(Plots.attr!), Plots.Axis})
|
||||
isdefined(Plots, Symbol("#attr!##kw")) && precompile(Tuple{getfield(Plots, Symbol("#attr!##kw")), NamedTuple{(:grid, :ticks), Tuple{Bool, Nothing}}, typeof(Plots.attr!), Plots.Axis})
|
||||
isdefined(Plots, Symbol("#attr!##kw")) && precompile(Tuple{getfield(Plots, Symbol("#attr!##kw")), NamedTuple{(:grid,), Tuple{Bool}}, typeof(Plots.attr!), Plots.Axis})
|
||||
isdefined(Plots, Symbol("#attr!##kw")) && precompile(Tuple{getfield(Plots, Symbol("#attr!##kw")), NamedTuple{(:gridlinewidth, :grid, :gridalpha, :gridstyle, :foreground_color_grid), Tuple{Int64, Bool, Float64, Symbol, ColorTypes.RGBA{Float64}}}, typeof(Plots.attr!), Plots.Axis})
|
||||
isdefined(Plots, Symbol("#attr!##kw")) && precompile(Tuple{getfield(Plots, Symbol("#attr!##kw")), NamedTuple{(:guide,), Tuple{String}}, typeof(Plots.attr!), Plots.Axis})
|
||||
@@ -30,6 +29,7 @@ function _precompile_()
|
||||
isdefined(Plots, Symbol("#gr_polyline##kw")) && precompile(Tuple{getfield(Plots, Symbol("#gr_polyline##kw")), NamedTuple{(:arrowside, :arrowstyle), Tuple{Symbol, Symbol}}, typeof(Plots.gr_polyline), Base.UnitRange{Int64}, Array{Float64, 1}})
|
||||
isdefined(Plots, Symbol("#gr_polyline##kw")) && precompile(Tuple{getfield(Plots, Symbol("#gr_polyline##kw")), NamedTuple{(:arrowside, :arrowstyle), Tuple{Symbol, Symbol}}, typeof(Plots.gr_polyline), Base.UnitRange{Int64}, Base.UnitRange{Int64}})
|
||||
isdefined(Plots, Symbol("#gr_set_font##kw")) && precompile(Tuple{getfield(Plots, Symbol("#gr_set_font##kw")), NamedTuple{(:halign, :valign, :rotation), Tuple{Symbol, Symbol, Int64}}, typeof(Plots.gr_set_font), Plots.Font})
|
||||
isdefined(Plots, Symbol("#gr_set_font##kw")) && precompile(Tuple{getfield(Plots, Symbol("#gr_set_font##kw")), NamedTuple{(:halign, :valign, :rotation, :color), Tuple{Symbol, Symbol, Int64, ColorTypes.RGBA{Float64}}}, typeof(Plots.gr_set_font), Plots.Font})
|
||||
isdefined(Plots, Symbol("#heatmap##kw")) && precompile(Tuple{getfield(Plots, Symbol("#heatmap##kw")), NamedTuple{(:aspect_ratio,), Tuple{Int64}}, typeof(Plots.heatmap), Array{String, 1}, Int})
|
||||
isdefined(Plots, Symbol("#histogram##kw")) && precompile(Tuple{getfield(Plots, Symbol("#histogram##kw")), NamedTuple{(:bins, :weights), Tuple{Symbol, Array{Int64, 1}}}, typeof(Plots.histogram), Array{Float64, 1}})
|
||||
isdefined(Plots, Symbol("#histogram2d##kw")) && precompile(Tuple{getfield(Plots, Symbol("#histogram2d##kw")), NamedTuple{(:nbins, :show_empty_bins, :normed, :aspect_ratio), Tuple{Tuple{Int64, Int64}, Bool, Bool, Int64}}, typeof(Plots.histogram2d), Array{Base.Complex{Float64}, 1}})
|
||||
@@ -37,7 +37,10 @@ function _precompile_()
|
||||
isdefined(Plots, Symbol("#hline!##kw")) && precompile(Tuple{getfield(Plots, Symbol("#hline!##kw")), NamedTuple{(:line,), Tuple{Tuple{Int64, Symbol, Float64, Array{Symbol, 2}}}}, typeof(Plots.hline!), Array{Float64, 2}})
|
||||
isdefined(Plots, Symbol("#lens!##kw")) && precompile(Tuple{getfield(Plots, Symbol("#lens!##kw")), NamedTuple{(:inset,), Tuple{Tuple{Int64, Measures.BoundingBox{Tuple{Measures.Length{:w, Float64}, Measures.Length{:h, Float64}}, Tuple{Measures.Length{:w, Float64}, Measures.Length{:h, Float64}}}}}}, typeof(Plots.lens!), Array{Int64, 1}, Int})
|
||||
isdefined(Plots, Symbol("#pie##kw")) && precompile(Tuple{getfield(Plots, Symbol("#pie##kw")), NamedTuple{(:title, :l), Tuple{String, Float64}}, typeof(Plots.pie), Array{String, 1}, Int})
|
||||
isdefined(Plots, Symbol("#plotly_annotation_dict##kw")) && precompile(Tuple{getfield(Plots, Symbol("#plotly_annotation_dict##kw")), NamedTuple{(:xref, :yref), Tuple{String, String}}, typeof(Plots.plotly_annotation_dict), Float64, Float64, Plots.PlotText})
|
||||
isdefined(Plots, Symbol("#plotly_annotation_dict##kw")) && precompile(Tuple{getfield(Plots, Symbol("#plotly_annotation_dict##kw")), NamedTuple{(:xref, :yref), Tuple{String, String}}, typeof(Plots.plotly_annotation_dict), Float64, Float64, String})
|
||||
isdefined(Plots, Symbol("#plotly_annotation_dict##kw")) && precompile(Tuple{getfield(Plots, Symbol("#plotly_annotation_dict##kw")), NamedTuple{(:xref, :yref), Tuple{String, String}}, typeof(Plots.plotly_annotation_dict), Int64, Float64, Plots.PlotText})
|
||||
isdefined(Plots, Symbol("#plotly_annotation_dict##kw")) && precompile(Tuple{getfield(Plots, Symbol("#plotly_annotation_dict##kw")), NamedTuple{(:xref, :yref), Tuple{String, String}}, typeof(Plots.plotly_annotation_dict), Int64, Float64, String})
|
||||
isdefined(Plots, Symbol("#portfoliocomposition##kw")) && precompile(Tuple{getfield(Plots, Symbol("#portfoliocomposition##kw")), NamedTuple{(:labels,), Tuple{Array{String, 2}}}, typeof(Plots.portfoliocomposition), Array{Float64, 2}, Int})
|
||||
isdefined(Plots, Symbol("#scatter!##kw")) && precompile(Tuple{getfield(Plots, Symbol("#scatter!##kw")), NamedTuple{(:marker, :series_annotations), Tuple{Tuple{Int64, Float64, Symbol}, Array{Any, 1}}}, typeof(Plots.scatter!), Base.StepRangeLen{Float64, Base.TwicePrecision{Float64}, Base.TwicePrecision{Float64}}, Int})
|
||||
isdefined(Plots, Symbol("#scatter!##kw")) && precompile(Tuple{getfield(Plots, Symbol("#scatter!##kw")), NamedTuple{(:markersize, :c), Tuple{Int64, Symbol}}, typeof(Plots.scatter!), Array{Float64, 1}})
|
||||
@@ -53,13 +56,14 @@ function _precompile_()
|
||||
precompile(Tuple{typeof(Plots._add_smooth_kw), Array{Base.Dict{Symbol, Any}, 1}, Base.Dict{Symbol, Any}})
|
||||
precompile(Tuple{typeof(Plots._add_the_series), Plots.Plot{Plots.GRBackend}, Plots.Subplot{Plots.GRBackend}, RecipesPipeline.DefaultsDict})
|
||||
precompile(Tuple{typeof(Plots._add_the_series), Plots.Plot{Plots.PlotlyBackend}, Plots.Subplot{Plots.PlotlyBackend}, RecipesPipeline.DefaultsDict})
|
||||
precompile(Tuple{typeof(Plots._as_gradient), PlotUtils.ContinuousColorGradient})
|
||||
precompile(Tuple{typeof(Plots._backend_instance), Symbol})
|
||||
precompile(Tuple{typeof(Plots._bin_centers), Array{Float64, 1}})
|
||||
precompile(Tuple{typeof(Plots._binbarlike_baseline), Float64, Symbol})
|
||||
precompile(Tuple{typeof(Plots._cbar_unique), Array{Base.StepRangeLen{Float64, Base.TwicePrecision{Float64}, Base.TwicePrecision{Float64}}, 1}, String})
|
||||
precompile(Tuple{typeof(Plots._cbar_unique), Array{Int64, 1}, String})
|
||||
precompile(Tuple{typeof(Plots._cbar_unique), Array{Nothing, 1}, String})
|
||||
precompile(Tuple{typeof(Plots._cbar_unique), Array{PlotUtils.ColorGradient, 1}, String})
|
||||
precompile(Tuple{typeof(Plots._cbar_unique), Array{PlotUtils.ContinuousColorGradient, 1}, String})
|
||||
precompile(Tuple{typeof(Plots._cbar_unique), Array{Symbol, 1}, String})
|
||||
precompile(Tuple{typeof(Plots._create_backend_figure), Plots.Plot{Plots.GRBackend}})
|
||||
precompile(Tuple{typeof(Plots._create_backend_figure), Plots.Plot{Plots.PlotlyBackend}})
|
||||
@@ -73,7 +77,6 @@ function _precompile_()
|
||||
precompile(Tuple{typeof(Plots._cycle), Base.OneTo{Int64}, Array{Int64, 1}})
|
||||
precompile(Tuple{typeof(Plots._cycle), Base.StepRangeLen{Float64, Base.TwicePrecision{Float64}, Base.TwicePrecision{Float64}}, Int64})
|
||||
precompile(Tuple{typeof(Plots._cycle), Base.StepRange{Int64, Int64}, Array{Int64, 1}})
|
||||
precompile(Tuple{typeof(Plots._cycle), Base.StepRange{Int64, Int64}, Int64})
|
||||
precompile(Tuple{typeof(Plots._cycle), ColorTypes.RGBA{Float64}, Int64})
|
||||
precompile(Tuple{typeof(Plots._cycle), Float64, Int64})
|
||||
precompile(Tuple{typeof(Plots._cycle), Int64, Base.StepRange{Int64, Int64}})
|
||||
@@ -81,6 +84,8 @@ function _precompile_()
|
||||
precompile(Tuple{typeof(Plots._cycle), Nothing, Array{Int64, 1}})
|
||||
precompile(Tuple{typeof(Plots._cycle), Nothing, Base.UnitRange{Int64}})
|
||||
precompile(Tuple{typeof(Plots._cycle), Nothing, Int64})
|
||||
precompile(Tuple{typeof(Plots._cycle), PlotUtils.ColorPalette, Int64})
|
||||
precompile(Tuple{typeof(Plots._cycle), PlotUtils.ContinuousColorGradient, Int64})
|
||||
precompile(Tuple{typeof(Plots._cycle), Plots.Shape, Int64})
|
||||
precompile(Tuple{typeof(Plots._cycle), Plots.Subplot{Plots.GRBackend}, Int64})
|
||||
precompile(Tuple{typeof(Plots._cycle), Plots.Subplot{Plots.PlotlyBackend}, Int64})
|
||||
@@ -217,7 +222,6 @@ function _precompile_()
|
||||
precompile(Tuple{typeof(Plots.arrow), Int64})
|
||||
precompile(Tuple{typeof(Plots.attr), Plots.EmptyLayout, Symbol, Symbol})
|
||||
precompile(Tuple{typeof(Plots.attr), Plots.EmptyLayout, Symbol})
|
||||
precompile(Tuple{typeof(Plots.autopick), Array{ColorTypes.RGBA{Float64}, 1}, Int64})
|
||||
precompile(Tuple{typeof(Plots.autopick_ignore_none_auto), Array{Symbol, 1}, Int64})
|
||||
precompile(Tuple{typeof(Plots.axis_drawing_info), Plots.Subplot{Plots.GRBackend}})
|
||||
precompile(Tuple{typeof(Plots.axis_drawing_info_3d), Plots.Subplot{Plots.GRBackend}})
|
||||
@@ -307,11 +311,13 @@ function _precompile_()
|
||||
precompile(Tuple{typeof(Plots.get_clims), Plots.Subplot{Plots.GRBackend}})
|
||||
precompile(Tuple{typeof(Plots.get_clims), Plots.Subplot{Plots.PlotlyBackend}, Plots.Series})
|
||||
precompile(Tuple{typeof(Plots.get_clims), Plots.Subplot{Plots.PlotlyBackend}})
|
||||
precompile(Tuple{typeof(Plots.get_colorgradient), Plots.Series})
|
||||
precompile(Tuple{typeof(Plots.get_fillalpha), Plots.Series, Int64})
|
||||
precompile(Tuple{typeof(Plots.get_fillalpha), Plots.Series})
|
||||
precompile(Tuple{typeof(Plots.get_fillcolor), Plots.Series, Float64, Float64, Int64})
|
||||
precompile(Tuple{typeof(Plots.get_fillcolor), Plots.Series, Tuple{Float64, Float64}, Int64})
|
||||
precompile(Tuple{typeof(Plots.get_fillcolor), Plots.Series, Tuple{Float64, Float64}})
|
||||
precompile(Tuple{typeof(Plots.get_gradient), PlotUtils.ContinuousColorGradient})
|
||||
precompile(Tuple{typeof(Plots.get_linealpha), Plots.Series, Int64})
|
||||
precompile(Tuple{typeof(Plots.get_linealpha), Plots.Series})
|
||||
precompile(Tuple{typeof(Plots.get_linecolor), Plots.Series, Float64, Float64, Int64})
|
||||
@@ -325,16 +331,16 @@ function _precompile_()
|
||||
precompile(Tuple{typeof(Plots.get_markercolor), Plots.Series, Float64, Float64, Int64})
|
||||
precompile(Tuple{typeof(Plots.get_markerstrokealpha), Plots.Series, Int64})
|
||||
precompile(Tuple{typeof(Plots.get_markerstrokecolor), Plots.Series, Int64})
|
||||
precompile(Tuple{typeof(Plots.get_markerstrokewidth), Plots.Series, Int64})
|
||||
precompile(Tuple{typeof(Plots.get_minor_ticks), Plots.Subplot{Plots.GRBackend}, Plots.Axis, Tuple{Array{Float64, 1}, Array{Any, 1}}})
|
||||
precompile(Tuple{typeof(Plots.get_minor_ticks), Plots.Subplot{Plots.GRBackend}, Plots.Axis, Tuple{Array{Float64, 1}, Array{String, 1}}})
|
||||
precompile(Tuple{typeof(Plots.get_minor_ticks), Plots.Subplot{Plots.GRBackend}, Plots.Axis, Tuple{Array{Int64, 1}, Array{String, 1}}})
|
||||
precompile(Tuple{typeof(Plots.get_plotly_marker), Symbol, String})
|
||||
precompile(Tuple{typeof(Plots.get_series_color), ColorTypes.RGBA{Float64}, Plots.Subplot{Plots.GRBackend}, Int64, Symbol})
|
||||
precompile(Tuple{typeof(Plots.get_series_color), ColorTypes.RGBA{Float64}, Plots.Subplot{Plots.PlotlyBackend}, Int64, Symbol})
|
||||
precompile(Tuple{typeof(Plots.get_series_color), Int64, Plots.Subplot{Plots.GRBackend}, Int64, Symbol})
|
||||
precompile(Tuple{typeof(Plots.get_series_color), Int64, Plots.Subplot{Plots.PlotlyBackend}, Int64, Symbol})
|
||||
precompile(Tuple{typeof(Plots.get_series_color), PlotUtils.ColorGradient, Plots.Subplot{Plots.GRBackend}, Int64, Symbol})
|
||||
precompile(Tuple{typeof(Plots.get_series_color), PlotUtils.ColorGradient, Plots.Subplot{Plots.PlotlyBackend}, Int64, Symbol})
|
||||
precompile(Tuple{typeof(Plots.get_series_color), PlotUtils.ContinuousColorGradient, Plots.Subplot{Plots.GRBackend}, Int64, Symbol})
|
||||
precompile(Tuple{typeof(Plots.get_series_color), PlotUtils.ContinuousColorGradient, Plots.Subplot{Plots.PlotlyBackend}, Int64, Symbol})
|
||||
precompile(Tuple{typeof(Plots.get_series_color), Symbol, Plots.Subplot{Plots.GRBackend}, Int64, Symbol})
|
||||
precompile(Tuple{typeof(Plots.get_series_color), Symbol, Plots.Subplot{Plots.PlotlyBackend}, Int64, Symbol})
|
||||
precompile(Tuple{typeof(Plots.get_subplot), Plots.Plot{Plots.GRBackend}, Plots.Subplot{Plots.GRBackend}})
|
||||
@@ -351,33 +357,32 @@ function _precompile_()
|
||||
precompile(Tuple{typeof(Plots.gr_display), Plots.Plot{Plots.GRBackend}, String})
|
||||
precompile(Tuple{typeof(Plots.gr_display), Plots.Subplot{Plots.GRBackend}, Measures.Length{:mm, Float64}, Measures.Length{:mm, Float64}, Array{Float64, 1}})
|
||||
precompile(Tuple{typeof(Plots.gr_draw_colorbar), Plots.GRColorbar, Plots.Subplot{Plots.GRBackend}, Tuple{Float64, Float64}})
|
||||
precompile(Tuple{typeof(Plots.gr_draw_marker), Plots.Series, Float64, Float64, Tuple{Float64, Float64}, Int64, Int64, Plots.Shape})
|
||||
precompile(Tuple{typeof(Plots.gr_draw_marker), Plots.Series, Float64, Float64, Tuple{Float64, Float64}, Int64, Int64, Symbol})
|
||||
precompile(Tuple{typeof(Plots.gr_draw_marker), Plots.Series, Int64, Float64, Tuple{Float64, Float64}, Int64, Float64, Plots.Shape})
|
||||
precompile(Tuple{typeof(Plots.gr_draw_marker), Plots.Series, Int64, Float64, Tuple{Float64, Float64}, Int64, Float64, Symbol})
|
||||
precompile(Tuple{typeof(Plots.gr_draw_marker), Plots.Series, Int64, Float64, Tuple{Float64, Float64}, Int64, Int64, Plots.Shape})
|
||||
precompile(Tuple{typeof(Plots.gr_draw_marker), Plots.Series, Int64, Float64, Tuple{Float64, Float64}, Int64, Int64, Symbol})
|
||||
precompile(Tuple{typeof(Plots.gr_draw_marker), Plots.Series, Int64, Int64, Tuple{Float64, Float64}, Int64, Int64, Plots.Shape})
|
||||
precompile(Tuple{typeof(Plots.gr_draw_marker), Plots.Series, Int64, Int64, Tuple{Float64, Float64}, Int64, Int64, Symbol})
|
||||
precompile(Tuple{typeof(Plots.gr_draw_markers), Plots.Series, Array{Float64, 1}, Array{Float64, 1}, Tuple{Float64, Float64}, Int64})
|
||||
precompile(Tuple{typeof(Plots.gr_draw_marker), Plots.Series, Float64, Float64, Tuple{Float64, Float64}, Int64, Float64, Float64, Plots.Shape})
|
||||
precompile(Tuple{typeof(Plots.gr_draw_marker), Plots.Series, Float64, Float64, Tuple{Float64, Float64}, Int64, Float64, Float64, Symbol})
|
||||
precompile(Tuple{typeof(Plots.gr_draw_marker), Plots.Series, Int64, Float64, Tuple{Float64, Float64}, Int64, Float64, Float64, Plots.Shape})
|
||||
precompile(Tuple{typeof(Plots.gr_draw_marker), Plots.Series, Int64, Float64, Tuple{Float64, Float64}, Int64, Float64, Float64, Symbol})
|
||||
precompile(Tuple{typeof(Plots.gr_draw_marker), Plots.Series, Int64, Int64, Tuple{Float64, Float64}, Int64, Float64, Float64, Plots.Shape})
|
||||
precompile(Tuple{typeof(Plots.gr_draw_marker), Plots.Series, Int64, Int64, Tuple{Float64, Float64}, Int64, Float64, Float64, Symbol})
|
||||
precompile(Tuple{typeof(Plots.gr_draw_markers), Plots.Series, Array{Float64, 1}, Array{Float64, 1}, Tuple{Float64, Float64}, Int64, Int64})
|
||||
precompile(Tuple{typeof(Plots.gr_draw_markers), Plots.Series, Array{Float64, 1}, Array{Float64, 1}, Tuple{Float64, Float64}})
|
||||
precompile(Tuple{typeof(Plots.gr_draw_markers), Plots.Series, Array{Int64, 1}, Array{Float64, 1}, Tuple{Float64, Float64}, Int64})
|
||||
precompile(Tuple{typeof(Plots.gr_draw_markers), Plots.Series, Array{Int64, 1}, Array{Float64, 1}, Tuple{Float64, Float64}, Int64, Int64})
|
||||
precompile(Tuple{typeof(Plots.gr_draw_markers), Plots.Series, Array{Int64, 1}, Array{Float64, 1}, Tuple{Float64, Float64}})
|
||||
precompile(Tuple{typeof(Plots.gr_draw_markers), Plots.Series, Array{Int64, 1}, Array{Int64, 1}, Tuple{Float64, Float64}, Int64})
|
||||
precompile(Tuple{typeof(Plots.gr_draw_markers), Plots.Series, Array{Int64, 1}, Array{Int64, 1}, Tuple{Float64, Float64}, Int64, Int64})
|
||||
precompile(Tuple{typeof(Plots.gr_draw_markers), Plots.Series, Array{Int64, 1}, Array{Int64, 1}, Tuple{Float64, Float64}})
|
||||
precompile(Tuple{typeof(Plots.gr_draw_markers), Plots.Series, Base.OneTo{Int64}, Array{Float64, 1}, Tuple{Float64, Float64}, Array{Float64, 1}})
|
||||
precompile(Tuple{typeof(Plots.gr_draw_markers), Plots.Series, Base.OneTo{Int64}, Array{Float64, 1}, Tuple{Float64, Float64}, Int64})
|
||||
precompile(Tuple{typeof(Plots.gr_draw_markers), Plots.Series, Base.OneTo{Int64}, Array{Float64, 1}, Tuple{Float64, Float64}, Array{Float64, 1}, Int64})
|
||||
precompile(Tuple{typeof(Plots.gr_draw_markers), Plots.Series, Base.OneTo{Int64}, Array{Float64, 1}, Tuple{Float64, Float64}, Int64, Int64})
|
||||
precompile(Tuple{typeof(Plots.gr_draw_markers), Plots.Series, Base.OneTo{Int64}, Array{Float64, 1}, Tuple{Float64, Float64}})
|
||||
precompile(Tuple{typeof(Plots.gr_draw_markers), Plots.Series, Base.StepRangeLen{Float64, Base.TwicePrecision{Float64}, Base.TwicePrecision{Float64}}, Array{Float64, 1}, Tuple{Float64, Float64}, Int64})
|
||||
precompile(Tuple{typeof(Plots.gr_draw_markers), Plots.Series, Base.StepRangeLen{Float64, Base.TwicePrecision{Float64}, Base.TwicePrecision{Float64}}, Array{Float64, 1}, Tuple{Float64, Float64}, Int64, Int64})
|
||||
precompile(Tuple{typeof(Plots.gr_draw_markers), Plots.Series, Base.StepRangeLen{Float64, Base.TwicePrecision{Float64}, Base.TwicePrecision{Float64}}, Array{Float64, 1}, Tuple{Float64, Float64}})
|
||||
precompile(Tuple{typeof(Plots.gr_draw_markers), Plots.Series, Float64, Float64, Tuple{Float64, Float64}, Int64})
|
||||
precompile(Tuple{typeof(Plots.gr_draw_markers), Plots.Series, Float64, Float64, Tuple{Float64, Float64}, Float64, Float64})
|
||||
precompile(Tuple{typeof(Plots.gr_fill_viewport), Array{Float64, 1}, ColorTypes.RGBA{Float64}})
|
||||
precompile(Tuple{typeof(Plots.gr_get_color), Plots.Series})
|
||||
precompile(Tuple{typeof(Plots.gr_get_ticks_size), Tuple{Array{Float64, 1}, Array{Any, 1}}, Int64})
|
||||
precompile(Tuple{typeof(Plots.gr_get_ticks_size), Tuple{Array{Float64, 1}, Array{String, 1}}, Int64})
|
||||
precompile(Tuple{typeof(Plots.gr_get_ticks_size), Tuple{Array{Int64, 1}, Array{String, 1}}, Int64})
|
||||
precompile(Tuple{typeof(Plots.gr_getcolorind), ColorTypes.RGBA{Float64}})
|
||||
precompile(Tuple{typeof(Plots.gr_inqtext), Int64, Int64, String})
|
||||
precompile(Tuple{typeof(Plots.gr_legend_pos), Plots.Subplot{Plots.GRBackend}, Float64, Float64})
|
||||
precompile(Tuple{typeof(Plots.gr_linetype), Symbol})
|
||||
precompile(Tuple{typeof(Plots.gr_polaraxes), Int64, Float64, Plots.Subplot{Plots.GRBackend}})
|
||||
precompile(Tuple{typeof(Plots.gr_polyline), Array{Float64, 1}, Array{Float64, 1}, typeof(identity)})
|
||||
precompile(Tuple{typeof(Plots.gr_polyline), Array{Float64, 1}, Array{Float64, 1}})
|
||||
@@ -385,19 +390,18 @@ function _precompile_()
|
||||
precompile(Tuple{typeof(Plots.gr_set_fill), ColorTypes.RGBA{Float64}})
|
||||
precompile(Tuple{typeof(Plots.gr_set_fillcolor), ColorTypes.RGBA{Float64}})
|
||||
precompile(Tuple{typeof(Plots.gr_set_font), Plots.Font})
|
||||
precompile(Tuple{typeof(Plots.gr_set_gradient), PlotUtils.ColorGradient})
|
||||
precompile(Tuple{typeof(Plots.gr_set_gradient), PlotUtils.ContinuousColorGradient})
|
||||
precompile(Tuple{typeof(Plots.gr_set_gradient), Plots.Series})
|
||||
precompile(Tuple{typeof(Plots.gr_set_line), Float64, Symbol, ColorTypes.RGBA{Float64}})
|
||||
precompile(Tuple{typeof(Plots.gr_set_line), Int64, Symbol, ColorTypes.RGBA{Float64}})
|
||||
precompile(Tuple{typeof(Plots.gr_set_line), Int64, Symbol, PlotUtils.ColorGradient})
|
||||
precompile(Tuple{typeof(Plots.gr_set_linecolor), PlotUtils.ColorGradient})
|
||||
precompile(Tuple{typeof(Plots.gr_set_line), Int64, Symbol, PlotUtils.ContinuousColorGradient})
|
||||
precompile(Tuple{typeof(Plots.gr_set_linecolor), PlotUtils.ContinuousColorGradient})
|
||||
precompile(Tuple{typeof(Plots.gr_set_markercolor), ColorTypes.RGBA{Float64}})
|
||||
precompile(Tuple{typeof(Plots.gr_set_textcolor), ColorTypes.RGBA{Float64}})
|
||||
precompile(Tuple{typeof(Plots.gr_set_transparency), ColorTypes.RGBA{Float64}, Float64})
|
||||
precompile(Tuple{typeof(Plots.gr_set_transparency), ColorTypes.RGBA{Float64}, Int64})
|
||||
precompile(Tuple{typeof(Plots.gr_set_transparency), ColorTypes.RGBA{Float64}, Nothing})
|
||||
precompile(Tuple{typeof(Plots.gr_set_transparency), Float64})
|
||||
precompile(Tuple{typeof(Plots.gr_set_viewport_cmap), Plots.Subplot{Plots.GRBackend}})
|
||||
precompile(Tuple{typeof(Plots.gr_set_viewport_polar)})
|
||||
precompile(Tuple{typeof(Plots.gr_set_xticks_font), Plots.Subplot{Plots.GRBackend}})
|
||||
precompile(Tuple{typeof(Plots.gr_set_yticks_font), Plots.Subplot{Plots.GRBackend}})
|
||||
@@ -408,7 +412,6 @@ function _precompile_()
|
||||
precompile(Tuple{typeof(Plots.gr_update_colorbar!), Plots.GRColorbar, Plots.Series})
|
||||
precompile(Tuple{typeof(Plots.gr_viewport_from_bbox), Plots.Subplot{Plots.GRBackend}, Measures.BoundingBox{Tuple{Measures.Length{:mm, Float64}, Measures.Length{:mm, Float64}}, Tuple{Measures.Length{:mm, Float64}, Measures.Length{:mm, Float64}}}, Measures.Length{:mm, Float64}, Measures.Length{:mm, Float64}, Array{Float64, 1}})
|
||||
precompile(Tuple{typeof(Plots.gr_w3tondc), Float64, Float64, Float64})
|
||||
precompile(Tuple{typeof(Plots.gr_w3tondc), Int64, Float64, Float64})
|
||||
precompile(Tuple{typeof(Plots.gui), Plots.Plot{Plots.GRBackend}})
|
||||
precompile(Tuple{typeof(Plots.gui), Plots.Plot{Plots.PlotlyBackend}})
|
||||
precompile(Tuple{typeof(Plots.guide_padding), Plots.Axis})
|
||||
@@ -418,6 +421,7 @@ function _precompile_()
|
||||
precompile(Tuple{typeof(Plots.handleColors!), Base.Dict{Symbol, Any}, Plots.Shape, Symbol})
|
||||
precompile(Tuple{typeof(Plots.handleColors!), Base.Dict{Symbol, Any}, Symbol, Symbol})
|
||||
precompile(Tuple{typeof(Plots.has_attribute_segments), Plots.Series})
|
||||
precompile(Tuple{typeof(Plots.has_black_border_for_default), Symbol})
|
||||
precompile(Tuple{typeof(Plots.hascolorbar), Plots.Subplot{Plots.GRBackend}})
|
||||
precompile(Tuple{typeof(Plots.hascolorbar), Plots.Subplot{Plots.PlotlyBackend}})
|
||||
precompile(Tuple{typeof(Plots.hasgrid), Symbol, Symbol})
|
||||
@@ -450,22 +454,15 @@ function _precompile_()
|
||||
precompile(Tuple{typeof(Plots.is_2tuple), Tuple{Int64, Int64}})
|
||||
precompile(Tuple{typeof(Plots.is_2tuple), Tuple{Int64, Measures.BoundingBox{Tuple{Measures.Length{:w, Float64}, Measures.Length{:h, Float64}}, Tuple{Measures.Length{:w, Float64}, Measures.Length{:h, Float64}}}}})
|
||||
precompile(Tuple{typeof(Plots.is_axis_attr), Symbol})
|
||||
precompile(Tuple{typeof(Plots.is_axis_attr_noletter), Symbol})
|
||||
precompile(Tuple{typeof(Plots.is_default_attribute), Symbol})
|
||||
precompile(Tuple{typeof(Plots.is_marker_supported), Plots.GRBackend, Symbol})
|
||||
precompile(Tuple{typeof(Plots.is_marker_supported), Plots.PlotlyBackend, Symbol})
|
||||
precompile(Tuple{typeof(Plots.is_marker_supported), Plots.Shape})
|
||||
precompile(Tuple{typeof(Plots.is_marker_supported), Plots.Stroke})
|
||||
precompile(Tuple{typeof(Plots.is_marker_supported), Symbol})
|
||||
precompile(Tuple{typeof(Plots.is_scale_supported), Plots.GRBackend, Symbol})
|
||||
precompile(Tuple{typeof(Plots.is_scale_supported), Plots.PlotlyBackend, Symbol})
|
||||
precompile(Tuple{typeof(Plots.is_series_attr), Symbol})
|
||||
precompile(Tuple{typeof(Plots.is_seriestype_supported), Plots.GRBackend, Symbol})
|
||||
precompile(Tuple{typeof(Plots.is_seriestype_supported), Plots.PlotlyBackend, Symbol})
|
||||
precompile(Tuple{typeof(Plots.is_seriestype_supported), Symbol})
|
||||
precompile(Tuple{typeof(Plots.is_style_supported), Plots.GRBackend, Symbol})
|
||||
precompile(Tuple{typeof(Plots.is_style_supported), Plots.PlotlyBackend, Symbol})
|
||||
precompile(Tuple{typeof(Plots.is_subplot_attr), Symbol})
|
||||
precompile(Tuple{typeof(Plots.is_uniformly_spaced), Array{Float64, 1}})
|
||||
precompile(Tuple{typeof(Plots.iscontour), Plots.Series})
|
||||
precompile(Tuple{typeof(Plots.isijulia)})
|
||||
@@ -499,7 +496,6 @@ function _precompile_()
|
||||
precompile(Tuple{typeof(Plots.legendfont), Plots.Subplot{Plots.GRBackend}})
|
||||
precompile(Tuple{typeof(Plots.legendfont), Plots.Subplot{Plots.PlotlyBackend}})
|
||||
precompile(Tuple{typeof(Plots.legendtitlefont), Plots.Subplot{Plots.GRBackend}})
|
||||
precompile(Tuple{typeof(Plots.like_histogram), Symbol})
|
||||
precompile(Tuple{typeof(Plots.link_axes!), Array{RecipesBase.AbstractLayout, 1}, Symbol})
|
||||
precompile(Tuple{typeof(Plots.link_axes!), Plots.Axis, Plots.Axis})
|
||||
precompile(Tuple{typeof(Plots.link_axes!), Plots.Axis})
|
||||
@@ -508,6 +504,7 @@ function _precompile_()
|
||||
precompile(Tuple{typeof(Plots.link_axes!), Plots.Subplot{Plots.PlotlyBackend}, Symbol})
|
||||
precompile(Tuple{typeof(Plots.link_subplots), Array{RecipesBase.AbstractLayout, 1}, Symbol})
|
||||
precompile(Tuple{typeof(Plots.locate_annotation), Plots.Subplot{Plots.GRBackend}, Int64, Float64, Plots.PlotText})
|
||||
precompile(Tuple{typeof(Plots.locate_annotation), Plots.Subplot{Plots.PlotlyBackend}, Int64, Float64, Plots.PlotText})
|
||||
precompile(Tuple{typeof(Plots.make_fillrange_from_ribbon), Base.Dict{Symbol, Any}})
|
||||
precompile(Tuple{typeof(Plots.make_fillrange_side), Base.UnitRange{Int64}, Array{Float64, 1}})
|
||||
precompile(Tuple{typeof(Plots.make_fillrange_side), Base.UnitRange{Int64}, Base.LinRange{Float64}})
|
||||
@@ -525,8 +522,8 @@ function _precompile_()
|
||||
precompile(Tuple{typeof(Plots.optimal_ticks_and_labels), Plots.Subplot{Plots.PlotlyBackend}, Plots.Axis, Base.UnitRange{Int64}})
|
||||
precompile(Tuple{typeof(Plots.optimal_ticks_and_labels), Plots.Subplot{Plots.PlotlyBackend}, Plots.Axis, Nothing})
|
||||
precompile(Tuple{typeof(Plots.parse_axis_kw), Symbol})
|
||||
precompile(Tuple{typeof(Plots.pie_labels), Plots.Subplot{Plots.GRBackend}, Plots.Series})
|
||||
precompile(Tuple{typeof(Plots.pie_labels), Plots.Subplot{Plots.PlotlyBackend}, Plots.Series})
|
||||
precompile(Tuple{typeof(Plots.partialcircle), Float64, Float64, Int64, Int64})
|
||||
precompile(Tuple{typeof(Plots.partialcircle), Int64, Float64, Int64, Int64})
|
||||
precompile(Tuple{typeof(Plots.plotarea!), Plots.GridLayout, Measures.BoundingBox{Tuple{Measures.Length{:mm, Float64}, Measures.Length{:mm, Float64}}, Tuple{Measures.Length{:mm, Float64}, Measures.Length{:mm, Float64}}}})
|
||||
precompile(Tuple{typeof(Plots.plotarea!), Plots.Subplot{Plots.GRBackend}, Measures.BoundingBox{Tuple{Measures.Length{:mm, Float64}, Measures.Length{:mm, Float64}}, Tuple{Measures.Length{:mm, Float64}, Measures.Length{:mm, Float64}}}})
|
||||
precompile(Tuple{typeof(Plots.plotarea!), Plots.Subplot{Plots.PlotlyBackend}, Measures.BoundingBox{Tuple{Measures.Length{:mm, Float64}, Measures.Length{:mm, Float64}}, Tuple{Measures.Length{:mm, Float64}, Measures.Length{:mm, Float64}}}})
|
||||
@@ -536,13 +533,13 @@ function _precompile_()
|
||||
precompile(Tuple{typeof(Plots.plotly_apply_aspect_ratio), Plots.Subplot{Plots.PlotlyBackend}, Measures.BoundingBox{Tuple{Measures.Length{:mm, Float64}, Measures.Length{:mm, Float64}}, Tuple{Measures.Length{:mm, Float64}, Measures.Length{:mm, Float64}}}, Array{Float64, 1}})
|
||||
precompile(Tuple{typeof(Plots.plotly_axis), Plots.Plot{Plots.PlotlyBackend}, Plots.Axis, Plots.Subplot{Plots.PlotlyBackend}})
|
||||
precompile(Tuple{typeof(Plots.plotly_colorbar_hack), Plots.Series, Base.Dict{Symbol, Any}, Symbol})
|
||||
precompile(Tuple{typeof(Plots.plotly_colorscale), PlotUtils.ColorGradient, Nothing})
|
||||
precompile(Tuple{typeof(Plots.plotly_colorscale), PlotUtils.CategoricalColorGradient, Int64})
|
||||
precompile(Tuple{typeof(Plots.plotly_colorscale), PlotUtils.ContinuousColorGradient, Int64})
|
||||
precompile(Tuple{typeof(Plots.plotly_colorscale), PlotUtils.ContinuousColorGradient, Nothing})
|
||||
precompile(Tuple{typeof(Plots.plotly_data), Array{Float64, 1}})
|
||||
precompile(Tuple{typeof(Plots.plotly_data), Array{Int64, 1}})
|
||||
precompile(Tuple{typeof(Plots.plotly_data), Array{String, 1}})
|
||||
precompile(Tuple{typeof(Plots.plotly_data), Plots.Series, Symbol, Array{Float64, 1}})
|
||||
precompile(Tuple{typeof(Plots.plotly_data), Plots.Series, Symbol, Array{Int64, 1}})
|
||||
precompile(Tuple{typeof(Plots.plotly_data), Plots.Series, Symbol, Array{String, 1}})
|
||||
precompile(Tuple{typeof(Plots.plotly_data), Plots.Series, Symbol, Base.OneTo{Int64}})
|
||||
precompile(Tuple{typeof(Plots.plotly_data), Plots.Series, Symbol, Base.StepRangeLen{Float64, Base.TwicePrecision{Float64}, Base.TwicePrecision{Float64}}})
|
||||
precompile(Tuple{typeof(Plots.plotly_data), Plots.Series, Symbol, Base.StepRange{Int64, Int64}})
|
||||
@@ -562,7 +559,6 @@ function _precompile_()
|
||||
precompile(Tuple{typeof(Plots.plotly_native_data), Plots.Axis, Array{Float64, 1}})
|
||||
precompile(Tuple{typeof(Plots.plotly_native_data), Plots.Axis, Array{Float64, 2}})
|
||||
precompile(Tuple{typeof(Plots.plotly_native_data), Plots.Axis, Array{Int64, 1}})
|
||||
precompile(Tuple{typeof(Plots.plotly_native_data), Plots.Axis, Array{String, 1}})
|
||||
precompile(Tuple{typeof(Plots.plotly_native_data), Plots.Axis, Base.OneTo{Int64}})
|
||||
precompile(Tuple{typeof(Plots.plotly_native_data), Plots.Axis, Base.StepRangeLen{Float64, Base.TwicePrecision{Float64}, Base.TwicePrecision{Float64}}})
|
||||
precompile(Tuple{typeof(Plots.plotly_native_data), Plots.Axis, Base.StepRange{Int64, Int64}})
|
||||
@@ -644,6 +640,7 @@ function _precompile_()
|
||||
precompile(Tuple{typeof(Plots.slice_arg), Array{ColorTypes.RGBA{Float64}, 2}, Int64})
|
||||
precompile(Tuple{typeof(Plots.slice_arg), Array{Float64, 2}, Int64})
|
||||
precompile(Tuple{typeof(Plots.slice_arg), Array{Measures.Length{:mm, Float64}, 2}, Int64})
|
||||
precompile(Tuple{typeof(Plots.slice_arg), Array{PlotUtils.ContinuousColorGradient, 2}, Int64})
|
||||
precompile(Tuple{typeof(Plots.slice_arg), Array{String, 2}, Int64})
|
||||
precompile(Tuple{typeof(Plots.slice_arg), Array{Symbol, 2}, Int64})
|
||||
precompile(Tuple{typeof(Plots.slice_arg), Base.ReshapedArray{Int64, 2, Base.UnitRange{Int64}, Tuple{}}, Int64})
|
||||
@@ -677,6 +674,9 @@ function _precompile_()
|
||||
precompile(Tuple{typeof(Plots.text_size), Int64, Int64, Int64})
|
||||
precompile(Tuple{typeof(Plots.tick_padding), Plots.Subplot{Plots.PlotlyBackend}, Plots.Axis})
|
||||
precompile(Tuple{typeof(Plots.tickfont), Plots.Axis})
|
||||
precompile(Tuple{typeof(Plots.ticksType), Tuple{Array{Float64, 1}, Array{Any, 1}}})
|
||||
precompile(Tuple{typeof(Plots.ticksType), Tuple{Array{Float64, 1}, Array{String, 1}}})
|
||||
precompile(Tuple{typeof(Plots.ticksType), Tuple{Array{Int64, 1}, Array{String, 1}}})
|
||||
precompile(Tuple{typeof(Plots.title!), String})
|
||||
precompile(Tuple{typeof(Plots.title_padding), Plots.Subplot{Plots.PlotlyBackend}})
|
||||
precompile(Tuple{typeof(Plots.titlefont), Plots.Subplot{Plots.GRBackend}})
|
||||
|
||||
+51
-55
@@ -71,8 +71,9 @@ const POTENTIAL_VECTOR_ARGUMENTS = [
|
||||
:marker_z,
|
||||
:markerstrokecolor,
|
||||
:markerstrokealpha,
|
||||
:xerror,
|
||||
:yerror,
|
||||
:yerror,
|
||||
:zerror,
|
||||
:series_annotations,
|
||||
:fillrange,
|
||||
]
|
||||
@@ -111,7 +112,7 @@ end
|
||||
|
||||
@recipe function f(::Type{Val{:hline}}, x, y, z)
|
||||
n = length(y)
|
||||
newx = repeat(Float64[-1, 1, NaN], n)
|
||||
newx = repeat(Float64[1, 2, NaN], n)
|
||||
newy = vec(Float64[yi for i = 1:3, yi in y])
|
||||
x := newx
|
||||
y := newy
|
||||
@@ -123,7 +124,7 @@ end
|
||||
@recipe function f(::Type{Val{:vline}}, x, y, z)
|
||||
n = length(y)
|
||||
newx = vec(Float64[yi for i = 1:3, yi in y])
|
||||
newy = repeat(Float64[-1, 1, NaN], n)
|
||||
newy = repeat(Float64[1, 2, NaN], n)
|
||||
x := newx
|
||||
y := newy
|
||||
seriestype := :straightline
|
||||
@@ -459,7 +460,7 @@ end
|
||||
@deps plots_heatmap shape
|
||||
is_3d(::Type{Val{:plots_heatmap}}) = true
|
||||
RecipesPipeline.is_surface(::Type{Val{:plots_heatmap}}) = true
|
||||
|
||||
RecipesPipeline.is_surface(::Type{Val{:hexbin}}) = true
|
||||
# ---------------------------------------------------------------------------
|
||||
# Histograms
|
||||
|
||||
@@ -537,14 +538,19 @@ end
|
||||
@recipe function f(::Type{Val{:scatterbins}}, x, y, z)
|
||||
edge, weights, xscale, yscale, baseline =
|
||||
_preprocess_binlike(plotattributes, x, y)
|
||||
xerror := diff(edge) / 2
|
||||
@series begin
|
||||
x := _bin_centers(edge)
|
||||
xerror := diff(edge) / 2
|
||||
primary := false
|
||||
seriestype := :xerror
|
||||
()
|
||||
end
|
||||
x := _bin_centers(edge)
|
||||
y := weights
|
||||
seriestype := :scatter
|
||||
()
|
||||
end
|
||||
@deps scatterbins scatter
|
||||
|
||||
@deps scatterbins xerror scatter
|
||||
|
||||
function _stepbins_path(
|
||||
edge,
|
||||
@@ -885,6 +891,28 @@ end
|
||||
end
|
||||
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# pie
|
||||
@recipe function f(::Type{Val{:pie}}, x, y, z)
|
||||
framestyle --> :none
|
||||
aspect_ratio --> true
|
||||
s = sum(y)
|
||||
θ = 0
|
||||
for i in eachindex(y)
|
||||
θ_new = θ + 2π * y[i] / s
|
||||
coords = [(0.0, 0.0); partialcircle(θ, θ_new, 50)]
|
||||
@series begin
|
||||
seriestype := :shape
|
||||
label --> string(x[i])
|
||||
x := first.(coords)
|
||||
y := last.(coords)
|
||||
end
|
||||
θ = θ_new
|
||||
end
|
||||
end
|
||||
@deps pie shape
|
||||
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# scatter 3d
|
||||
|
||||
@@ -1000,7 +1028,7 @@ end
|
||||
|
||||
function error_style!(plotattributes::AKW)
|
||||
plotattributes[:seriestype] = :path
|
||||
plotattributes[:linecolor] = plotattributes[:markerstrokecolor]
|
||||
plotattributes[:markercolor] = plotattributes[:markerstrokecolor]
|
||||
plotattributes[:linewidth] = plotattributes[:markerstrokewidth]
|
||||
plotattributes[:label] = ""
|
||||
end
|
||||
@@ -1019,7 +1047,7 @@ error_tuple(x::Tuple) = x
|
||||
|
||||
function error_coords(errorbar, errordata, otherdata...)
|
||||
ed = Vector{float_extended_type(errordata)}(undef, 0)
|
||||
od = [Float64[] for _ in otherdata]
|
||||
od = [Vector{float_extended_type(odi)}(undef, 0) for odi in otherdata]
|
||||
for (i, edi) in enumerate(errordata)
|
||||
for (j, odj) in enumerate(otherdata)
|
||||
odi = _cycle(odj, i)
|
||||
@@ -1072,7 +1100,7 @@ end
|
||||
end
|
||||
()
|
||||
end
|
||||
@deps xerror path
|
||||
@deps zerror path
|
||||
|
||||
|
||||
# TODO: move quiver to PlotRecipes
|
||||
@@ -1387,7 +1415,7 @@ end
|
||||
@recipe function f(::Type{Val{:spy}}, x, y, z)
|
||||
yflip := true
|
||||
aspect_ratio := 1
|
||||
rs, cs, zs = findnz(z.surf)
|
||||
rs, cs, zs = Plots.findnz(z.surf)
|
||||
xlims := ignorenan_extrema(cs)
|
||||
ylims := ignorenan_extrema(rs)
|
||||
if plotattributes[:markershape] == :none
|
||||
@@ -1407,6 +1435,18 @@ end
|
||||
()
|
||||
end
|
||||
|
||||
|
||||
Plots.findnz(A::AbstractSparseMatrix) = findnz(A)
|
||||
|
||||
# fallback function for finding non-zero elements of non-sparse matrices
|
||||
function Plots.findnz(A::AbstractMatrix)
|
||||
keysnz = findall(!iszero, A)
|
||||
rs = [k[1] for k in keysnz]
|
||||
cs = [k[2] for k in keysnz]
|
||||
zs = A[keysnz]
|
||||
rs, cs, zs
|
||||
end
|
||||
|
||||
# -------------------------------------------------
|
||||
|
||||
"Adds ax+b... straight line over the current plot, without changing the axis limits"
|
||||
@@ -1434,50 +1474,6 @@ end
|
||||
end
|
||||
|
||||
|
||||
# --------------------------------------------------
|
||||
# Color Gradients
|
||||
|
||||
@userplot ShowLibrary
|
||||
@recipe function f(cl::ShowLibrary)
|
||||
if !(length(cl.args) == 1 && isa(cl.args[1], Symbol))
|
||||
error("showlibrary takes the name of a color library as a Symbol")
|
||||
end
|
||||
|
||||
library = PlotUtils.color_libraries[cl.args[1]]
|
||||
z = sqrt.((1:15) * reshape(1:20, 1, :))
|
||||
|
||||
seriestype := :heatmap
|
||||
ticks := nothing
|
||||
legend := false
|
||||
|
||||
layout --> length(library.lib)
|
||||
|
||||
i = 0
|
||||
for grad in sort(collect(keys(library.lib)))
|
||||
@series begin
|
||||
seriescolor := cgrad(grad, cl.args[1])
|
||||
title := string(grad)
|
||||
subplot := i += 1
|
||||
z
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@userplot ShowGradient
|
||||
@recipe function f(grad::ShowGradient)
|
||||
if !(length(grad.args) == 1 && isa(grad.args[1], Symbol))
|
||||
error("showgradient takes the name of a color gradient as a Symbol")
|
||||
end
|
||||
z = sqrt.((1:15) * reshape(1:20, 1, :))
|
||||
seriestype := :heatmap
|
||||
ticks := nothing
|
||||
legend := false
|
||||
seriescolor := grad.args[1]
|
||||
title := string(grad.args[1])
|
||||
z
|
||||
end
|
||||
|
||||
|
||||
# Moved in from PlotRecipes - see: http://stackoverflow.com/a/37732384/5075246
|
||||
@userplot PortfolioComposition
|
||||
|
||||
|
||||
+3
-4
@@ -251,7 +251,7 @@ Draw contour lines of the `Surface` z.
|
||||
|
||||
# Example
|
||||
```julia-repl
|
||||
julia> x = y = range(-20, 20, length = 100)
|
||||
julia> x = y = range(-20, stop = 20, length = 100)
|
||||
julia> contour(x, y, (x, y) -> x^2 + y^2)
|
||||
```
|
||||
"""
|
||||
@@ -272,7 +272,7 @@ Draw a 3D surface plot.
|
||||
# Example
|
||||
```julia-repl
|
||||
julia> using LinearAlgebra
|
||||
julia> x = y = range(-3, 3, length = 100)
|
||||
julia> x = y = range(-3, stop = 3, length = 100)
|
||||
julia> surface(x, y, (x, y) -> sinc(norm([x, y])))
|
||||
```
|
||||
"""
|
||||
@@ -381,8 +381,7 @@ julia> curves([1,2,3,4],[1,1,2,4])
|
||||
@shorthands curves
|
||||
|
||||
"Plot a pie diagram"
|
||||
pie(args...; kw...) = plot(args...; kw..., seriestype = :pie, aspect_ratio = :equal, grid=false, xticks=nothing, yticks=nothing)
|
||||
pie!(args...; kw...) = plot!(args...; kw..., seriestype = :pie, aspect_ratio = :equal, grid=false, xticks=nothing, yticks=nothing)
|
||||
@shorthands pie
|
||||
|
||||
"Plot with seriestype :path3d"
|
||||
plot3d(args...; kw...) = plot(args...; kw..., seriestype = :path3d)
|
||||
|
||||
+18
-6
@@ -42,12 +42,24 @@ get_subplot_index(plt::Plot, sp::Subplot) = findfirst(x -> x === sp, plt.subplot
|
||||
series_list(sp::Subplot) = sp.series_list # filter(series -> series.plotattributes[:subplot] === sp, sp.plt.series_list)
|
||||
|
||||
function should_add_to_legend(series::Series)
|
||||
series.plotattributes[:primary] && series.plotattributes[:label] != "" &&
|
||||
!(series.plotattributes[:seriestype] in (
|
||||
:hexbin,:bins2d,:histogram2d,:hline,:vline,
|
||||
:contour,:contourf,:contour3d,:surface,:wireframe,
|
||||
:heatmap, :pie, :image
|
||||
))
|
||||
series.plotattributes[:primary] &&
|
||||
series.plotattributes[:label] != "" &&
|
||||
!(
|
||||
series.plotattributes[:seriestype] in (
|
||||
:hexbin,
|
||||
:bins2d,
|
||||
:histogram2d,
|
||||
:hline,
|
||||
:vline,
|
||||
:contour,
|
||||
:contourf,
|
||||
:contour3d,
|
||||
:surface,
|
||||
:wireframe,
|
||||
:heatmap,
|
||||
:image,
|
||||
)
|
||||
)
|
||||
end
|
||||
|
||||
# ----------------------------------------------------------------------
|
||||
|
||||
+9
-19
@@ -14,25 +14,15 @@ function _theme(s::Symbol, defaults::AKW; kw...)
|
||||
|
||||
# Set the theme's gradient as default
|
||||
if haskey(defaults, :colorgradient)
|
||||
PlotUtils.clibrary(:misc)
|
||||
PlotUtils.default_cgrad(default = :sequential, sequential = PlotThemes.gradient_name(s))
|
||||
pop!(defaults, :colorgradient)
|
||||
PlotUtils.default_cgrad(pop!(defaults, :colorgradient))
|
||||
else
|
||||
PlotUtils.clibrary(:Plots)
|
||||
PlotUtils.default_cgrad(default = :sequential, sequential = :inferno)
|
||||
PlotUtils.default_cgrad(:default)
|
||||
end
|
||||
|
||||
# maybe overwrite the theme's gradient
|
||||
kw = KW(kw)
|
||||
if haskey(kw, :colorgradient)
|
||||
kwgrad = pop!(kw, :colorgradient)
|
||||
for clib in clibraries()
|
||||
if kwgrad in cgradients(clib)
|
||||
PlotUtils.clibrary(clib)
|
||||
PlotUtils.default_cgrad(default = :sequential, sequential = kwgrad)
|
||||
break
|
||||
end
|
||||
end
|
||||
PlotUtils.default_cgrad(pop!(kw, :colorgradient))
|
||||
end
|
||||
|
||||
# Set the theme's defaults
|
||||
@@ -57,12 +47,12 @@ _get_showtheme_args(thm::Symbol, func::Symbol) = thm, get(_color_functions, func
|
||||
defaults = PlotThemes._themes[thm].defaults
|
||||
|
||||
# get the gradient
|
||||
gradient_colors = get(defaults, :colorgradient, cgrad(:inferno).colors)
|
||||
gradient_colors = color_list(cgrad(get(defaults, :colorgradient, :default)))
|
||||
colorgradient = cgrad(cfunc.(RGB.(gradient_colors)))
|
||||
|
||||
# get the palette
|
||||
palette = get(defaults, :palette, get_color_palette(:auto, plot_color(:white), 17))
|
||||
palette = cfunc.(RGB.(palette))
|
||||
cp = color_list(palette(get(defaults, :palette, :default)))
|
||||
cp = cfunc.(RGB.(cp))
|
||||
|
||||
# apply the theme
|
||||
for k in keys(defaults)
|
||||
@@ -89,7 +79,7 @@ _get_showtheme_args(thm::Symbol, func::Symbol) = thm, get(_color_functions, func
|
||||
for j in 1:4
|
||||
@series begin
|
||||
subplot := 1
|
||||
palette := palette
|
||||
color_palette := cp
|
||||
seriestype := :path
|
||||
cumsum(randn(50))
|
||||
end
|
||||
@@ -97,7 +87,7 @@ _get_showtheme_args(thm::Symbol, func::Symbol) = thm, get(_color_functions, func
|
||||
@series begin
|
||||
subplot := 2
|
||||
seriestype := :scatter
|
||||
palette := palette
|
||||
color_palette := cp
|
||||
marker := (:circle, :diamond, :star5, :square)[j]
|
||||
randn(10), randn(10)
|
||||
end
|
||||
@@ -106,7 +96,7 @@ _get_showtheme_args(thm::Symbol, func::Symbol) = thm, get(_color_functions, func
|
||||
@series begin
|
||||
subplot := 3
|
||||
seriestype := :histogram
|
||||
palette := palette
|
||||
color_palette := cp
|
||||
randn(1000) .+ (0:2:4)'
|
||||
end
|
||||
|
||||
|
||||
+124
-47
@@ -1,8 +1,8 @@
|
||||
|
||||
function replace_image_with_heatmap(z::Array{T}) where T<:Colorant
|
||||
n, m = size(z)
|
||||
colors = ColorGradient(vec(z))
|
||||
newz = reshape(range(0, stop=1, length=n*m), n, m)
|
||||
colors = palette(vec(z))
|
||||
newz = reshape(1:n*m, n, m)
|
||||
newz, colors
|
||||
end
|
||||
|
||||
@@ -75,7 +75,11 @@ function iter_segments(series::Series)
|
||||
if series[:seriestype] in (:scatter, :scatter3d)
|
||||
return [[i] for i in eachindex(y)]
|
||||
else
|
||||
return [i:(i + 1) for i in firstindex(y):lastindex(y)-1]
|
||||
if any(isnan,y)
|
||||
return [iter_segments(y)...]
|
||||
else
|
||||
return [i:(i + 1) for i in firstindex(y):lastindex(y)-1]
|
||||
end
|
||||
end
|
||||
else
|
||||
segs = UnitRange{Int}[]
|
||||
@@ -130,11 +134,13 @@ _cycle(v::AVec, indices::AVec{Int}) = map(i -> _cycle(v,i), indices)
|
||||
_cycle(v::AMat, indices::AVec{Int}) = map(i -> _cycle(v,i), indices)
|
||||
_cycle(v, indices::AVec{Int}) = fill(v, length(indices))
|
||||
|
||||
_cycle(grad::ColorGradient, idx::Int) = _cycle(grad.colors, idx)
|
||||
_cycle(grad::ColorGradient, indices::AVec{Int}) = _cycle(grad.colors, indices)
|
||||
_cycle(cl::PlotUtils.AbstractColorList, idx::Int) = cl[mod1(idx, end)]
|
||||
_cycle(cl::PlotUtils.AbstractColorList, idx::AVec{Int}) = cl[mod1.(idx, end)]
|
||||
|
||||
_as_gradient(grad::ColorGradient) = grad
|
||||
_as_gradient(c::Colorant) = ColorGradient([c,c])
|
||||
_as_gradient(grad) = grad
|
||||
_as_gradient(v::AbstractVector{<:Colorant}) = cgrad(v)
|
||||
_as_gradient(cp::ColorPalette) = cgrad(cp, categorical = true)
|
||||
_as_gradient(c::Colorant) = cgrad([c, c])
|
||||
|
||||
makevec(v::AVec) = v
|
||||
makevec(v::T) where {T} = T[v]
|
||||
@@ -206,13 +212,6 @@ Base.first(x::Symbol) = x
|
||||
|
||||
sortedkeys(plotattributes::Dict) = sort(collect(keys(plotattributes)))
|
||||
|
||||
|
||||
const _scale_base = Dict{Symbol, Real}(
|
||||
:log10 => 10,
|
||||
:log2 => 2,
|
||||
:ln => ℯ,
|
||||
)
|
||||
|
||||
function _heatmap_edges(v::AVec, isedges::Bool = false)
|
||||
length(v) == 1 && return v[1] .+ [-0.5, 0.5]
|
||||
if isedges return v end
|
||||
@@ -303,6 +302,11 @@ Base.convert(::Type{Vector{T}}, rng::AbstractRange{S}) where {T<:Real,S<:Real} =
|
||||
|
||||
Base.merge(a::AbstractVector, b::AbstractVector) = sort(unique(vcat(a,b)))
|
||||
|
||||
# recursively merge kw-dicts, e.g. for merging extra_kwargs / extra_plot_kwargs in plotly)
|
||||
recursive_merge(x::AbstractDict...) = merge(recursive_merge, x...)
|
||||
# if values are not AbstractDicts, take the last definition (as does merge)
|
||||
recursive_merge(x...) = x[end]
|
||||
|
||||
nanpush!(a::AbstractVector, b) = (push!(a, NaN); push!(a, b))
|
||||
nanappend!(a::AbstractVector, b) = (push!(a, NaN); append!(a, b))
|
||||
|
||||
@@ -415,44 +419,46 @@ xlims(sp_idx::Int = 1) = xlims(current(), sp_idx)
|
||||
ylims(sp_idx::Int = 1) = ylims(current(), sp_idx)
|
||||
zlims(sp_idx::Int = 1) = zlims(current(), sp_idx)
|
||||
|
||||
# These functions return an operator for use in `get_clims(::Seres, op)`
|
||||
process_clims(lims::Tuple{<:Number,<:Number}) = (zlims -> ifelse.(isfinite.(lims), lims, zlims)) ∘ ignorenan_extrema
|
||||
process_clims(s::Union{Symbol,Nothing,Missing}) = ignorenan_extrema
|
||||
# don't specialize on ::Function otherwise python functions won't work
|
||||
process_clims(f) = f
|
||||
|
||||
function get_clims(sp::Subplot)
|
||||
function get_clims(sp::Subplot, op=process_clims(sp[:clims]))
|
||||
zmin, zmax = Inf, -Inf
|
||||
for series in series_list(sp)
|
||||
if series[:colorbar_entry]
|
||||
zmin, zmax = _update_clims(zmin, zmax, get_clims(series)...)
|
||||
zmin, zmax = _update_clims(zmin, zmax, get_clims(series, op)...)
|
||||
end
|
||||
end
|
||||
clims = sp[:clims]
|
||||
if is_2tuple(clims)
|
||||
isfinite(clims[1]) && (zmin = clims[1])
|
||||
isfinite(clims[2]) && (zmax = clims[2])
|
||||
end
|
||||
return zmin <= zmax ? (zmin, zmax) : (NaN, NaN)
|
||||
end
|
||||
|
||||
function get_clims(sp::Subplot, series::Series)
|
||||
function get_clims(sp::Subplot, series::Series, op=process_clims(sp[:clims]))
|
||||
zmin, zmax = if series[:colorbar_entry]
|
||||
get_clims(sp)
|
||||
get_clims(sp, op)
|
||||
else
|
||||
get_clims(series)
|
||||
end
|
||||
clims = sp[:clims]
|
||||
if is_2tuple(clims)
|
||||
isfinite(clims[1]) && (zmin = clims[1])
|
||||
isfinite(clims[2]) && (zmax = clims[2])
|
||||
get_clims(series, op)
|
||||
end
|
||||
return zmin <= zmax ? (zmin, zmax) : (NaN, NaN)
|
||||
end
|
||||
|
||||
function get_clims(series::Series)
|
||||
"""
|
||||
get_clims(::Series, op=Plots.ignorenan_extrema)
|
||||
|
||||
Finds the limits for the colorbar by taking the "z-values" for the series and passing them into `op`,
|
||||
which must return the tuple `(zmin, zmax)`. The default op is the extrema of the finite
|
||||
values of the input.
|
||||
"""
|
||||
function get_clims(series::Series, op=ignorenan_extrema)
|
||||
zmin, zmax = Inf, -Inf
|
||||
z_colored_series = (:contour, :contour3d, :heatmap, :histogram2d, :surface)
|
||||
z_colored_series = (:contour, :contour3d, :heatmap, :histogram2d, :surface, :hexbin)
|
||||
for vals in (series[:seriestype] in z_colored_series ? series[:z] : nothing, series[:line_z], series[:marker_z], series[:fill_z])
|
||||
if (typeof(vals) <: AbstractSurface) && (eltype(vals.surf) <: Union{Missing, Real})
|
||||
zmin, zmax = _update_clims(zmin, zmax, ignorenan_extrema(vals.surf)...)
|
||||
zmin, zmax = _update_clims(zmin, zmax, op(vals.surf)...)
|
||||
elseif (vals !== nothing) && (eltype(vals) <: Union{Missing, Real})
|
||||
zmin, zmax = _update_clims(zmin, zmax, ignorenan_extrema(vals)...)
|
||||
zmin, zmax = _update_clims(zmin, zmax, op(vals)...)
|
||||
end
|
||||
end
|
||||
return zmin <= zmax ? (zmin, zmax) : (NaN, NaN)
|
||||
@@ -486,7 +492,7 @@ end
|
||||
hascolorbar(series::Series) = colorbar_style(series) !== nothing
|
||||
hascolorbar(sp::Subplot) = sp[:colorbar] != :none && any(hascolorbar(s) for s in series_list(sp))
|
||||
|
||||
iscontour(series::Series) = series[:seriestype] == :contour
|
||||
iscontour(series::Series) = series[:seriestype] in (:contour, :contour3d)
|
||||
isfilledcontour(series::Series) = iscontour(series) && series[:fillrange] !== nothing
|
||||
|
||||
function contour_levels(series::Series, clims)
|
||||
@@ -521,8 +527,7 @@ for comp in (:line, :fill, :marker)
|
||||
if z === nothing
|
||||
isa(c, ColorGradient) ? c : plot_color(_cycle(c, i))
|
||||
else
|
||||
grad = isa(c, ColorGradient) ? c : cgrad()
|
||||
grad[clamp((_cycle(z, i) - cmin) / (cmax - cmin), 0, 1)]
|
||||
get(get_gradient(c), z[i], (cmin, cmax))
|
||||
end
|
||||
end
|
||||
|
||||
@@ -540,9 +545,28 @@ for comp in (:line, :fill, :marker)
|
||||
end
|
||||
end
|
||||
|
||||
function get_colorgradient(series::Series)
|
||||
st = series[:seriestype]
|
||||
if st in (:surface, :heatmap) || isfilledcontour(series)
|
||||
series[:fillcolor]
|
||||
elseif st in (:contour, :wireframe)
|
||||
series[:linecolor]
|
||||
elseif series[:marker_z] !== nothing
|
||||
series[:markercolor]
|
||||
elseif series[:line_z] !== nothing
|
||||
series[:linecolor]
|
||||
elseif series[:fill_z] !== nothing
|
||||
series[:fillcolor]
|
||||
end
|
||||
end
|
||||
|
||||
single_color(c, v = 0.5) = c
|
||||
single_color(grad::ColorGradient, v = 0.5) = grad[v]
|
||||
|
||||
get_gradient(c) = cgrad()
|
||||
get_gradient(cg::ColorGradient) = cg
|
||||
get_gradient(cp::ColorPalette) = cgrad(cp, categorical = true)
|
||||
|
||||
function get_linewidth(series, i::Int = 1)
|
||||
_cycle(series[:linewidth], i)
|
||||
end
|
||||
@@ -574,7 +598,28 @@ function has_attribute_segments(series::Series)
|
||||
end
|
||||
series[:seriestype] == :shape && return false
|
||||
# ... else we check relevant attributes if they have multiple inputs
|
||||
return any((typeof(series[attr]) <: AbstractVector && length(series[attr]) > 1) for attr in [:seriescolor, :seriesalpha, :linecolor, :linealpha, :linewidth, :linestyle, :fillcolor, :fillalpha, :markercolor, :markeralpha, :markerstrokecolor, :markerstrokealpha]) || any(typeof(series[attr]) <: AbstractArray for attr in (:line_z, :fill_z, :marker_z))
|
||||
return any(
|
||||
(typeof(series[attr]) <: AbstractVector && length(series[attr]) > 1)
|
||||
for
|
||||
attr in [
|
||||
:seriescolor,
|
||||
:seriesalpha,
|
||||
:linecolor,
|
||||
:linealpha,
|
||||
:linewidth,
|
||||
:linestyle,
|
||||
:fillcolor,
|
||||
:fillalpha,
|
||||
:markercolor,
|
||||
:markeralpha,
|
||||
:markersize,
|
||||
:markerstrokecolor,
|
||||
:markerstrokealpha,
|
||||
:markerstrokewidth,
|
||||
]
|
||||
) || any(
|
||||
typeof(series[attr]) <: AbstractArray for attr in (:line_z, :fill_z, :marker_z)
|
||||
)
|
||||
end
|
||||
|
||||
function get_aspect_ratio(sp)
|
||||
@@ -590,6 +635,17 @@ function get_aspect_ratio(sp)
|
||||
return aspect_ratio
|
||||
end
|
||||
|
||||
get_size(kw) = get(kw, :size, default(:size))
|
||||
get_size(plt::Plot) = get_size(plt.attr)
|
||||
get_size(sp::Subplot) = get_size(sp.plt)
|
||||
get_size(series::Series) = get_size(series.plotattributes[:subplot])
|
||||
|
||||
get_thickness_scaling(kw) = get(kw, :thickness_scaling, default(:thickness_scaling))
|
||||
get_thickness_scaling(plt::Plot) = get_thickness_scaling(plt.attr)
|
||||
get_thickness_scaling(sp::Subplot) = get_thickness_scaling(sp.plt)
|
||||
get_thickness_scaling(series::Series) =
|
||||
get_thickness_scaling(series.plotattributes[:subplot])
|
||||
|
||||
# ---------------------------------------------------------------
|
||||
|
||||
makekw(; kw...) = KW(kw)
|
||||
@@ -932,7 +988,7 @@ px2inch(px::Real) = float(px / PX_PER_INCH)
|
||||
inch2mm(inches::Real) = float(inches * MM_PER_INCH)
|
||||
mm2inch(mm::Real) = float(mm / MM_PER_INCH)
|
||||
px2mm(px::Real) = float(px * MM_PER_PX)
|
||||
mm2px(mm::Real) = float(px / MM_PER_PX)
|
||||
mm2px(mm::Real) = float(mm / MM_PER_PX)
|
||||
|
||||
|
||||
"Smallest x in plot"
|
||||
@@ -1023,10 +1079,21 @@ end
|
||||
function straightline_data(series, expansion_factor = 1)
|
||||
sp = series[:subplot]
|
||||
xl, yl = isvertical(series) ? (xlims(sp), ylims(sp)) : (ylims(sp), xlims(sp))
|
||||
x, y = series[:x], series[:y]
|
||||
|
||||
# handle axes scales
|
||||
xscale = sp[:xaxis][:scale]
|
||||
xf = RecipesPipeline.scale_func(xscale)
|
||||
xinvf = RecipesPipeline.inverse_scale_func(xscale)
|
||||
yscale = sp[:yaxis][:scale]
|
||||
yf = RecipesPipeline.scale_func(yscale)
|
||||
yinvf = RecipesPipeline.inverse_scale_func(yscale)
|
||||
|
||||
xl, yl = xf.(xl), yf.(yl)
|
||||
x, y = xf.(series[:x]), yf.(series[:y])
|
||||
n = length(x)
|
||||
if n == 2
|
||||
return straightline_data(xl, yl, x, y, expansion_factor)
|
||||
|
||||
xdata, ydata = if n == 2
|
||||
straightline_data(xl, yl, x, y, expansion_factor)
|
||||
else
|
||||
k, r = divrem(n, 3)
|
||||
if r == 0
|
||||
@@ -1035,11 +1102,13 @@ function straightline_data(series, expansion_factor = 1)
|
||||
inds = (3 * i - 2):(3 * i - 1)
|
||||
xdata[inds], ydata[inds] = straightline_data(xl, yl, x[inds], y[inds], expansion_factor)
|
||||
end
|
||||
return xdata, ydata
|
||||
xdata, ydata
|
||||
else
|
||||
error("Misformed data. `straightline_data` either accepts vectors of length 2 or 3k. The provided series has length $n")
|
||||
end
|
||||
end
|
||||
|
||||
return xinvf.(xdata), yinvf.(ydata)
|
||||
end
|
||||
|
||||
function straightline_data(xl, yl, x, y, expansion_factor = 1)
|
||||
@@ -1071,20 +1140,28 @@ end
|
||||
function shape_data(series, expansion_factor = 1)
|
||||
sp = series[:subplot]
|
||||
xl, yl = isvertical(series) ? (xlims(sp), ylims(sp)) : (ylims(sp), xlims(sp))
|
||||
|
||||
# handle axes scales
|
||||
xscale = sp[:xaxis][:scale]
|
||||
xf = RecipesPipeline.scale_func(xscale)
|
||||
xinvf = RecipesPipeline.inverse_scale_func(xscale)
|
||||
yscale = sp[:yaxis][:scale]
|
||||
yf = RecipesPipeline.scale_func(yscale)
|
||||
yinvf = RecipesPipeline.inverse_scale_func(yscale)
|
||||
|
||||
x, y = copy(series[:x]), copy(series[:y])
|
||||
factor = 100
|
||||
for i in eachindex(x)
|
||||
if x[i] == -Inf
|
||||
x[i] = xl[1] - expansion_factor * (xl[2] - xl[1])
|
||||
x[i] = xinvf(xf(xl[1]) - expansion_factor * (xf(xl[2]) - xf(xl[1])))
|
||||
elseif x[i] == Inf
|
||||
x[i] = xl[2] + expansion_factor * (xl[2] - xl[1])
|
||||
x[i] = xinvf(xf(xl[2]) + expansion_factor * (xf(xl[2]) - xf(xl[1])))
|
||||
end
|
||||
end
|
||||
for i in eachindex(y)
|
||||
if y[i] == -Inf
|
||||
y[i] = yl[1] - expansion_factor * (yl[2] - yl[1])
|
||||
y[i] = yinvf(yf(yl[1]) - expansion_factor * (yf(yl[2]) - yf(yl[1])))
|
||||
elseif y[i] == Inf
|
||||
y[i] = yl[2] + expansion_factor * (yl[2] - yl[1])
|
||||
y[i] = yinvf(yf(yl[2]) + expansion_factor * (yf(yl[2]) - yf(yl[1])))
|
||||
end
|
||||
end
|
||||
return x, y
|
||||
|
||||
+25
-18
@@ -9,6 +9,7 @@ using LibGit2
|
||||
using GeometryTypes
|
||||
using Dates
|
||||
|
||||
include("test_axes.jl")
|
||||
include("test_hdf5plots.jl")
|
||||
include("test_pgfplotsx.jl")
|
||||
|
||||
@@ -47,26 +48,27 @@ img_tol = is_ci() ? 1e-2 : Sys.islinux() ? 1e-3 : 0.1
|
||||
|
||||
## Uncomment the following lines to update reference images for different backends
|
||||
|
||||
#=
|
||||
@testset "GR" begin
|
||||
image_comparison_facts(:gr, tol=img_tol, skip = Plots._backend_skips[:gr])
|
||||
end
|
||||
# @testset "GR" begin
|
||||
# image_comparison_facts(:gr, tol=img_tol, skip = Plots._backend_skips[:gr])
|
||||
# end
|
||||
#
|
||||
# plotly()
|
||||
# @testset "Plotly" begin
|
||||
# image_comparison_facts(:plotly, tol=img_tol, skip = Plots._backend_skips[:plotlyjs])
|
||||
# end
|
||||
#
|
||||
# pyplot()
|
||||
# @testset "PyPlot" begin
|
||||
# image_comparison_facts(:pyplot, tol=img_tol, skip = Plots._backend_skips[:pyplot])
|
||||
# end
|
||||
#
|
||||
# pgfplotsx()
|
||||
# @testset "PGFPlotsX" begin
|
||||
# image_comparison_facts(:pgfplotsx, tol=img_tol, skip = Plots._backend_skips[:pgfplotsx])
|
||||
# end
|
||||
|
||||
plotly()
|
||||
@testset "Plotly" begin
|
||||
image_comparison_facts(:plotly, tol=img_tol, skip = Plots._backend_skips[:plotlyjs])
|
||||
end
|
||||
# 10 Histogram2D
|
||||
|
||||
pyplot()
|
||||
@testset "PyPlot" begin
|
||||
image_comparison_facts(:pyplot, tol=img_tol, skip = Plots._backend_skips[:pyplot])
|
||||
end
|
||||
|
||||
pgfplotsx()
|
||||
@testset "PGFPlotsX" begin
|
||||
image_comparison_facts(:pgfplotsx, tol=img_tol, skip = Plots._backend_skips[:pgfplotsx])
|
||||
end
|
||||
=#
|
||||
##
|
||||
|
||||
@testset "Backends" begin
|
||||
@@ -177,4 +179,9 @@ end
|
||||
@test isequal(collect(zip(Plots.unzip(z)...)), z)
|
||||
@test isequal(collect(zip(Plots.unzip(GeometryTypes.Point.(z))...)), z)
|
||||
end
|
||||
op1 = Plots.process_clims((1.0, 2.0))
|
||||
op2 = Plots.process_clims((1, 2.0))
|
||||
data = randn(100, 100)
|
||||
@test op1(data) == op2(data)
|
||||
@test Plots.process_clims(nothing) == Plots.process_clims(missing) == Plots.process_clims(:auto)
|
||||
end
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
using Plots, Test
|
||||
|
||||
@testset "Showaxis" begin
|
||||
for value in Plots._allShowaxisArgs
|
||||
@test plot(1:5, showaxis = value)[1][:yaxis][:showaxis] isa Bool
|
||||
end
|
||||
@test plot(1:5, showaxis = :y)[1][:yaxis][:showaxis] == true
|
||||
@test plot(1:5, showaxis = :y)[1][:xaxis][:showaxis] == false
|
||||
end
|
||||
|
||||
@testset "Magic axis" begin
|
||||
@test plot(1, axis=nothing)[1][:xaxis][:ticks] == []
|
||||
@test plot(1, axis=nothing)[1][:yaxis][:ticks] == []
|
||||
end # testset
|
||||
+23
-3
@@ -71,7 +71,7 @@ end
|
||||
pl = scatter!(
|
||||
y,
|
||||
zcolor = abs.(y .- 0.5),
|
||||
m = (:heat, 0.8, Plots.stroke(1, :green)),
|
||||
m = (:hot, 0.8, Plots.stroke(1, :green)),
|
||||
ms = 10 * abs.(y .- 0.5) .+ 4,
|
||||
lab = ["grad", "", "ient"],
|
||||
)
|
||||
@@ -122,7 +122,7 @@ end
|
||||
plot(
|
||||
Plots.fakedata(100, 10),
|
||||
layout = 4,
|
||||
palette = [:grays :blues :heat :lightrainbow],
|
||||
palette = [:grays :blues :hot :rainbow],
|
||||
bg_inside = [:orange :pink :darkblue :black],
|
||||
)
|
||||
end # testset
|
||||
@@ -211,7 +211,7 @@ end
|
||||
marker_z = ((x, y) -> begin
|
||||
x + y
|
||||
end),
|
||||
color = :bluesreds,
|
||||
color = :bwr,
|
||||
legend = false,
|
||||
)
|
||||
plot(p1, p2)
|
||||
@@ -326,3 +326,23 @@ end
|
||||
# end
|
||||
end # testset
|
||||
end # testset
|
||||
|
||||
@testset "Extra kwargs" begin
|
||||
pl = plot(1:5, test = "me")
|
||||
@test pl[1][1].plotattributes[:extra_kwargs][:test] == "me"
|
||||
pl = plot(1:5, test = "me", extra_kwargs = :subplot)
|
||||
@test pl[1].attr[:extra_kwargs][:test] == "me"
|
||||
pl = plot(1:5, test = "me", extra_kwargs = :plot)
|
||||
@test pl.attr[:extra_plot_kwargs][:test] == "me"
|
||||
pl = plot(1:5, extra_kwargs = Dict(:plot => Dict(:test => "me"), :series => Dict(:and => "me too")))
|
||||
@test pl.attr[:extra_plot_kwargs][:test] == "me"
|
||||
@test pl[1][1].plotattributes[:extra_kwargs][:and] == "me too"
|
||||
pl = plot(
|
||||
plot(1:5, title="Line"),
|
||||
scatter(1:5, title="Scatter", extra_kwargs=Dict(:subplot=>Dict("axis line shift" => "10pt")))
|
||||
)
|
||||
Plots._update_plot_object(pl)
|
||||
axes = Plots.pgfx_axes(pl.o)
|
||||
@test !haskey(axes[1].options.dict, "axis line shift")
|
||||
@test haskey(axes[2].options.dict, "axis line shift")
|
||||
end # testset
|
||||
|
||||
Reference in New Issue
Block a user