[IPOL discuss] courve 1D visualisée comme points d'une image.
Miguel Colom
Miguel.Colom at cmla.ens-cachan.fr
Tue Oct 25 13:48:22 CEST 2011
> Hola Miguel,
>
> Probé de visualisar mis señales audio como puntos de una imagen
> utilisando *Plotutils
> Package*.
>
> Sabes si para IPOL hay que utilizar otro plot 2D ? Cual ?
>
> Mil gracias,
> Eva.
Hello Eva and everybody,
I'll answer your question and also send it to the discuss list so
everybody can know about it.
For IPOL we'll have a standard way to create 2D plots. It have to be used
the "draw2Dcurve.py" script. This scripts exposes a known interface that
isolates the details of the drawing implementation (using GNUPlot,
Matplotlib, C programs, etc).
This script is only used in the dev. server right now, so before
installing any demo that uses plots in the server, it has to be discussed
where to store it. I leave this decision to the tech team.
Right now the script is located at /home/colom/ipol/scripts/draw2Dcurve.py
in the dev. server. The same file can be downloaded from
http://dev.ipol.im/~colom/tools/scripts/draw2Dcurve.py
If a demo in the dev. server whats to use it, it should execute
/home/colom/ipol/scripts/draw2Dcurve.py and should NEVER make a copy the
script. Creating a soft symbolic link is all right too.
Of course, it can be downloaded and executed in a local environment to
test it.
The script accepts several options. I'll only explain those that need some
explanation.
Usage: draw2Dcurve.py [options]
-h, --help show this help message and exit
--output=OUTPUT output PNG file
--title=TITLE title
--xName=XNAME X-axis name
--yName=YNAME Y-axis name
--x0=X0 X-axis first value
--x1=X1 X-axis last value
--y0=Y0 Y-axis first value
--y1=Y1 Y-axis last value
--legend=LEGEND Legend for each data channel
If legends are used, they will be put inside the plot. They must be
separated by comma. Ex: --legend="Red,Green,Blue"
--grid=GRID use grid
--markers=MARKERS use markers
To use/don't use grid and markers, these options must be set to 1
(activate) or 0 (don't use).
--style=STYLE use custom line style
It refers to the style of the lines. For every line, it has to be
specified a color and a line style. For example: --style='r,-,g,-,b,--'
would draw red solid lines, a green solid line and a blue dashed line.
An example of invocation:
draw2Dcurve.py combined.txt --legend='t-R,t-G,t-B,s-R,s-G,s-B'
--style='r,-,g,-,b,-,r,--,g,--,b,--' --xName='Mean' --yName='Standard
deviation' --title="Temp. series (t) and single im. est. (s)" --markers=0
--output=figure.png
It draws a plot with 6 lines. The first 3 lines are red, green and blue
solid and the other 3 red, blue and blue dashed.
The input file format is:
X1 X2 ... Xn Y1 Y2 ... Yn
where each Xi is a column representing the X-axis values and the each Yi
the Y-axis values.
In http://dev.ipol.im/~colom/tools/scripts/example2DData.txt there's an
example of input file.
Best,
Miguel
More information about the discuss
mailing list