Giter VIP home page Giter VIP logo

gadfly.jl's People

Contributors

amellnik avatar andreasnoack avatar aviks avatar bjarthur avatar darwindarak avatar dchudz avatar dcjones avatar garborg avatar github-actions[bot] avatar godisemo avatar iainnz avatar iblislin avatar inq avatar joehuchette avatar jverzani avatar keno avatar kleinschmidt avatar mattriks avatar mikeinnes avatar mortenpi avatar non-jedi avatar rikhuijzer avatar shashi avatar simleb avatar stefankarpinski avatar tbreloff avatar timholy avatar tlnagy avatar ulysses4ever avatar yuyichao avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gadfly.jl's Issues

ERROR: no method classify_data(DataArray{Float64,2},)

Hi!

I found this error on my latest Julia:

Julia Version 0.2.0-714.r1840
Commit 184054dcde 2013-03-24 16:23:04
Platform Info:
  OS_NAME: Linux
Using: (64-bit interface)
  Blas: libopenblas
  Lapack: libopenblas
  Libm: libopenlibm

Here the example I found when I tray to do a simple x,y scatterplot:

julia> data
91x2 DataFrame:
         contactos  rmsd
[1,]           0.0 0.073
[2,]           0.0 1.677
  :
[90,]         17.0 0.544
[91,]         18.0 0.479

julia> plot(data,{:x => "contactos", :y => "rmsd"},Geom.point)
Error showing value of type Plot:
ERROR: no method classify_data(DataArray{Float64,2},)
 in render at /home/dzea/.julia/Gadfly/src/Gadfly.jl:244
 in repl_show at repl.jl:12

Best!
P.S.: Maybe would be great have a simple default scatterplot version for a simple call like plot(x::Vector,y::Vector)

Attempts to use `spy` fail

perhaps due to operator error. What I tried was

julia> srand(1234321)

julia> A = sprand(3,10,0.2)
3x10 sparse matrix with 6 nonzeros:
    [1 ,  4]  =  0.958056
    [2 ,  4]  =  0.484397
    [3 ,  5]  =  0.805794
    [1 ,  9]  =  0.372153
    [1 , 10]  =  0.601021
    [2 , 10]  =  0.804712


julia> findn_nzs(A)
([1, 2, 3, 1, 1, 2],[4, 4, 5, 9, 10, 10],[0.958056, 0.484397, 0.805794, 0.372153, 0.601021, 0.804712])

julia> spy(A)
Error showing value of type Plot:
ERROR: The following aesthetics are required by Geom.bar but are not defined: x_max, y_min, y_max, x_min

 in assert_aesthetics_defined at /home/bates/.julia/Gadfly/src/aesthetics.jl:88
 in render at /home/bates/.julia/Gadfly/src/geometry.jl:296
 in render at /home/bates/.julia/Gadfly/src/Gadfly.jl:341
 in repl_show at repl.jl:12

Issue with Gadfly plot function not defined.

Hi, I installed Gadfly with Pkg.add("Gadfly") and this was done without a hitch, but when issuing using Gadfly:

WARNING: parse_int is deprecated, use parseint instead.
 in color at /Users/wardb/.julia/Compose/src/color.jl:1339
ERROR: no method Theme(RGB,SimpleMeasure{mm},SimpleMeasure{mm},RGB,RGB,RGB,SimpleMeasure{mm},ASCIIString,SimpleMeasure{mm},RGB,ASCIIString,SimpleMeasure{mm},RGB,ASCIIString,SimpleMeasure{mm},RGB,SimpleMeasure{mm},SimpleMeasure{mm},SimpleMeasure{mm},Function,Function,Int64,Float64,Float64,Float64)
 in include_from_node1 at loading.jl:91 (repeats 2 times)
 in reload_path at loading.jl:114
 in require at loading.jl:48
at /Users/wardb/.julia/Gadfly/src/theme.jl:115
at /Users/wardb/.julia/Gadfly/src/Gadfly.jl:55

is returned and typing plot in the REPL to see if the function is defined returns

julia> plot
ERROR: plot not defined

This means when I get to using plot() in the examples I can't go on.
There are no errors installing the package so I'm not sure why this is.

Best,
Ben.

Plot fit to screen

Another cosmetic, related with #26

