Questions tagged [gadfly]

Gadfly is plotting package for the Julia programming language.

"Gadfly is a system for plotting and visualization based largely on Hadley Wickhams's ggplot2 for R, and Leland Wilkinson's book The Grammar of Graphics."

It is built upon Julia programming language

100 questions
1
vote
1 answer

Julia Gadfly's Geom.bar fails when given horizontal orientation argument but works fine with vertical - is this a bug or am I missing something?

I am passing a "dict-of-counts" style dataframe to Gadfly to make a barplot. The output is as expected when I use the vertical orientation, but it breaks when I use horizontal. Am I misunderstanding something or should I file a quick issue report?…
1
vote
1 answer

How to order a categorical variable in a boxplot using the Julia package Gadfly

Gadfly does not seem to use the (level) order of categorical variables: using CSV using DataFrames using Gadfly using HTTP url = "https://raw.githubusercontent.com/mwaskom/seaborn-data/master/tips.csv" tips = CSV.File(HTTP.get(url).body) |>…
René
  • 4,594
  • 5
  • 23
  • 52
1
vote
1 answer

Horizontal line in Gadfly

I am using Gadfly.jl in order to plot my function. I try to add a horizontal line by passing the Geom.hline argument. However, I am getting an error: Couldn't process recipe args: (typeof(f), Int64, Float64, Gadfly.Geom.HLineGeometry) What am I…
Yorgos
  • 183
  • 10
1
vote
1 answer

The range of horizontal axis in Gadfly

I use the following code to produce a graph in Julia with Gadfly: using Gadfly, Cairo, Fontconfig p = plot(sin, 0, pi) p |> PNG("sin_pi.png", 6inch, 4inch) This is the graph that I get: The horizontal axis is not adjusted properly since there is a…
Cm7F7Bb
  • 307
  • 2
  • 9
1
vote
3 answers

How to easily plot background vertical bands?

In Stata I can easily add bands in the background, e.g. to signal a period of recession: clear set obs 2 gen year = 1990 replace year = 2000 if _n == 2 gen x = 0 replace x = 1 if _n == 2 twoway /// (scatteri 1 `=' 1995 1 `=' 1996, bcolor(gs10)…
miguelmorin
  • 5,025
  • 4
  • 29
  • 64
1
vote
1 answer

Gadfly (Julia): how to add text annotation to a plot?

In Stata I can add text to a plot at given coordinates, e.g.: clear set obs 10 gen x = rnormal() gen y = rnormal() twoway scatter y x, text(0.8 0.8 "Some text") The result is "Some text" at coordinates (0.8, 0.8): I want to add a similar…
miguelmorin
  • 5,025
  • 4
  • 29
  • 64
1
vote
0 answers

Interact Slider missing in plot

While using both Interact and Gadfly packages in Julia, the sliders which are supposed to appear (coming from Interact) in the plots don't show up. Here's an example of code: using Gadfly using Interact set_default_plot_size(15cm, 15cm) f(x)= e^x x…
Miguel
  • 89
  • 5
1
vote
1 answer

InexactError thrown by Gadfly depending on order of values

I'm new to julia and I'm trying to plot a function over a range of values that I defined myself with Gadfly. The function itself is pretty simple. function metropolis(dU, b) if dU < 0 1 else exp(-dU * b) end end When I…
Max Linke
  • 1,705
  • 2
  • 18
  • 24
1
vote
1 answer

Adding multiple layers in Julia Gadfly plot with loops

I'm trying to plot multiple layers in Gadfly plot with a pattern as following: p=plot(yintercept=[0,1,2,3],Geom.hline(color=colorant"darkgray", size=0pt), [ layer( x=locs, y=BS[:,i]+1-1, Geom.line,Theme(default_color=colorant"red") ) for i in…
Wenlong
  • 13
  • 5
1
vote
1 answer

Gadfly, new Color/Layer

When I push new layer to an existing plot, it keeps the same color. Is there a way to change the color automatically when a new layer is pushed to a plot, or at least a way to set the color using a random number (I don't know in advance how many…
Issam T.
  • 1,677
  • 1
  • 14
  • 32
1
vote
1 answer

Confusing error when updating packages in Julia 0.5.0

When attempting to update the installed packages on my Windows 10 laptop with Julia 0.5.0 installed, the following error appeared with regard to Rmath: C:\Users\CaitlinG>julia -e "Pkg.update()" INFO: Updating METADATA... INFO: Updating cache of…
CaitlinG
  • 1,955
  • 3
  • 25
  • 35
1
vote
1 answer

Error using Gadfly package in Julia

I am very new to Julia. I have tried a sample code posted in Julia site which uses Gadfly to demonstrate plotting. However, it gives me the below error. I believe that all the dependent packages were installed. Code: Pkg.add("Gadfly") using…
N Raghu
  • 706
  • 4
  • 13
  • 26
1
vote
1 answer

Gadfly: open stacked plots directly in browser?

With Gadfly it is possible to combine plots in a grid and save the combined plot in a file: using Gadfly, Compose x=1:0.1:5; grid = Array(Compose.Context, (2, 2)); grid[1,1] = render(plot( x=x, y = x, Geom.line)); grid[1,2] = render(plot( x=x, y =…
esel
  • 901
  • 9
  • 20
1
vote
1 answer

Remove automatically generated color key in Gadfly plot?

I'm just starting out with Julia and trying to create a simple sin/cos plot using Gadfly. It all works well, however for some reason Gadfly insists on inserting its own Color... f1 f2 legends into the plot (see the red-outlined portion in the…
sigint
  • 1,842
  • 1
  • 22
  • 27
1
vote
1 answer

How to change the Colors in rectbin plot in Gadfly?

I am using Gadfly to plot a rectbin in Julia ticks = [2006,2007,2008,2009,2010,2011,2012,2013,2014,2015] plot(y=c[1:100],x=y[1:100], Guide.ylabel("Countries"), Guide.xlabel("Year"),Guide.title("GDP of Asian Countries from…
MontyPython
  • 2,906
  • 11
  • 37
  • 58