added pyplot scales
@ -195,7 +195,7 @@ Keyword | Default | Type | Aliases
|
|||||||
`:markersize` | `6` | Series | `:markersizes`, `:ms`, `:msize`
|
`:markersize` | `6` | Series | `:markersizes`, `:ms`, `:msize`
|
||||||
`:nbins` | `100` | Series | `:nb`, `:nbin`, `:nbinss`
|
`:nbins` | `100` | Series | `:nb`, `:nbin`, `:nbinss`
|
||||||
`:reg` | `false` | Series | `:regression`, `:regs`
|
`:reg` | `false` | Series | `:regression`, `:regs`
|
||||||
`:ribbon` | `nothing` | Series | `:r`, `:ribbons`
|
`:ribbon` | `nothing` | Series | `:rib`, `:ribbons`
|
||||||
`:width` | `1` | Series | `:linewidth`, `:w`, `:widths`
|
`:width` | `1` | Series | `:linewidth`, `:w`, `:widths`
|
||||||
`:background_color` | `RGB{U8}(1.0,1.0,1.0)` | Plot | `:background`, `:bg`, `:bg_color`, `:bgcolor`
|
`:background_color` | `RGB{U8}(1.0,1.0,1.0)` | Plot | `:background`, `:bg`, `:bg_color`, `:bgcolor`
|
||||||
`:foreground_color` | `auto` | Plot | `:fg`, `:fg_color`, `:fgcolor`, `:foreground`
|
`:foreground_color` | `auto` | Plot | `:fg`, `:fg_color`, `:fgcolor`, `:foreground`
|
||||||
@ -211,10 +211,12 @@ Keyword | Default | Type | Aliases
|
|||||||
`:windowtitle` | `Plots.jl` | Plot | `:wtitle`
|
`:windowtitle` | `Plots.jl` | Plot | `:wtitle`
|
||||||
`:xlabel` | `` | Plot | `:xlab`
|
`:xlabel` | `` | Plot | `:xlab`
|
||||||
`:xlims` | `auto` | Plot | `:xlim`, `:xlimit`, `:xlimits`
|
`:xlims` | `auto` | Plot | `:xlim`, `:xlimit`, `:xlimits`
|
||||||
|
`:xscale` | `identity` | Plot |
|
||||||
`:xticks` | `auto` | Plot | `:xtick`
|
`:xticks` | `auto` | Plot | `:xtick`
|
||||||
`:ylabel` | `` | Plot | `:ylab`
|
`:ylabel` | `` | Plot | `:ylab`
|
||||||
`:ylims` | `auto` | Plot | `:ylim`, `:ylimit`, `:ylimits`
|
`:ylims` | `auto` | Plot | `:ylim`, `:ylimit`, `:ylimits`
|
||||||
`:yrightlabel` | `` | Plot | `:y2lab`, `:y2label`, `:ylab2`, `:ylabel2`, `:ylabelright`, `:ylabr`, `:yrlab`
|
`:yrightlabel` | `` | Plot | `:y2lab`, `:y2label`, `:ylab2`, `:ylabel2`, `:ylabelright`, `:ylabr`, `:yrlab`
|
||||||
|
`:yscale` | `identity` | Plot |
|
||||||
`:yticks` | `auto` | Plot | `:ytick`
|
`:yticks` | `auto` | Plot | `:ytick`
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
132
examples/scales.ipynb
Normal file
|
Before Width: | Height: | Size: 42 KiB After Width: | Height: | Size: 45 KiB |
|
Before Width: | Height: | Size: 6.7 KiB After Width: | Height: | Size: 7.3 KiB |
|
Before Width: | Height: | Size: 19 KiB After Width: | Height: | Size: 18 KiB |
BIN
img/supported/Plots.supportGraphScales.png
Normal file
|
After Width: | Height: | Size: 10 KiB |
|
Before Width: | Height: | Size: 9.6 KiB After Width: | Height: | Size: 9.5 KiB |
|
Before Width: | Height: | Size: 19 KiB After Width: | Height: | Size: 18 KiB |
@ -14,6 +14,10 @@
|
|||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
## Supported scales
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
## Supported axes
|
## Supported axes
|
||||||
|
|
||||||