If you can split a plot() function and a embed() fuction, or something similar.
Can be great if plot() fit to screen, and embed() still in the way there is, or maybe a little smaller [ some blogger's blog columns are a little more small than plot wide ].

latest 0.2 causes color to fail loading...

julia> using Gadfly
ERROR: could not open file /Users/swade/projects/julia/Color.jl
in include_from_node1 at loading.jl:91
in reload_path at loading.jl:114
in require at loading.jl:48
in include_from_node1 at loading.jl:91
in reload_path at loading.jl:114
in require at loading.jl:48
in include_from_node1 at loading.jl:91
in reload_path at loading.jl:114
in require at loading.jl:48
at /Users/swade/.julia/Compose/src/Compose.jl:2
at /Users/swade/.julia/Gadfly/src/Gadfly.jl:3

can't plot due to Iterator.Distinct missing?

julia> using Gadfly
julia> using RDatasets
julia> cars = data("ggplot2", "mpg") 
julia> p = plot(cars, x="hwy", y="cty", Geom.label, Geom.point)
Error showing value of type Plot:
ERROR: no method Distinct(ValueIterator{Dict{Symbol,ScaleElement}},)
 in render at /Users/swade/.julia/Gadfly/src/Gadfly.jl:398
 in show at /Users/swade/.julia/Gadfly/src/Gadfly.jl:464
 in repl_show at repl.jl:12 

Add Base.writemime methods for export

Would be great to add a writemime(io, ::@MIME("text/html"), p::Plot) method to render to HTML.

@loladiro and I got a simple version of this working a few days ago in IJulia, and it was pretty cool. (I don't have the code on this machine, though; I can get it tonight from my laptop if need be). Basically, it did three things:

  • At the beginning (when Gadfly is loaded?), do display("text/html", """<script src="http://d3js.org/d3.v3.min.js" charset="utf-8"></script>""") to load the D3 library from the web. Be sure to catch MethodErrors in case the current displays do not support HTML output. You may want an init_display(d::Display) = .... to do the same thing for an arbitrary Display in case the user wants to set up D3 on a new display later.
  • Add a writemime function to display a Plot as HTML: just a script tag with the Javascript, and a div element with a random ID.

This was all that was needed to get clickable, interactive Gadfly plots in IJulia. Some other enhancements:

  • You might want plot to call redisplay on the Plot automatically, which will queue the plot for display in IJulia. Your draw function can call display to request immediate drawing (and IJulia will automatically remove the Plot object from the redisplay queue in this case).

One slight annoyance in our mock-up was that if I did plot again in a later IJulia input cell, it somehow added the plot to the previous output rather than in the new output. Possibly I just screwed something up with the div tag. If you want something to happen automatically at the end of each (multiline) input cell, e.g. drawing any plots that weren't yet drawn, or setting something up so that subsequent cells will create separate plots, you can do it with:

if isdefined(Main,:IJulia)
    Main.IJulia.push_postexecute_hook(my_hook)
end

where my_hook() is a thunk function.

Color schemes

Summary of the discussion started at JuliaLang/julia#2278:

@pao wrote:

Picking good colors is an old problem, but see e.g. http://colorbrewer2.org/. Or perhaps port @timholy's MATLAB code up on File Exchange http://www.mathworks.us/matlabcentral/fileexchange/29702

@dcjones:

That's interesting. I have a lot of color spaces implemented, but haven't spent a lot of time on actually selecting colors. I'm just choosing equidistant hues in LAB space.

@timholy:

@dcjones, your algorithm sounds quite similar to the one I developed. The main difference possibly being that you can ask it to avoid the background (or multiple other "reserved" colors).

@dcjones:

You're also not fixing chroma and lightness like I am. It makes sense to vary only hue (or only lightness) to show quantitative data, but qualitative scales like this might benefit by choosing from a wider range of colors.

I might try adding colorbrewer's scales, but I tend to prefer algorithms to anything "hand curated". If anyone knowns of any papers on maximizing distinguishability with constraints for colorblindness (and maybe printability), I'd be interested.

@pao:

I didn't do a deep search to see what ColorBrewer is doing behind the scenes--I can't imagine those were all created by hand, but maybe they were? Penn State is mentioned in the footer, so there might be some publications.

@catawbasam:

Stephen D. Gardner, 2005, Evaluation of the ColorBrewer Color Schemes for Accommodation of Map Readers with Impaired Color Vision (6.1MB PDF)

Available from http://www.personal.psu.edu/cab38/

d3 backend x axis scaling breaks

The javascript output by draw(D3(...)) is generating bad x-axis scaling code for some data. I've attached some output from a recent plot. Here's an example scale function it generates:

.attr("cx", function(d) { return d[0] * 0 + 29.15; }) 

See data below:

var data = [
  [4927.0,4929.0,4930.0,4931.0,4932.0,4933.0,4936.0,4937.0,4942.0,4943.0,4944.0,4945.0,4946.0,4947.0,4948.0,4949.0,4950.0,4951.0,4952.0,4953.0,4954.0,4955.0,4956.0,4957.0,4958.0,4959.0,4960.0,4961.0,122759.0,122762.0,122766.0,122767.0,122772.0,122773.0,122774.0,122776.0,122778.0,122779.0,122780.0,122781.0,122782.0,122783.0,122784.0,122785.0,122786.0,122787.0,122788.0,122789.0,122790.0,122791.0,122794.0,122795.0,122796.0,122797.0,122798.0,122799.0,122800.0,122801.0,122802.0,122803.0,122804.0,122805.0,122806.0,122807.0,122808.0,122809.0,122810.0,122811.0,122812.0,122813.0,122814.0,122815.0,122816.0,122817.0,122818.0,122819.0,122820.0,122821.0,122822.0,122823.0,122824.0,122825.0,122826.0,122827.0,122830.0,122831.0,122832.0,122833.0,122834.0,122835.0,122836.0,122837.0,122838.0,122839.0,122840.0,122841.0,122842.0,122843.0,122844.0,122845.0,122846.0,122847.0,122848.0,122849.0,122850.0,122851.0,122852.0,122853.0,122854.0,122855.0,122856.0,122858.0,122859.0,122860.0,122861.0,122862.0,122863.0,122864.0,122865.0,122866.0,122867.0,122868.0,122869.0,122870.0,122871.0,122872.0,122873.0,122874.0,122875.0,122876.0,122877.0,122878.0,122879.0,122880.0,122881.0,122882.0,122883.0,122884.0,122885.0,122886.0,122887.0,122888.0,122889.0,122890.0,122891.0,122892.0,122893.0,122894.0,122895.0,122896.0,122897.0,122898.0,122901.0,122902.0,122906.0,122908.0,122909.0,122910.0,122911.0,122912.0,122913.0,122914.0,122915.0,122916.0,122917.0,122918.0,122919.0,122920.0,122921.0,122922.0,122923.0,122924.0,122925.0,122926.0,122927.0,122928.0,122929.0,122930.0,122931.0,122932.0,122933.0,122934.0,122935.0,122936.0,122937.0,122938.0,122939.0,122940.0,122941.0,122942.0,122943.0,122944.0,122945.0,122946.0,122947.0,122948.0,122949.0,122950.0,122951.0,122952.0,122953.0,122954.0,122955.0,122956.0,122957.0,122958.0,122959.0,122960.0,122961.0,122962.0,122963.0,122964.0,122966.0,122967.0,122968.0,122971.0,122972.0,122973.0,122974.0,122975.0,122976.0,122977.0,122978.0,122979.0,122980.0,122981.0,122982.0,122983.0,122984.0,122985.0,122986.0,122987.0,122988.0,122989.0,122990.0,122991.0,122992.0,122993.0,122994.0,122995.0,122996.0,122997.0,122998.0,122999.0,123000.0,123001.0,123002.0,123003.0,123004.0,123005.0,123006.0,123007.0,123008.0,123009.0,123010.0,123011.0,123012.0,123013.0,123014.0,123015.0,123016.0,123017.0,123018.0,123019.0,123020.0,123021.0,123024.0,123025.0,123029.0,123030.0,123031.0,123032.0,123033.0,123034.0,123035.0,123036.0,123037.0,123038.0,123039.0,123040.0,123041.0,123045.0,123046.0,123047.0,123048.0,123049.0,123050.0,123051.0,123052.0,123053.0,123054.0,123055.0,123056.0,123057.0,123058.0,123060.0,123061.0,123062.0,123063.0,123064.0,123065.0,123066.0,123067.0,123068.0,123069.0,123070.0,123071.0,123072.0,123076.0,123077.0,123078.0,123079.0,123080.0,123081.0,123082.0,123083.0,123084.0,123085.0,123086.0,123087.0,123088.0,123089.0],
  [339.0,600.0,600.0,600.0,600.0,600.0,554.0,554.0,615.0,615.0,615.0,615.0,615.0,615.0,615.0,615.0,615.0,615.0,615.0,615.0,615.0,615.0,615.0,615.0,615.0,615.0,615.0,615.0,653.0,725.0,720.0,720.0,718.0,718.0,718.0,723.0,790.0,790.0,790.0,790.0,790.0,790.0,790.0,790.0,790.0,790.0,790.0,790.0,790.0,790.0,782.0,782.0,782.0,782.0,782.0,782.0,782.0,782.0,782.0,782.0,782.0,782.0,782.0,782.0,782.0,782.0,782.0,782.0,782.0,782.0,782.0,782.0,782.0,782.0,782.0,782.0,782.0,782.0,782.0,782.0,782.0,782.0,782.0,782.0,840.0,840.0,840.0,840.0,840.0,840.0,840.0,840.0,840.0,840.0,840.0,840.0,840.0,840.0,840.0,840.0,840.0,840.0,840.0,840.0,840.0,840.0,840.0,840.0,840.0,840.0,840.0,832.0,832.0,832.0,832.0,832.0,832.0,832.0,832.0,832.0,832.0,832.0,832.0,832.0,832.0,832.0,832.0,832.0,832.0,832.0,832.0,832.0,832.0,832.0,832.0,832.0,832.0,832.0,832.0,832.0,832.0,832.0,832.0,832.0,832.0,832.0,832.0,832.0,832.0,832.0,832.0,832.0,750.0,750.0,770.0,714.0,714.0,714.0,714.0,714.0,714.0,714.0,714.0,714.0,714.0,714.0,714.0,714.0,714.0,714.0,714.0,714.0,714.0,714.0,714.0,714.0,714.0,714.0,714.0,714.0,714.0,714.0,714.0,714.0,714.0,714.0,714.0,714.0,714.0,714.0,714.0,714.0,714.0,714.0,714.0,714.0,714.0,714.0,714.0,714.0,714.0,714.0,714.0,714.0,714.0,714.0,714.0,714.0,714.0,714.0,714.0,714.0,770.0,770.0,770.0,815.0,815.0,815.0,815.0,815.0,815.0,815.0,815.0,815.0,815.0,815.0,815.0,815.0,815.0,815.0,815.0,815.0,815.0,815.0,815.0,815.0,815.0,815.0,815.0,815.0,815.0,815.0,815.0,815.0,815.0,815.0,815.0,815.0,815.0,815.0,815.0,815.0,815.0,815.0,815.0,815.0,815.0,815.0,815.0,815.0,815.0,815.0,815.0,815.0,815.0,815.0,820.0,820.0,838.0,838.0,838.0,838.0,838.0,838.0,838.0,838.0,838.0,838.0,838.0,838.0,838.0,843.0,843.0,843.0,843.0,843.0,843.0,843.0,843.0,843.0,843.0,843.0,843.0,843.0,843.0,843.0,843.0,843.0,843.0,843.0,843.0,843.0,843.0,843.0,843.0,843.0,843.0,843.0,838.0,838.0,838.0,838.0,838.0,838.0,838.0,843.0,843.0,843.0,843.0,843.0,843.0,843.0]];

show.html

Is show.html supposed to be checked in?

julia> p = plot([sin, cos], 0, 25)
ERROR: Error showing value of type Plot:
ErrorException("could not open file /home/viral/.julia/Compose/src/show.html")

julia> draw(SVG(6inch, 3inch), p)
ERROR: could not open file /home/viral/.julia/Compose/src/show.html
 in open at io.jl:281
 in open at io.jl:301
 in emitsvg at /home/viral/.julia/Compose/src/Compose.jl:360
 in emit at /home/viral/.julia/Compose/src/Compose.jl:350
 in finish at /home/viral/.julia/Compose/src/svg.jl:138
 in draw at /home/viral/.julia/Compose/src/canvas.jl:281
 in draw at /home/viral/.julia/Gadfly/src/Gadfly.jl:363

adding layers to existing plots with new mappings

Hi,

I managed to add additional gems but not mappings without an error:

julia> p = plot(mpg, x = "cty", y = "hwy", Geom.point)
julua> push!(p.layers, layer(Geom.line))
julia> push!(p.layers, layer(x = "displ", Geom.line)) 
ERROR: no method Dict((Symbol,ASCIIString),)

new sort api breaking gadfly :(

I had the same issue with my own code.

julia> plot(bbn, x = "score", Geom.bar)                                                                                                                    
WARNING: has(d,k) is deprecated, use haskey(d,k) instead.                                                                                                  
 in + at /Users/swade/.julia/Compose/src/measure.jl:184                                                                                                    
Error showing value of type Plot:                                                                                                                          
ERROR: no method sortby!(Function,Array{Canvas,1})                                                                                                         
 in layout_guides at /Users/swade/.julia/Gadfly/src/guide.jl:440                                                                                           
 in render at /Users/swade/.julia/Gadfly/src/Gadfly.jl:439                                                                                                 
 in draw at /Users/swade/.julia/Gadfly/src/Gadfly.jl:448                                                                                                   
 in show at /Users/swade/.julia/Gadfly/src/Gadfly.jl:464                                                                                                   
 in repl_show at repl.jl:12  

Problem moving tmp file under windows

Hello,

When I run the initial example (with iris) under windows with Julia 0.2 I get:


julia> p = plot(mammals,
                x="body", y="brain", label=1,
                Scale.x_log10, Scale.y_log10,
                Geom.label, Geom.point)
mv: cannot move `C:\\Users\\a158687\\AppData\\Local\\Temp\\jul3B20.tmp' to `C:\\Users\\a158687\\AppData\\Local\\Temp\\jul3B20.tmp.htm'
Error showing value of type Plot:
ERROR: failed process: Process(`mv 'C:\Users\a158687\AppData\Local\Temp\jul3B20.tmp' 'C:\Users\a158687\AppData\Local\Temp\jul3B20.tmp.htm'`,
 ProcessExited(1)) [1]
 in error at error.jl:22
 in pipeline_error at process.jl:426
 in run at process.jl:409
 in emitsvg at C:\Users\a158687\AppData\Roaming\julia\packages\Compose\src\Compose.jl:418
 in emit at C:\Users\a158687\AppData\Roaming\julia\packages\Compose\src\Compose.jl:403
 in finish at C:\Users\a158687\AppData\Roaming\julia\packages\Compose\src\svg.jl:162
 in draw at C:\Users\a158687\AppData\Roaming\julia\packages\Compose\src\canvas.jl:259
 in draw at C:\Users\a158687\AppData\Roaming\julia\packages\Gadfly\src\Gadfly.jl:448
 in show at C:\Users\a158687\AppData\Roaming\julia\packages\Gadfly\src\Gadfly.jl:464
 in repl_show at repl.jl:12

If I try to move the file by hand, I get the windows error message "can't move the file because it is open by julia-release-readline".

Then if I close julia I can move it and display it.

inexact error?

Hi, I'm getting this error trying to plot a line chart with 2185 points.

ERROR: InexactError()
in int at int.jl:469
in apply_statistic at /Users/swade/.julia/Gadfly/src/statistics.jl:230
in apply_statistics at /Users/swade/.julia/Gadfly/src/statistics.jl:28
in render at /Users/swade/.julia/Gadfly/src/Gadfly.jl:412
in draw at /Users/swade/.julia/Gadfly/src/Gadfly.jl:448
in anonymous at no file:62
in include_from_node1 at loading.jl:91
in process_options at client.jl:251
in _start at client.jl:321

Things currently wrong with panning/zooming.

  • Line size should be invariant.
  • Crosstalk with subplots or stacked plots. (Zooming one zooms them all.)
  • Zooming/panning works on categorial axis, which doesn't really make sense.
  • New grid lines and labels should be made if zooming causes the scale to dramatically change.
  • Plot serializations should be able to be modified so that the plot can be redrawn with the same viewport.

ERROR: in anonymous: ccall: could not find function pango_font_map_create_contex

I'm using Julia 0.1.2 c4b3649-WINNT-i686 on Windows 7...

julia> using Gadfly
ERROR: in anonymous: ccall: could not find function pango_font_map_create_contex
t in library libpangocairo-1.0
in anonymous at no file
in include_from_node1 at loading.jl:76
in include_from_node1 at loading.jl:76
in reload_path at loading.jl:96
in require at loading.jl:48
in include_from_node1 at loading.jl:76
in reload_path at loading.jl:96
in require at loading.jl:48
at C:\Users\marwick\AppData\Roaming\julia\packages\Compose\src\pango.jl:50

ERROR: no method emitsvg(ASCIIString,ASCIIString)

There is an error on plot() about the emitsvg() function.
This, for example, is at the run of the first example:

using RDatasets
using Gadfly
using Compose

iris = data("datasets", "iris")
julia> p = plot(iris,
                x="Sepal.Length", y="Sepal.Width",
                Geom.point)
WARNING: has(s::Set,x) is deprecated, use contains(s,x) instead.
 in plot at /home/dzea/.julia/v0.2/Gadfly/src/Gadfly.jl:146
WARNING: has(d,k) is deprecated, use haskey(d,k) instead.
 in next at /home/dzea/.julia/v0.2/Iterators/src/Iterators.jl:253
Error showing value of type Plot:
ERROR: no method emitsvg(ASCIIString,ASCIIString)
 in emit at /home/dzea/.julia/v0.2/Compose/src/Compose.jl:381
 in finish at /home/dzea/.julia/v0.2/Compose/src/svg.jl:156
 in draw at /home/dzea/.julia/v0.2/Compose/src/canvas.jl:259
 in repl_show at repl.jl:12

plotting histograms with different colors?

Sorry, this is more a question than an issue.

Is there some way to plot histograms with of different groups via color?

plot(df, x = "score", color = "target", Geom.bar)

This works for scatter plots

plot(df, x = "score", y = "duration", color = "target", Geom.point)

Error on loading

I suspect this is a dataframes issue, but...

julia> require("Gadfly"); using Gadfly
type error: typeassert: expected Union(Nothing,PooledDataVec{Color}), got RGB
 in convert at /home/tim/.julia/DataFrames/src/datavec.jl:908
 in BarGeometry at /home/tim/.julia/Gadfly/src/geometry.jl:174
 in load_now at util.jl:235
 in require at util.jl:185
 in load_now at util.jl:235
 in load_now at util.jl:247
 in require at util.jl:185
at /home/tim/.julia/Gadfly/src/geometry.jl:180

My dataframes is from this morning (12/20/2012).

Color scales break for values outside the range [0,1]

As an example:

a = [1 0; 0 -1];
spy(a)

produces the message:

2x2 Float64 Array:
 0.0  84.9155
 0.0   0.0   
LCHab(89.65484564198991,64.50213233873546,73.80278907072169)
LCHab(42.4991888680575,69.05056593967691,241.37123667176544)
Error showing value of type Plot:
ERROR: BoundsError()
 in copy! at array.jl:40
 in ref at array.jl:262
 in apply_statistic at /Users/bjohnson/.julia/Gadfly/src/statistics.jl:216
 in apply_statistics at /Users/bjohnson/.julia/Gadfly/src/statistics.jl:28
 in render at /Users/bjohnson/.julia/Gadfly/src/Gadfly.jl:320
 in repl_show at repl.jl:12

BoundsError in render

A couple examples:

spy([1 0; 0 1])

and

xpts = linspace(0,4pi,11)
df = DataFrame({"x" => xpts, "y" => sin(xpts)})
plot(df, {:x => "x", :y => "y"}, Geom.point, Geom.line)

Both lead to this error:

ERROR: BoundsError()
 in indexed_next at tuple.jl:21
 in render at /Users/bjohnson/.julia/Gadfly/src/guide.jl:263
 in render at /Users/bjohnson/.julia/Gadfly/src/Gadfly.jl:343
 in repl_show at repl.jl:12

simple tutorial convenience plot not working

julia> p = plot([sin, cos], 0, 25)
all columns in a DataFrame have to be the same length
in DataFrame at /home/nybbler/.julia/DataFrames/src/dataframe.jl:26
in DataFrame at /home/nybbler/.julia/DataFrames/src/dataframe.jl:247
in rbind at /home/nybbler/.julia/DataFrames/src/dataframe.jl:1099
in plot at /home/nybbler/.julia/Gadfly/src/Gadfly.jl:303

bad sha1

fatal: reference is not a tree: 9ff1728bedaacc4bf274de4fa9e33146a732983e
An invalid SHA1 hash seems to be registered for Gadfly. Please contact the package maintainer.

Pango-CRITICAL

julia> using Gadfly

(process:8202): Pango-CRITICAL **: PangoContext *pango_font_map_create_context(PangoFontMap *): assertion `fontmap != NULL'

I'm on Mountain Lion. If I ignore this warning then draw doesn't work. Is draw supposed to render an image that I can view?

Here is the output with a call to draw

julia> draw(SVG(6inch, 4inch), p)

(process:8202): Pango-CRITICAL **: PangoFont *pango_context_load_font(PangoContext *, const PangoFontDescription *): assertion `context != NULL' failed
Could not match font: {"Source Sans Pro,PT Sans,Helvetica Neue,Helvetica,sans 9.000000"}
 in match_font at /Users/Administrator/.julia/Compose/src/measure.jl:520
 in pango_set_font at /Users/Administrator/.julia/Compose/src/measure.jl:564
 in text_extents at /Users/Administrator/.julia/Compose/src/measure.jl:607
 in text_extents at /Users/Administrator/.julia/Compose/src/measure.jl:621
 in render at /Users/Administrator/.julia/Gadfly/src/geometry.jl:105
 in render at /Users/Administrator/.julia/Gadfly/src/Gadfly.jl:335
 in draw at /Users/Administrator/.julia/Gadfly/src/Gadfly.jl:414

vstack interface

I like the syntax plot([f, g], a, b) and find wish that vstack had the same interface:

Gadfly.vstack(ps::Vector{Plot}) = Gadfly.vstack(ps...)

It makes the calling a bit more verbose, but more consistent. Would you entertain adding and exporting this so vstack can be called without explicitly loading Compose?

ERROR:replacing module Compose when julia> using Gadfly

i Pkg.add("Gadfly") then using Gadfly. i get follows.... what could i do? Thank u.

julia> using Gadfly
Warning: replacing module Compose
Warning: New definition max(Measure...,) is ambiguous with max(Measure...,) at /Users/UnkcpZ/.julia/Compose/src/measure.jl:271.
Make sure max() is defined first.
Warning: New definition max(Measure...,) is ambiguous with max(Measure...,) at /Users/UnkcpZ/.julia/Compose/src/measure.jl:271.
Make sure max() is defined first.
Warning: New definition max(Measure...,) is ambiguous with max(Measure...,) at /Users/UnkcpZ/.julia/Compose/src/measure.jl:271.
Make sure max() is defined first.
Warning: New definition max(Measure...,) is ambiguous with max(Measure...,) at /Users/UnkcpZ/.julia/Compose/src/measure.jl:271.
Make sure max() is defined first.
Warning: New definition max(Measure...,) is ambiguous with max(Measure...,) at /Users/UnkcpZ/.julia/Compose/src/measure.jl:271.
Make sure max() is defined first.
Warning: Method definition fill(Any,) in module Compose at /Users/UnkcpZ/.julia/Compose/src/property.jl:136 overwritten in module Compose at /Users/UnkcpZ/.julia/Compose/src/property.jl:136.
ERROR: syntax: extra token after end of expression
in include_from_node1 at loading.jl:76
in reload_path at loading.jl:96
in require at loading.jl:48
in include_from_node1 at loading.jl:76
in reload_path at loading.jl:96
in require at loading.jl:48
in include_from_node1 at loading.jl:76
in include_from_node1 at loading.jl:76
in reload_path at loading.jl:96
in require at loading.jl:48
in include_from_node1 at loading.jl:76
in reload_path at loading.jl:96
in require at loading.jl:48
at /Users/UnkcpZ/.julia/Color/src/Color.jl:24

Can't use Gadfly on OSX 10.8 and Julia Version 0.2.0-1611.re2cc4676

julia> using Gadfly
Warning: Possible conflict in library symbol zlibVersion
Warning: Possible conflict in library symbol zlibCompileFlags
WARNING: parse_int is deprecated, use parseint instead.
 in color at /Users/Administrator/.julia/Compose/src/color.jl:1339
ERROR: no method Theme(RGB,SimpleMeasure{mm},SimpleMeasure{mm},RGB,RGB,RGB,SimpleMeasure{mm},ASCIIString,SimpleMeasure{mm},RGB,ASCIIString,SimpleMeasure{mm},RGB,ASCIIString,SimpleMeasure{mm},RGB,SimpleMeasure{mm},SimpleMeasure{mm},SimpleMeasure{mm},Function,Function,Int64,Float64,Float64,Float64)
 in include_from_node1 at loading.jl:91 (repeats 2 times)
 in reload_path at loading.jl:114
 in require at loading.jl:48
at /Users/Administrator/.julia/Gadfly/src/theme.jl:115
at /Users/Administrator/.julia/Gadfly/src/Gadfly.jl:55

Plot range

Not, sure if this is intentional, but consider the following:
screen shot 2013-07-23 at 5 28 22 pm
and
screen shot 2013-07-23 at 5 28 33 pm

In the first case when plotting from 3:5 everything is fine, but in the second case, plotting from 1:2, the part 0:1 is there even though it wasn't specified in the range. (This is the D3 backend if it matters)

Stack Overflow

Running the code in the overview,

julia> require("RDatasets")

julia> require("Gadfly")

julia> using RDatasets

julia> using Gadfly

julia> iris = data("datasets", "iris")

julia> using Compose

julia> draw(Gadfly.SVG("test.svg", 6inch, 4inch), p)
WARNING: push is deprecated, use push! instead.

error: stack overflow
 in push at /Users/aviks/.julia/Gadfly/src/misc.jl:30
 in push at /Users/aviks/.julia/Gadfly/src/misc.jl:31
 in push at /Users/aviks/.julia/Gadfly/src/misc.jl:31
.....<thousands of lines>
in push at /Users/aviks/.julia/Gadfly/src/misc.jl:31
 in push at /Users/aviks/.julia/Gadfly/src/misc.jl:31
 in assert_aesthetics_equal_length at /Users/aviks/.julia/Gadfly/src/aesthetics.jl:91
 in render at /Users/aviks/.julia/Gadfly/src/geometry.jl:54
 in render at /Users/aviks/.julia/Gadfly/src/Gadfly.jl:250
 in draw at /Users/aviks/.julia/Gadfly/src/Gadfly.jl:326

Running on a recent version of Julia from earlier today

Version 0.0.0+106751806.rbf80
Commit bf80fe56de (2013-01-09 16:55:52)

Docs: Some Issues

A couple of minor nits on the overview page

  • using Compose is required to import the draw, SVG, and inch symbols
  • the 2 argument SVG constructor seems no longer present. A filename is required.

The docs look awesome otherwise!

ERROR: syntax: malformed function argument

Hi,

Using julia 0.2.0-841.r472b, I have the following error when importing Gadfly :

julia> using Gadfly
ERROR: syntax: malformed function argument (keywords (= (:: bigendian Bool) #f))
 in include_from_node1 at loading.jl:92
 in reload_path at loading.jl:112
 in require at loading.jl:48
 in include_from_node1 at loading.jl:92
 in reload_path at loading.jl:112
 in require at loading.jl:48
 at /home/alex/.julia/Codecs/src/Codecs.jl:319
 at /home/alex/.julia/Gadfly/src/Gadfly.jl:2

repeated code causing an issue

At line 255 or so of Gadfly.jl you repeat a code chunk, likely some odd copy and paste. However, one is missing this: t = classify_data(getfield(plot.data, var)) and it causes an error:

julia> draw(SVG("/tmp/file.svg", 5inch, 5inch), p)
WARNING: add_each is deprecated, use add_each! instead.
WARNING: add_each is deprecated, use add_each! instead.
in render: t not defined
in render at /Users/verzani/.julia/Gadfly/src/Gadfly.jl:257
in draw at /Users/verzani/.julia/Gadfly/src/Gadfly.jl:407

Error message on Installation

checking how to hardcode library paths into programs... immediate
configure: creating ./config.lt
config.lt: creating libtool
checking for some Win32 platform... no
checking for pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for HARFBUZZ... no
no
checking for CoreText availability... no
checking for CAIRO... yes
checking which cairo font backends could be used... none
configure: Disabling cairo support
configure: error: *** Could not enable any backends.
*** Must have at least one backend to build Pango.
ERROR: failed process: Process(`/home/dzea/.julia/Cairo/deps/src/pango-1.32.6/configure LDFLAGS=-L/home/dzea/.julia/Cairo/deps/usr/lib CPPFLAGS=-I/home/dzea/.julia/Cairo/deps/usr/include --with-included-modules=yes --prefix=/home/dzea/.julia/Cairo/deps/usr`, ProcessExited(1)) [1]
 in pipeline_error at process.jl:388
 in run at process.jl:378
 in run at /home/dzea/.julia/BinDeps/src/BinDeps.jl:376
 in run at /home/dzea/.julia/BinDeps/src/BinDeps.jl:350
 in run at /home/dzea/.julia/BinDeps/src/BinDeps.jl:376
 in run at /home/dzea/.julia/BinDeps/src/BinDeps.jl:376
 in run at /home/dzea/.julia/BinDeps/src/BinDeps.jl:376
 in run at /home/dzea/.julia/BinDeps/src/BinDeps.jl:376
 in run at /home/dzea/.julia/BinDeps/src/BinDeps.jl:147
 in run at /home/dzea/.julia/BinDeps/src/BinDeps.jl:376
 in include_from_node1 at loading.jl:76
 in anonymous at no file:206
 in cd at file.jl:26
 in runbuildscript at pkg.jl:203
 in _resolve at pkg.jl:279
 in anonymous at no file:131
 in cd at file.jl:26
 in cd_pkgdir at pkg.jl:34
 in add at pkg.jl:112
 in add at pkg.jl:138
at /home/dzea/.julia/Cairo/deps/build.jl:79

julia> using Gadfly
ERROR: could not open file /home/dzea/Gadfly.jl
 in include_from_node1 at loading.jl:76
 in reload_path at loading.jl:96
 in require at loading.jl:48

Basic arithmetic issue

julia> 10.3 * 3
30.900000000000002

julia> 10.3 * 3 == 30.9
false

When I type 10.3 * 3 I get 30.900000000000002 instead of 30.9, I'm no expert but I don't get this when I type it into R and I suspect something is wrong.

Segmentation fault?

Hi,

Using a Macbook pro with Mountain Lion OS X, I cannot manage to get Gadly to work. Have I forgotten to install something? I receive the following messages:

julia> using Gadfly
Warning: Possible conflict in library symbol zlibVersion
Warning: Possible conflict in library symbol zlibCompileFlags
Fontconfig error: Cannot load default config file

julia> using Compose

julia> p = plot([sin, cos], 0, 25)
Segmentation fault: 11
logout

[Process completed]

I am new to Julia, so perhaps I am doing some simple mistake?

Edit: I am running Julia Version 0.1.1+111038832.r2e9c.dirty

Error in plot()

julia> using Gadfly

Warning: New definition getindex(DataArray{T,N},Union(BitArray{1},Array{Bool,1})) is ambiguous with getindex(DataArray{T<:Number,N},Union(Array{T,1},BitArray{1},Ranges{T})) at /home/amitm/.julia/DataFrames/src/dataarray.jl:339.
         Make sure getindex(DataArray{T<:Number,N},Union(BitArray{1},Array{Bool,1})) is defined first.
WARNING: expr(hd,a...) is deprecated, use Expr(hd,a...) instead.
Warning: using Base.Stat in module Stat conflicts with an existing identifier.

julia> using RDatasets

julia> iris = data("datasets", "iris")
WARNING: strcat is deprecated, use string instead.
150x6 DataFrame:
              Sepal.Length Sepal.Width Petal.Length Petal.Width     Species
[1,]        1          5.1         3.5          1.4         0.2    "setosa"
[2,]        2          4.9         3.0          1.4         0.2    "setosa"
[3,]        3          4.7         3.2          1.3         0.2    "setosa"
[4,]        4          4.6         3.1          1.5         0.2    "setosa"
[5,]        5          5.0         3.6          1.4         0.2    "setosa"
[6,]        6          5.4         3.9          1.7         0.4    "setosa"
[7,]        7          4.6         3.4          1.4         0.3    "setosa"
[8,]        8          5.0         3.4          1.5         0.2    "setosa"
[9,]        9          4.4         2.9          1.4         0.2    "setosa"
[10,]      10          4.9         3.1          1.5         0.1    "setosa"
[11,]      11          5.4         3.7          1.5         0.2    "setosa"
[12,]      12          4.8         3.4          1.6         0.2    "setosa"
[13,]      13          4.8         3.0          1.4         0.1    "setosa"
[14,]      14          4.3         3.0          1.1         0.1    "setosa"
[15,]      15          5.8         4.0          1.2         0.2    "setosa"
[16,]      16          5.7         4.4          1.5         0.4    "setosa"
[17,]      17          5.4         3.9          1.3         0.4    "setosa"
[18,]      18          5.1         3.5          1.4         0.3    "setosa"
[19,]      19          5.7         3.8          1.7         0.3    "setosa"
[20,]      20          5.1         3.8          1.5         0.3    "setosa"
  :
[131,]    131          7.4         2.8          6.1         1.9 "virginica"
[132,]    132          7.9         3.8          6.4         2.0 "virginica"
[133,]    133          6.4         2.8          5.6         2.2 "virginica"
[134,]    134          6.3         2.8          5.1         1.5 "virginica"
[135,]    135          6.1         2.6          5.6         1.4 "virginica"
[136,]    136          7.7         3.0          6.1         2.3 "virginica"
[137,]    137          6.3         3.4          5.6         2.4 "virginica"
[138,]    138          6.4         3.1          5.5         1.8 "virginica"
[139,]    139          6.0         3.0          4.8         1.8 "virginica"
[140,]    140          6.9         3.1          5.4         2.1 "virginica"
[141,]    141          6.7         3.1          5.6         2.4 "virginica"
[142,]    142          6.9         3.1          5.1         2.3 "virginica"
[143,]    143          5.8         2.7          5.1         1.9 "virginica"
[144,]    144          6.8         3.2          5.9         2.3 "virginica"
[145,]    145          6.7         3.3          5.7         2.5 "virginica"
[146,]    146          6.7         3.0          5.2         2.3 "virginica"
[147,]    147          6.3         2.5          5.0         1.9 "virginica"
[148,]    148          6.5         3.0          5.2         2.0 "virginica"
[149,]    149          6.2         3.4          5.4         2.3 "virginica"
[150,]    150          5.9         3.0          5.1         1.8 "virginica"


julia> p = plot(iris, {:x => "Sepal.Length", :y => "Sepal.Width"}, Geom.point)
Error showing value of type Plot:
ERROR: no method add_script(SVG,ASCIIString,Uint32)
 in apply_property at /home/amitm/.julia/Compose/src/svg.jl:429
 in push_property at /home/amitm/.julia/Compose/src/svg.jl:335
 in draw at /home/amitm/.julia/Compose/src/form.jl:136
 in drawpart at /home/amitm/.julia/Compose/src/canvas.jl:329
 in draw at /home/amitm/.julia/Compose/src/canvas.jl:280
 in repl_show at repl.jl:12

Trying to execute the sample from demo.md - running into the above problem.

Plot does not display in browser and draw gives error.

I am using Safari 6.0.2. Good news is that when I try the julia 0.1 mac binary, Pkg.add("Gadfly") goes through error-free (although it is amazing how many packages it pulls in).

I then try the simplest example from overview as a sanity check:
p = plot([sin, cos], 0, 25)

A Finder window opens up with a temp file, and a new browser tab opens up, but it is empty. Trying the draw command after plot leads to an error:

julia> draw(SVG(6inch, 3inch), p)
ERROR: draw not defined

Error trying to use Gadfly on master

Hi,

I am seeing the following error while trying to use Gadfly.
I am on the master branch of Julia.

               _
   _       _ _(_)_     |  A fresh approach to technical computing
  (_)     | (_) (_)    |  Documentation: http://docs.julialang.org
   _ _   _| |_  __ _   |  Type "help()" to list help topics
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 0.2.0-436.r8ddc
 _/ |\__'_|_|_|\__'_|  |  Commit 8ddc76db99 2013-03-11 08:16:33
|__/                   |

julia> Pkg.update()
Already up-to-date.

julia> using Gadfly
Warning: New definition getindex(DataArray{T,N},Union(BitArray{1},Array{Bool,1})) is ambiguous with getindex(DataArray{T<:Number,N},Union(BitArray{1},Array{T,1},Ranges{T})) at /home/amitm/.julia/DataFrames/src/dataarray.jl:339.
         Make sure getindex(DataArray{T<:Number,N},Union(BitArray{1},Array{Bool,1})) is defined first.
WARNING: expr(hd,a...) is deprecated, use Expr(hd,a...) instead.
ERROR: syntax: missing separator in array expression
 in include_from_node1 at loading.jl:92
 in include_from_node1 at loading.jl:92
 in reload_path at loading.jl:112
 in require at loading.jl:48
at /home/amitm/.julia/Gadfly/src/scale.jl:218
at /home/amitm/.julia/Gadfly/src/Gadfly.jl:376

ERROR: no method Theme(....)

Loading the package fails with

julia> using Gadfly
Warning: New definition
getindex(DataArray{T,N},Union(BitArray{1},Array{Bool,1})) at
/home/alex/.julia/DataFrames/src/dataarray.jl:342
  is ambiguous with 
getindex(DataArray{T<:Number,N},Union(BitArray{1},Array{T,1},Ranges{T}))
  at /home/alex/.julia/DataFrames/src/dataarray.jl:339.
  Make sure 
getindex(DataArray{T<:Number,N},Union(BitArray{1},Array{Bool,1}))
  is defined first.
  ERROR: no method Theme(RGB,SimpleMeasure{mm},SimpleMeasure{mm},RGB,RGB,RGB,SimpleMeasure{mm},ASCIIString,SimpleMeasure{mm},RGB,ASCIIString,SimpleMeasure{mm},RGB,ASCIIString,SimpleMeasure{mm},RGB,SimpleMeasure{mm},SimpleMeasure{mm},SimpleMeasure{mm},Function,Function,Int32,Float64,Float64,Float64)
  in include_from_node1 at loading.jl:92
  in include_from_node1 at loading.jl:92
  in reload_path at loading.jl:112
  in require at loading.jl:48
  at /home/alex/.julia/Gadfly/src/theme.jl:115
  at /home/alex/.julia/Gadfly/src/Gadfly.jl:55

Julia version : 0.2.0-845.r6123

Deselect point when mouse go out of the plot area

Hi!

This is cosmetic
Is you past over a point, the point is selected.
But is you go out of the plot area, the same point is still select.
Maybe can be great if go out of the plot area breaks the point selection in order to see again all the plot.

Thanks!

updated JSON interface

The JSON.jl package was recently updated to change its API a bit (see JuliaIO/JSON.jl#35). In particular:

  • parse is now JSON.parse
  • print_to_json is now JSON.print
  • to_json is now json

I'm hoping to push this to METADATA soon (as version 0.2), so you'll want to update your package.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.