From f74d6197486035007a3f664a2b8976dec5139ede Mon Sep 17 00:00:00 2001 From: Thomas Breloff Date: Thu, 4 Feb 2016 16:05:21 -0500 Subject: [PATCH] pgfplots supported --- src/Plots.jl | 5 --- src/backends/gr.jl | 8 ++--- src/backends/supported.jl | 66 +++++++++++++++++++++++++++++++++++++++ src/utils.jl | 2 +- 4 files changed, 71 insertions(+), 10 deletions(-) diff --git a/src/Plots.jl b/src/Plots.jl index 5c85dad6..8fbb37f9 100644 --- a/src/Plots.jl +++ b/src/Plots.jl @@ -121,11 +121,6 @@ export # spy, corrplot -# --------------------------------------------------------- - - -const IMG_DIR = Pkg.dir("Plots") * "/img/" - # --------------------------------------------------------- diff --git a/src/backends/gr.jl b/src/backends/gr.jl index 3b1488b2..77244e05 100644 --- a/src/backends/gr.jl +++ b/src/backends/gr.jl @@ -368,11 +368,11 @@ function gr_display(plt::Plot{GRPackage}, clear=true, update=true, diag = sqrt((viewport[2] - viewport[1])^2 + (viewport[4] - viewport[3])^2) charheight = max(0.018 * diag, 0.01) ticksize = 0.01 * (viewport[2] - viewport[1]) - GR.savestate() + # GR.savestate() GR.setlinewidth(1) GR.grid3d(xtick, 0, ztick, xmin, ymin, zmin, 2, 0, 2) GR.grid3d(0, ytick, 0, xmax, ymin, zmin, 0, 2, 0) - GR.restorestate() + # GR.restorestate() z = reshape(z, length(x) * length(y)) if p[:linetype] == :surface GR.setcolormap(GR.COLORMAP_COOLWARM) @@ -400,11 +400,11 @@ function gr_display(plt::Plot{GRPackage}, clear=true, update=true, diag = sqrt((viewport[2] - viewport[1])^2 + (viewport[4] - viewport[3])^2) charheight = max(0.018 * diag, 0.01) ticksize = 0.01 * (viewport[2] - viewport[1]) - GR.savestate() + # GR.savestate() GR.setlinewidth(1) GR.grid3d(xtick, 0, ztick, xmin, ymin, zmin, 2, 0, 2) GR.grid3d(0, ytick, 0, xmax, ymin, zmin, 0, 2, 0) - GR.restorestate() + # GR.restorestate() if p[:linetype] == :scatter3d haskey(p, :markercolor) && GR.setmarkercolorind(gr_getcolorind(p[:markercolor])) haskey(p, :markershape) && GR.setmarkertype(gr_markertype[p[:markershape]]) diff --git a/src/backends/supported.jl b/src/backends/supported.jl index 76b69c08..f10d75cc 100644 --- a/src/backends/supported.jl +++ b/src/backends/supported.jl @@ -630,3 +630,69 @@ supportedStyles(::GLVisualizePackage) = [:auto, :solid] #, :dash, :dot, :dashdot supportedMarkers(::GLVisualizePackage) = [:none, :auto, :ellipse] #, :rect, :diamond, :utriangle, :dtriangle, :cross, :xcross, :star5] #vcat(_allMarkers, Shape) supportedScales(::GLVisualizePackage) = [:identity] #, :log, :log2, :log10, :asinh, :sqrt] subplotSupported(::GLVisualizePackage) = false + +# -------------------------------------------------------------------------------------- + +supportedArgs(::PGFPlotsPackage) = [ + # :annotation, + # :axis, + # :background_color, + # :color_palette, + # :fillrange, + # :fillcolor, + # :fillalpha, + # :foreground_color, + # :group, + # :label, + # :layout, + # :legend, + # :linecolor, + # :linestyle, + # :linetype, + # :linewidth, + # :linealpha, + # :markershape, + # :markercolor, + # :markersize, + # :markeralpha, + # :markerstrokewidth, + # :markerstrokecolor, + # :markerstrokestyle, + # :n, + # :nbins, + # :nc, + # :nr, + # :pos, + # :smooth, + # :show, + # :size, + # :title, + # :windowtitle, + # :x, + # :xlabel, + # :xlims, + # :xticks, + # :y, + # :ylabel, + # :ylims, + # :yrightlabel, + # :yticks, + # :xscale, + # :yscale, + # :xflip, + # :yflip, + # :z, + # :tickfont, + # :guidefont, + # :legendfont, + # :grid, + # :surface + # :levels, + ] +supportedAxes(::PGFPlotsPackage) = [:auto, :left] +supportedTypes(::PGFPlotsPackage) = [:contour] #, :path, :scatter ,:steppre, :steppost, :sticks, :heatmap, :hexbin, :hist, :bar, :hline, :vline, :contour] +supportedStyles(::PGFPlotsPackage) = [:auto, :solid] #, :dash, :dot, :dashdot, :dashdotdot] +supportedMarkers(::PGFPlotsPackage) = [:none, :auto, :ellipse] #, :rect, :diamond, :utriangle, :dtriangle, :cross, :xcross, :star5] #vcat(_allMarkers, Shape) +supportedScales(::PGFPlotsPackage) = [:identity] #, :log, :log2, :log10, :asinh, :sqrt] +subplotSupported(::PGFPlotsPackage) = false + diff --git a/src/utils.jl b/src/utils.jl index 68d27cb3..b0980e14 100644 --- a/src/utils.jl +++ b/src/utils.jl @@ -445,7 +445,7 @@ function dumpSupportGraphs() for func in (supportGraphArgs, supportGraphTypes, supportGraphStyles, supportGraphMarkers, supportGraphScales, supportGraphAxes) plt = func() - png(IMG_DIR * "/supported/$(string(func))") + png(joinpath(Pkg.dir("ExamplePlots"), "docs", "examples", "img", "supported", "$(string(func))")) end end