Contourplots using Matplotlib, DataFrames, Pycall

Previous Topic Next Topic
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

Contourplots using Matplotlib, DataFrames, Pycall


Hi all,

I tried Julia for Data-Analysis of neutron scattering data and everything works fine, but I can't figure out how to pass the data to matplotlib's contour(x,y,z,...).

The data is stored in a DataFrame, say
dataset = df( x = Float64[],y = Float64[],z = Float64[],Counts = Float64[],Error = Float64[])

And I want a 2D contour plot with x and z for axis, and the respective counts determines the colour of the datapoint.

The Data I have might not be complete (couple of NaNs, or nothing at all), but it already is on a regular grid. The values of the grid are determined by
xbin = [start:steps:stop]
= [start:steps:stop]

I understand that normally you use matplotlib.mlab.griddata() to reorder your data to a grid / zi value, but I am too new to Python (never actually used it, rather Matlab) to figure out the proper format / type of vectors to pass it.
using PyCall
@pyimport matplotlib.mlab as ml
= ml.griddata(dataset[:x],dataset[:z],dataset[:Counts],xbin,zbin)

Could you please help :) Thanks! Max

You received this message because you are subscribed to the Google Groups "julia-stats" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit