Plotting with DateTime fails with NoMethod error #462

Closed
danluu opened this Issue Oct 15, 2014 · 6 comments

Projects

None yet

4 participants

@danluu
danluu commented Oct 15, 2014

This is with .3, fetched from 0.3-release and with updated packages from about 30 minutes before filing this issue (0.3.2-pre+55).

I have a dataframe with DateTime objects and Ints

23798x3 DataFrame
| Row   | x                   | y  | label     |
|-------|---------------------|----|-----------|
| 1     | 2014-09-17T13:54:00 | 5  | "Players" |
...

If I try to plot this with

julia> plot(df, x = :x, y = :y, color=:label, Geom.line)

I get

Error showing value of type Plot:
ERROR: `one` has no method matching one(::Type{DateTime})

This also fails the same way with this simplified code:

using Dates
using DataFrames
using Gadfly

a = [unix2datetime(100)]
b = [10]

df = DataFrame(x=a, y=b, label="wat")
plot(df, x=:x, y=:y, Geom.point)

As far as I can tell, I'm doing the same thing as #189.

@swadey
swadey commented Oct 25, 2014

seeing exactly the same issue with Bars

@danluu
danluu commented Oct 25, 2014

@swadey BTW, if you need a quick workaround for this, converting to unix time and plotting against that works, if you don't mind either having huge numbers as x-labels or fixing up the x-labels.

@swadey
swadey commented Oct 25, 2014

Yeah, I’ve been converting to string so that I can preserve the format of xlabels.

thanks,
wade

On Oct 25, 2014, at 2:27 PM, Dan Luu notifications@github.com wrote:

@swadey BTW, if you need a quick workaround for this, converting to unix time and plotting against that works, if you don't mind either having huge numbers as x-labels or fixing up the x-labels.


Reply to this email directly or view it on GitHub.

@danluu
danluu commented Dec 29, 2014

To follow up with a discussion on the mailing list with @StefanKarpinski, this fails with the current .3 release binary (not the nightly). There's also an odd bug in the current release's make that causes a -bash command not found to pop up, but that should probably be separate bug in julia base.

Editing to update: on a second build after a make cleanall, I didn't get the -bash command not found on building, so not sure what that's about.

@ihnorton

Ping @quinnj

@dcjones
Collaborator
dcjones commented Dec 30, 2014

This isn't exactly a regression or bug. There was only ever support for plotting Date, which I never got around to extending to DateTime.

The cryptic error message is really unfortunate. I need to figure out a better way of reporting a type as "unplottable" without it just failing mysteriously.

I'm working on adding DateTime support now.

@dcjones dcjones added a commit that closed this issue Dec 30, 2014
@dcjones dcjones DateTime support. Fixes #462 1dfebcc
@dcjones dcjones closed this in 1dfebcc Dec 30, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment