Plot data like MATLAB or PyLab
Hi,
MATLAB and PyLab have some amazing commands such as plot() that will
make a nice plot of some data. I'm porting my work from these
environments into Max/MSP/Jitter to do live audio analysis rather
than to work with sound files. I was wondering if there is a Jitter
quivalent of plot()?
Let me exemplify:
I've created a matrix that contain 5 times 11 float32s. These are 5
functions that have generated 11 values each for the x-values 0 to
10. I would like to see these graphs on my screen using jit.window
Another example: I've got one function that creats a list of 11
floats. I want to put them in a matrix and visualize the change of
these values over time.
How can I plot both/either the 5 functions and/or the list of floats
over time? What are the most common way of doing this?
Cheers
Nik
Try using OpenGL. There's jit.gl.graph, jit.gl.mesh, and
jit.gl.sketch which could all do the job depending on your situation.
wes
On 6/3/07, Niklas Saers wrote:
> Hi,
> MATLAB and PyLab have some amazing commands such as plot() that will
> make a nice plot of some data. I'm porting my work from these
> environments into Max/MSP/Jitter to do live audio analysis rather
> than to work with sound files. I was wondering if there is a Jitter
> quivalent of plot()?
>
> Let me exemplify:
> I've created a matrix that contain 5 times 11 float32s. These are 5
> functions that have generated 11 values each for the x-values 0 to
> 10. I would like to see these graphs on my screen using jit.window
>
> Another example: I've got one function that creats a list of 11
> floats. I want to put them in a matrix and visualize the change of
> these values over time.
>
> How can I plot both/either the 5 functions and/or the list of floats
> over time? What are the most common way of doing this?
>
> Cheers
>
> Nik
>
Hi Wes,
thanks for the tip. I've tried googling on these and Tutorial as I
only can find jit.gl.sketch in the Jitter Tutorial that comes with
Jitter. Do you have any examples on how these objects have been used
to plot graphs? A link or example patch?
Sincerely yours
Nik
On Jun 3, 2007, at 6:56 PM, Wesley Smith wrote:
> Try using OpenGL. There's jit.gl.graph, jit.gl.mesh, and
> jit.gl.sketch which could all do the job depending on your situation.
>
> wes
>
> On 6/3/07, Niklas Saers wrote:
>> Hi,
>> MATLAB and PyLab have some amazing commands such as plot() that will
>> make a nice plot of some data. I'm porting my work from these
>> environments into Max/MSP/Jitter to do live audio analysis rather
>> than to work with sound files. I was wondering if there is a Jitter
>> quivalent of plot()?
>>
>> Let me exemplify:
>> I've created a matrix that contain 5 times 11 float32s. These are 5
>> functions that have generated 11 values each for the x-values 0 to
>> 10. I would like to see these graphs on my screen using jit.window
>>
>> Another example: I've got one function that creats a list of 11
>> floats. I want to put them in a matrix and visualize the change of
>> these values over time.
>>
>> How can I plot both/either the 5 functions and/or the list of floats
>> over time? What are the most common way of doing this?
>>
>> Cheers
>>
>> Nik
>>
have you tried looking at the help files? jit.gl.graph should be self
explanatory, jit.gl.mesh just takes 3D coordinates which you can set
to construct a graph from data.
wes
On 6/3/07, Niklas Saers wrote:
> Hi Wes,
> thanks for the tip. I've tried googling on these and Tutorial as I
> only can find jit.gl.sketch in the Jitter Tutorial that comes with
> Jitter. Do you have any examples on how these objects have been used
> to plot graphs? A link or example patch?
>
> Sincerely yours
>
> Nik
>
> On Jun 3, 2007, at 6:56 PM, Wesley Smith wrote:
>
> > Try using OpenGL. There's jit.gl.graph, jit.gl.mesh, and
> > jit.gl.sketch which could all do the job depending on your situation.
> >
> > wes
> >
> > On 6/3/07, Niklas Saers wrote:
> >> Hi,
> >> MATLAB and PyLab have some amazing commands such as plot() that will
> >> make a nice plot of some data. I'm porting my work from these
> >> environments into Max/MSP/Jitter to do live audio analysis rather
> >> than to work with sound files. I was wondering if there is a Jitter
> >> quivalent of plot()?
> >>
> >> Let me exemplify:
> >> I've created a matrix that contain 5 times 11 float32s. These are 5
> >> functions that have generated 11 values each for the x-values 0 to
> >> 10. I would like to see these graphs on my screen using jit.window
> >>
> >> Another example: I've got one function that creats a list of 11
> >> floats. I want to put them in a matrix and visualize the change of
> >> these values over time.
> >>
> >> How can I plot both/either the 5 functions and/or the list of floats
> >> over time? What are the most common way of doing this?
> >>
> >> Cheers
> >>
> >> Nik
> >>
>
>
Hi again Wes,
thank you very much for your answers. Yes, I have had a good look at
the helpfiles and experimented a little with them. The reason I ask
is that I don't have the OpenGL skills to make this as my work has
mainly been revolving MSP and Java, and I need something to make a
plot. An example could be the brightness plot below. If there are
some examples on actual graphs, then I could use or modify them as a
starting point and gradually learn GL.
The jit.gl.graph help file uses jit.catch~ to capture audio. I
already have a list of floats, being coordinates in a graph. I would
like to draw a line between them much like is done in the brightness
graph attached. Based on the example I used jit.fill to fill a matrix
but ended up with nothing displayed and not really understanding what
I was doing. ;-) So yes, I did look at the help files before I went
to Google, but I'm not quite sure where to go from here.
Since Max so long has been attached to all kinds of MIDI and serial
devices to measure stuff I'm fairly sure I can't be the first to want
to plot some data, so if your or anyone else on the list knows of any
examples or tutorials I could follow I would be very grateful for
your tips. :-)
Cheers
Nik
On Jun 3, 2007, at 11:07 PM, Wesley Smith wrote:
> have you tried looking at the help files? jit.gl.graph should be self
> explanatory, jit.gl.mesh just takes 3D coordinates which you can set
> to construct a graph from data.
>
> wes
>
> On 6/3/07, Niklas Saers wrote:
>
>> Hi Wes,
>> thanks for the tip. I've tried googling on these and Tutorial as I
>> only can find jit.gl.sketch in the Jitter Tutorial that comes with
>> Jitter. Do you have any examples on how these objects have been used
>> to plot graphs? A link or example patch?
>>
>> Sincerely yours
>>
>> Nik
>>
>> On Jun 3, 2007, at 6:56 PM, Wesley Smith wrote:
>>
>> > Try using OpenGL. There's jit.gl.graph, jit.gl.mesh, and
>> > jit.gl.sketch which could all do the job depending on your
>> situation.
>> >
>> > wes
>> >
>> > On 6/3/07, Niklas Saers wrote:
>> >> Hi,
>> >> MATLAB and PyLab have some amazing commands such as plot() that
>> will
>> >> make a nice plot of some data. I'm porting my work from these
>> >> environments into Max/MSP/Jitter to do live audio analysis rather
>> >> than to work with sound files. I was wondering if there is a
>> Jitter
>> >> quivalent of plot()?
>> >>
>> >> Let me exemplify:
>> >> I've created a matrix that contain 5 times 11 float32s. These
>> are 5
>> >> functions that have generated 11 values each for the x-values 0 to
>> >> 10. I would like to see these graphs on my screen using jit.window
>> >>
>> >> Another example: I've got one function that creats a list of 11
>> >> floats. I want to put them in a matrix and visualize the change of
>> >> these values over time.
>> >>
>> >> How can I plot both/either the 5 functions and/or the list of
>> floats
>> >> over time? What are the most common way of doing this?
>> >>
>> >> Cheers
>> >>
>> >> Nik
>> >>
>>
>>
>>
>
Here's what I would do:
Use jit.expr to make x-coordinates for your plot and set your data as
y coordinates with the z coordinate as 0. This is all in a 3 plane
float32 matrix. Render it with jit.gl.mesh @draw_mode line_strips.
wes
On 6/3/07, Niklas Saers wrote:
> Hi again Wes,
> thank you very much for your answers. Yes, I have had a good look at
> the helpfiles and experimented a little with them. The reason I ask
> is that I don't have the OpenGL skills to make this as my work has
> mainly been revolving MSP and Java, and I need something to make a
> plot. An example could be the brightness plot below. If there are
> some examples on actual graphs, then I could use or modify them as a
> starting point and gradually learn GL.
>
>
>
>
> The jit.gl.graph help file uses jit.catch~ to capture audio. I
> already have a list of floats, being coordinates in a graph. I would
> like to draw a line between them much like is done in the brightness
> graph attached. Based on the example I used jit.fill to fill a matrix
> but ended up with nothing displayed and not really understanding what
> I was doing. ;-) So yes, I did look at the help files before I went
> to Google, but I'm not quite sure where to go from here.
>
> Since Max so long has been attached to all kinds of MIDI and serial
> devices to measure stuff I'm fairly sure I can't be the first to want
> to plot some data, so if your or anyone else on the list knows of any
> examples or tutorials I could follow I would be very grateful for
> your tips. :-)
>
> Cheers
>
> Nik
>
> On Jun 3, 2007, at 11:07 PM, Wesley Smith wrote:
>
>
> > have you tried looking at the help files? jit.gl.graph should be self
> > explanatory, jit.gl.mesh just takes 3D coordinates which you can set
> > to construct a graph from data.
> >
> > wes
> >
> > On 6/3/07, Niklas Saers wrote:
> >
> >> Hi Wes,
> >> thanks for the tip. I've tried googling on these and Tutorial as I
> >> only can find jit.gl.sketch in the Jitter Tutorial that comes with
> >> Jitter. Do you have any examples on how these objects have been used
> >> to plot graphs? A link or example patch?
> >>
> >> Sincerely yours
> >>
> >> Nik
> >>
> >> On Jun 3, 2007, at 6:56 PM, Wesley Smith wrote:
> >>
> >> > Try using OpenGL. There's jit.gl.graph, jit.gl.mesh, and
> >> > jit.gl.sketch which could all do the job depending on your
> >> situation.
> >> >
> >> > wes
> >> >
> >> > On 6/3/07, Niklas Saers wrote:
> >> >> Hi,
> >> >> MATLAB and PyLab have some amazing commands such as plot() that
> >> will
> >> >> make a nice plot of some data. I'm porting my work from these
> >> >> environments into Max/MSP/Jitter to do live audio analysis rather
> >> >> than to work with sound files. I was wondering if there is a
> >> Jitter
> >> >> quivalent of plot()?
> >> >>
> >> >> Let me exemplify:
> >> >> I've created a matrix that contain 5 times 11 float32s. These
> >> are 5
> >> >> functions that have generated 11 values each for the x-values 0 to
> >> >> 10. I would like to see these graphs on my screen using jit.window
> >> >>
> >> >> Another example: I've got one function that creats a list of 11
> >> >> floats. I want to put them in a matrix and visualize the change of
> >> >> these values over time.
> >> >>
> >> >> How can I plot both/either the 5 functions and/or the list of
> >> floats
> >> >> over time? What are the most common way of doing this?
> >> >>
> >> >> Cheers
> >> >>
> >> >> Nik
> >> >>
> >>
> >>
> >>
> >
>
>
>
>
>
>
>
This is what I mean:
wes
On 6/3/07, Wesley Smith wrote:
> Here's what I would do:
>
> Use jit.expr to make x-coordinates for your plot and set your data as
> y coordinates with the z coordinate as 0. This is all in a 3 plane
> float32 matrix. Render it with jit.gl.mesh @draw_mode line_strips.
>
> wes
>
> On 6/3/07, Niklas Saers wrote:
> > Hi again Wes,
> > thank you very much for your answers. Yes, I have had a good look at
> > the helpfiles and experimented a little with them. The reason I ask
> > is that I don't have the OpenGL skills to make this as my work has
> > mainly been revolving MSP and Java, and I need something to make a
> > plot. An example could be the brightness plot below. If there are
> > some examples on actual graphs, then I could use or modify them as a
> > starting point and gradually learn GL.
> >
> >
> >
> >
> > The jit.gl.graph help file uses jit.catch~ to capture audio. I
> > already have a list of floats, being coordinates in a graph. I would
> > like to draw a line between them much like is done in the brightness
> > graph attached. Based on the example I used jit.fill to fill a matrix
> > but ended up with nothing displayed and not really understanding what
> > I was doing. ;-) So yes, I did look at the help files before I went
> > to Google, but I'm not quite sure where to go from here.
> >
> > Since Max so long has been attached to all kinds of MIDI and serial
> > devices to measure stuff I'm fairly sure I can't be the first to want
> > to plot some data, so if your or anyone else on the list knows of any
> > examples or tutorials I could follow I would be very grateful for
> > your tips. :-)
> >
> > Cheers
> >
> > Nik
> >
> > On Jun 3, 2007, at 11:07 PM, Wesley Smith wrote:
> >
> >
> > > have you tried looking at the help files? jit.gl.graph should be self
> > > explanatory, jit.gl.mesh just takes 3D coordinates which you can set
> > > to construct a graph from data.
> > >
> > > wes
> > >
> > > On 6/3/07, Niklas Saers wrote:
> > >
> > >> Hi Wes,
> > >> thanks for the tip. I've tried googling on these and Tutorial as I
> > >> only can find jit.gl.sketch in the Jitter Tutorial that comes with
> > >> Jitter. Do you have any examples on how these objects have been used
> > >> to plot graphs? A link or example patch?
> > >>
> > >> Sincerely yours
> > >>
> > >> Nik
> > >>
> > >> On Jun 3, 2007, at 6:56 PM, Wesley Smith wrote:
> > >>
> > >> > Try using OpenGL. There's jit.gl.graph, jit.gl.mesh, and
> > >> > jit.gl.sketch which could all do the job depending on your
> > >> situation.
> > >> >
> > >> > wes
> > >> >
> > >> > On 6/3/07, Niklas Saers wrote:
> > >> >> Hi,
> > >> >> MATLAB and PyLab have some amazing commands such as plot() that
> > >> will
> > >> >> make a nice plot of some data. I'm porting my work from these
> > >> >> environments into Max/MSP/Jitter to do live audio analysis rather
> > >> >> than to work with sound files. I was wondering if there is a
> > >> Jitter
> > >> >> quivalent of plot()?
> > >> >>
> > >> >> Let me exemplify:
> > >> >> I've created a matrix that contain 5 times 11 float32s. These
> > >> are 5
> > >> >> functions that have generated 11 values each for the x-values 0 to
> > >> >> 10. I would like to see these graphs on my screen using jit.window
> > >> >>
> > >> >> Another example: I've got one function that creats a list of 11
> > >> >> floats. I want to put them in a matrix and visualize the change of
> > >> >> these values over time.
> > >> >>
> > >> >> How can I plot both/either the 5 functions and/or the list of
> > >> floats
> > >> >> over time? What are the most common way of doing this?
> > >> >>
> > >> >> Cheers
> > >> >>
> > >> >> Nik
> > >> >>
> > >>
> > >>
> > >>
> > >
> >
> >
> >
> >
> >
> >
> >
>
Dear Wes,
thank you very much for your example.
> Here's what I would do:
> Use jit.expr to make x-coordinates for your plot and set your data as
> y coordinates with the z coordinate as 0. This is all in a 3 plane
> float32 matrix. Render it with jit.gl.mesh @draw_mode line_strips.
So, the x part is the |jit.matrix 3 float32 1000| that is filled into
|jit.expr @expr "snorm[0]"| where the jit.noise generates the y axis
data?
I tried to adapt your example to a list of 11 floats but I must have
misunderstood a bit as I only get a single line going upwards rather
than data on the x axis.
Just one more thing I didn't understand from your patch: why is it
that when it is loaded the data is presented in the upper half of the
window, and when I press bang again the data is tilted?
Cheers
Nik
PS, I've attached the slightly modified version where I fill up a
matrix with 11 numbers in the first plane.
>
> wes
>
> On 6/3/07, Niklas Saers wrote:
>> Hi again Wes,
>> thank you very much for your answers. Yes, I have had a good look at
>> the helpfiles and experimented a little with them. The reason I ask
>> is that I don't have the OpenGL skills to make this as my work has
>> mainly been revolving MSP and Java, and I need something to make a
>> plot. An example could be the brightness plot below. If there are
>> some examples on actual graphs, then I could use or modify them as a
>> starting point and gradually learn GL.
>>
>>
>>
>>
>> The jit.gl.graph help file uses jit.catch~ to capture audio. I
>> already have a list of floats, being coordinates in a graph. I would
>> like to draw a line between them much like is done in the brightness
>> graph attached. Based on the example I used jit.fill to fill a matrix
>> but ended up with nothing displayed and not really understanding what
>> I was doing. ;-) So yes, I did look at the help files before I went
>> to Google, but I'm not quite sure where to go from here.
>>
>> Since Max so long has been attached to all kinds of MIDI and serial
>> devices to measure stuff I'm fairly sure I can't be the first to want
>> to plot some data, so if your or anyone else on the list knows of any
>> examples or tutorials I could follow I would be very grateful for
>> your tips. :-)
>>
>> Cheers
>>
>> Nik
>>
>> On Jun 3, 2007, at 11:07 PM, Wesley Smith wrote:
>>
>>
>> > have you tried looking at the help files? jit.gl.graph should
>> be self
>> > explanatory, jit.gl.mesh just takes 3D coordinates which you can
>> set
>> > to construct a graph from data.
>> >
>> > wes
>> >
>> > On 6/3/07, Niklas Saers wrote:
>> >
>> >> Hi Wes,
>> >> thanks for the tip. I've tried googling on these and Tutorial as I
>> >> only can find jit.gl.sketch in the Jitter Tutorial that comes with
>> >> Jitter. Do you have any examples on how these objects have been
>> used
>> >> to plot graphs? A link or example patch?
>> >>
>> >> Sincerely yours
>> >>
>> >> Nik
>> >>
>> >> On Jun 3, 2007, at 6:56 PM, Wesley Smith wrote:
>> >>
>> >> > Try using OpenGL. There's jit.gl.graph, jit.gl.mesh, and
>> >> > jit.gl.sketch which could all do the job depending on your
>> >> situation.
>> >> >
>> >> > wes
>> >> >
>> >> > On 6/3/07, Niklas Saers wrote:
>> >> >> Hi,
>> >> >> MATLAB and PyLab have some amazing commands such as plot() that
>> >> will
>> >> >> make a nice plot of some data. I'm porting my work from these
>> >> >> environments into Max/MSP/Jitter to do live audio analysis
>> rather
>> >> >> than to work with sound files. I was wondering if there is a
>> >> Jitter
>> >> >> quivalent of plot()?
>> >> >>
>> >> >> Let me exemplify:
>> >> >> I've created a matrix that contain 5 times 11 float32s. These
>> >> are 5
>> >> >> functions that have generated 11 values each for the x-
>> values 0 to
>> >> >> 10. I would like to see these graphs on my screen using
>> jit.window
>> >> >>
>> >> >> Another example: I've got one function that creats a list of 11
>> >> >> floats. I want to put them in a matrix and visualize the
>> change of
>> >> >> these values over time.
>> >> >>
>> >> >> How can I plot both/either the 5 functions and/or the list of
>> >> floats
>> >> >> over time? What are the most common way of doing this?
>> >> >>
>> >> >> Cheers
>> >> >>
>> >> >> Nik
>> >> >>
>> >>
>> >>
>> >>
>> >
>>
>>
>>
>>
>>
>>
>>
Hello Niklas,
Your patch is close, but it is slightly redundant. See the attached
patch for a more clarified version.
Also, the numbers you are packing into the matrix are not normalized to
a (-1 , 1) range, so the points that are plotted will end up outside of
the viewable area.
For your purposes, you might find jit.gl.sketch to be the more useful
interface, as it provides various drawing commands similar to jit.lcd.
For an example of using jit.gl.sketch to plot parametric data, check out
Jitter Recipe 23: ElapseGraph
Sorry if this confuses more than it elucidates.
Andrew B.
Sorry, forgot the patch:
Hi Anthony,
thank you very much for the patch.
> Also, the numbers you are packing into the matrix are not
> normalized to
> a (-1 , 1) range, so the points that are plotted will end up
> outside of
> the viewable area.
Aha, that makes good sense. :-)
> For your purposes, you might find jit.gl.sketch to be the more useful
> interface, as it provides various drawing commands similar to jit.lcd.
> For an example of using jit.gl.sketch to plot parametric data,
> check out
> Jitter Recipe 23: ElapseGraph
Thank you very much, I'll check it out. :-)
> Sorry if this confuses more than it elucidates.
Not at all, I'm very grateful for what you guys have taught me. :-)
My initial shock that there was no normal graph-plotting tool is
over, and this looks like it's going to be fine. :-) Very interesting
to see the different options. :-)
Cheers
Nik