|

|
||||||
|
|||||||
@ -49,14 +49,14 @@ supportedArgs(::PyPlotPackage) = [
|
|||||||
:ylims,
|
:ylims,
|
||||||
:yrightlabel,
|
:yrightlabel,
|
||||||
:yticks,
|
:yticks,
|
||||||
# :xscale,
|
:xscale,
|
||||||
# :yscale,
|
:yscale,
|
||||||
]
|
]
|
||||||
supportedAxes(::PyPlotPackage) = _allAxes
|
supportedAxes(::PyPlotPackage) = _allAxes
|
||||||
supportedTypes(::PyPlotPackage) = [:none, :line, :path, :step, :stepinverted, :sticks, :scatter, :heatmap, :hexbin, :hist, :bar, :hline, :vline]
|
supportedTypes(::PyPlotPackage) = [:none, :line, :path, :step, :stepinverted, :sticks, :scatter, :heatmap, :hexbin, :hist, :bar, :hline, :vline]
|
||||||
supportedStyles(::PyPlotPackage) = [:auto, :solid, :dash, :dot, :dashdot]
|
supportedStyles(::PyPlotPackage) = [:auto, :solid, :dash, :dot, :dashdot]
|
||||||
supportedMarkers(::PyPlotPackage) = [:none, :auto, :rect, :ellipse, :diamond, :utriangle, :dtriangle, :cross, :xcross, :star1, :hexagon]
|
supportedMarkers(::PyPlotPackage) = [:none, :auto, :rect, :ellipse, :diamond, :utriangle, :dtriangle, :cross, :xcross, :star1, :hexagon]
|
||||||
supportedScales(::PyPlotPackage) = [:identity]
|
supportedScales(::PyPlotPackage) = [:identity, :log, :log2, :log10]
|
||||||
subplotSupported(::PyPlotPackage) = false
|
subplotSupported(::PyPlotPackage) = false
|
||||||
|
|
||||||
# convert colorant to 4-tuple RGBA
|
# convert colorant to 4-tuple RGBA
|
||||||
@ -326,9 +326,21 @@ function updatePlotItems(plt::Plot{PyPlotPackage}, d::Dict)
|
|||||||
haskey(d, :xticks) && addPyPlotTicks(d[:xticks], true)
|
haskey(d, :xticks) && addPyPlotTicks(d[:xticks], true)
|
||||||
haskey(d, :yticks) && addPyPlotTicks(d[:yticks], false)
|
haskey(d, :yticks) && addPyPlotTicks(d[:yticks], false)
|
||||||
|
|
||||||
|
# scales
|
||||||
|
ax = getLeftAxis(fig)
|
||||||
|
haskey(d, :xscale) && applyPyPlotScale(ax, d[:xscale], true)
|
||||||
|
haskey(d, :yscale) && applyPyPlotScale(ax, d[:yscale], false)
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function applyPyPlotScale(ax, scaleType::Symbol, isx::Bool)
|
||||||
|
func = ax[isx ? :set_xscale : :set_yscale]
|
||||||
|
scaleType == :identity && return func("linear")
|
||||||
|
scaleType == :log && return func("log", basex = e, basey = e)
|
||||||
|
scaleType == :log2 && return func("log", basex = 2, basey = 2)
|
||||||
|
scaleType == :log10 && return func("log", basex = 10, basey = 10)
|
||||||
|
warn("Unhandled scaleType: ", scaleType)
|
||||||
|
end
|
||||||
|
|
||||||
# -----------------------------------------------------------------
|
# -----------------------------------------------------------------
|
||||||
|
|
||||||
|
|||||||