Re: OT: Converter matrix to picture
Hi Paul Just to specify a bit, you should take a look at the 'spy' and 'spy2' commands from matplotlib JP Paul Smith wrote: On 2/3/06, John Pye [EMAIL PROTECTED] wrote: You should try Matplotlib under python. You've got a lot of the MATLAB functionality re-implemented in python. http://matplotlib.sourceforge.net/ There is a sample sparsity diagram that I produced, see here (scroll down to near the bottom) https://pse.cheme.cmu.edu/wiki/view/Ascend/PythonWrapper Using matplotlib you can also render directly to various formats including SVG, I believe. Thanks, John. That is a quite useful set of commands. Paul
Re: OT: Converter matrix to picture
Hi Paul Just to specify a bit, you should take a look at the 'spy' and 'spy2' commands from matplotlib JP Paul Smith wrote: On 2/3/06, John Pye [EMAIL PROTECTED] wrote: You should try Matplotlib under python. You've got a lot of the MATLAB functionality re-implemented in python. http://matplotlib.sourceforge.net/ There is a sample sparsity diagram that I produced, see here (scroll down to near the bottom) https://pse.cheme.cmu.edu/wiki/view/Ascend/PythonWrapper Using matplotlib you can also render directly to various formats including SVG, I believe. Thanks, John. That is a quite useful set of commands. Paul
Re: OT: Converter matrix to picture
Hi Paul Just to specify a bit, you should take a look at the 'spy' and 'spy2' commands from matplotlib JP Paul Smith wrote: On 2/3/06, John Pye <[EMAIL PROTECTED]> wrote: You should try Matplotlib under python. You've got a lot of the MATLAB functionality re-implemented in python. http://matplotlib.sourceforge.net/ There is a sample sparsity diagram that I produced, see here (scroll down to near the bottom) https://pse.cheme.cmu.edu/wiki/view/Ascend/PythonWrapper Using matplotlib you can also render directly to various formats including SVG, I believe. Thanks, John. That is a quite useful set of commands. Paul
Re: OT: Converter matrix to picture
Paul Smith wrote: On 2/2/06, Herbert Voss [EMAIL PROTECTED] wrote: Yes, that is what I mean. An illustration is at http://www.mathworks.com/access/helpdesk/help/techdoc/ref/spy.html tell me the structure of your data file? Are the values also saved as a matrix? Thanks to all. An example of a data file is attached. It is a text file with a matrix. Each column corresponds to x-coordinate, whereas each row corresponds to y-coordinate. Both x and y have the same range: [0,1]. From column to column, x increases 0.1. From row to row, y increases 0.1. First column corresponds to x=0 and first row to y=0. Paul 0 1 1 0 0 0 0 1 1 1 0 1 1 0 1 1 1 0 1 0 understood. Here an example if you could have your textfile as /matrix [ 0 1 1 0 0 0 0 1 1 1 0 1 1 0 1 1 1 0 1 0 ] def \documentclass[a4paper]{article} \usepackage{pst-plot} \makeatletter \def\specialPlot#1{% [EMAIL PROTECTED] [EMAIL PROTECTED] (#1) run% load the data file /n 0 def% index for element [EMAIL PROTECTED] /Dot { DS 0 360 arc fill } bind def 0 0.1 1 { /y exch def 0 0.1 1 { /x exch def matrix n get dup 0 gt { x [EMAIL PROTECTED] mul y [EMAIL PROTECTED] mul Dot% } { pop } ifelse /n n 1 add def } for } for }% [EMAIL PROTECTED] } \makeatother \begin{document} \psset{unit=10} \begin{pspicture}(-0.1,-0.1)(1.1,1.1) \psaxes[Dx=0.1,Dy=0.1]{-}(1,1) \psset{dotsize=5pt} \specialPlot{matrix.txt} \end{pspicture} \end{document} Herbert
Re: OT: Converter matrix to picture
You should try Matplotlib under python. You've got a lot of the MATLAB functionality re-implemented in python. http://matplotlib.sourceforge.net/ There is a sample sparsity diagram that I produced, see here (scroll down to near the bottom) https://pse.cheme.cmu.edu/wiki/view/Ascend/PythonWrapper Using matplotlib you can also render directly to various formats including SVG, I believe. Hope that helps JP Paul Smith wrote: Dear All This may be a bit out of topic. I have a matrix of ones and zeros with which I would like to produce a picture in such a way that the ones would be represented in black, say, and the zeros in yellow. Does somebody know of a program (for Linux) to create my picture? Thanks in advance, Paul -- John Pye School of Mechanical and Manufacturing Engineering The University of New South Wales Sydney NSW 2052 Australia t +61 2 9385 5127 f +61 2 9663 1222 mailto:john.pye_AT_student_DOT_unsw.edu.au http://pye.dyndns.org/
Re: OT: Converter matrix to picture
On 2/3/06, Herbert Voss [EMAIL PROTECTED] wrote: tell me the structure of your data file? Are the values also saved as a matrix? Thanks to all. An example of a data file is attached. It is a text file with a matrix. Each column corresponds to x-coordinate, whereas each row corresponds to y-coordinate. Both x and y have the same range: [0,1]. From column to column, x increases 0.1. From row to row, y increases 0.1. First column corresponds to x=0 and first row to y=0. 0 1 1 0 0 0 0 1 1 1 0 1 1 0 1 1 1 0 1 0 understood. Here an example if you could have your textfile as /matrix [ 0 1 1 0 0 0 0 1 1 1 0 1 1 0 1 1 1 0 1 0 ] def Great, Herbert! That is it. Maybe, a spy-like command could be added to the list of commands of PSTricks. Well, that is just a suggestion... Paul
Re: OT: Converter matrix to picture
On 2/3/06, John Pye [EMAIL PROTECTED] wrote: You should try Matplotlib under python. You've got a lot of the MATLAB functionality re-implemented in python. http://matplotlib.sourceforge.net/ There is a sample sparsity diagram that I produced, see here (scroll down to near the bottom) https://pse.cheme.cmu.edu/wiki/view/Ascend/PythonWrapper Using matplotlib you can also render directly to various formats including SVG, I believe. Thanks, John. That is a quite useful set of commands. Paul
Re: OT: Converter matrix to picture
Paul Smith wrote: On 2/3/06, Herbert Voss [EMAIL PROTECTED] wrote: tell me the structure of your data file? Are the values also saved as a matrix? Thanks to all. An example of a data file is attached. It is a text file with a matrix. Each column corresponds to x-coordinate, whereas each row corresponds to y-coordinate. Both x and y have the same range: [0,1]. From column to column, x increases 0.1. From row to row, y increases 0.1. First column corresponds to x=0 and first row to y=0. 0 1 1 0 0 0 0 1 1 1 0 1 1 0 1 1 1 0 1 0 understood. Here an example if you could have your textfile as /matrix [ 0 1 1 0 0 0 0 1 1 1 0 1 1 0 1 1 1 0 1 0 ] def Great, Herbert! That is it. Maybe, a spy-like command could be added to the list of commands of PSTricks. Well, that is just a suggestion... let's see ... However, I was a bit too clever ... the textfile should be with a first and last line of /dotmatrix [ 0 1 1 0 0 0 0 1 1 1 ... ... ] def I forgot that PSTricks also defines a /matrix array for internal purposes. It collides with the one from this text matrix. Name it /dotmatrix [ ... ] def instead and everything will be ok. See example, which also shows the possibility of printing the dots as squares without whitespace. Herbert \documentclass[a4paper]{article} \usepackage{pst-plot} \makeatletter \def\specialPlot#1{% [EMAIL PROTECTED] [EMAIL PROTECTED] [EMAIL PROTECTED] (#1) run% load the data file [EMAIL PROTECTED] % scale dot [EMAIL PROTECTED]@[EMAIL PROTECTED] % dotstyle /n 0 def% index for element 0 0.1 1 { % the y loop /y exch def % save y 0 0.1 1 { % the x loop /x exch def % save x dotmatrix n get % get value from matrix dup 0 gt { % test if 0 x [EMAIL PROTECTED] mul y [EMAIL PROTECTED] mul Dot% } { pop } ifelse /n n 1 add def } for } for }% [EMAIL PROTECTED] } \makeatother \begin{document} \psset{unit=10} \begin{pspicture}(-0.1,-0.1)(1.1,1.1) \psaxes[Dx=0.1,Dy=0.1]{-}(1,1) \psset{dotscale=3,dotstyle=square*,linecolor=magenta} \specialPlot{matrix.txt} % must be of /dotmatrix [ ... ] def \end{pspicture} \begin{pspicture}(-0.1,-0.1)(1.1,1.1) \psaxes[Dx=0.1,Dy=0.1]{-}(1,1) \psset{dotsize=1.1cm,dotstyle=square*,linecolor=magenta} \specialPlot{matrix.txt} \end{pspicture} Paul
Re: OT: Converter matrix to picture
On 2/3/06, Herbert Voss [EMAIL PROTECTED] wrote: Great, Herbert! That is it. Maybe, a spy-like command could be added to the list of commands of PSTricks. Well, that is just a suggestion... let's see ... However, I was a bit too clever ... the textfile should be with a first and last line of /dotmatrix [ 0 1 1 0 0 0 0 1 1 1 ... ... ] def I forgot that PSTricks also defines a /matrix array for internal purposes. It collides with the one from this text matrix. Name it /dotmatrix [ ... ] def instead and everything will be ok. See example, which also shows the possibility of printing the dots as squares without whitespace. Works fine! Thanks, Herbert. Paul
Re: OT: Converter matrix to picture
On Thu, Feb 02, 2006 at 12:35:14PM +, Paul Smith wrote: Dear All This may be a bit out of topic. I have a matrix of ones and zeros with which I would like to produce a picture in such a way that the ones would be represented in black, say, and the zeros in yellow. Does somebody know of a program (for Linux) to create my picture? Have a look at any .xpm immage with your favourite text editor. Andre'
Re: OT: Converter matrix to picture
Paul Smith wrote: On 2/2/06, Herbert Voss [EMAIL PROTECTED] wrote: Yes, that is what I mean. An illustration is at http://www.mathworks.com/access/helpdesk/help/techdoc/ref/spy.html tell me the structure of your data file? Are the values also saved as a matrix? Thanks to all. An example of a data file is attached. It is a text file with a matrix. Each column corresponds to x-coordinate, whereas each row corresponds to y-coordinate. Both x and y have the same range: [0,1]. From column to column, x increases 0.1. From row to row, y increases 0.1. First column corresponds to x=0 and first row to y=0. Paul 0 1 1 0 0 0 0 1 1 1 0 1 1 0 1 1 1 0 1 0 understood. Here an example if you could have your textfile as /matrix [ 0 1 1 0 0 0 0 1 1 1 0 1 1 0 1 1 1 0 1 0 ] def \documentclass[a4paper]{article} \usepackage{pst-plot} \makeatletter \def\specialPlot#1{% [EMAIL PROTECTED] [EMAIL PROTECTED] (#1) run% load the data file /n 0 def% index for element [EMAIL PROTECTED] /Dot { DS 0 360 arc fill } bind def 0 0.1 1 { /y exch def 0 0.1 1 { /x exch def matrix n get dup 0 gt { x [EMAIL PROTECTED] mul y [EMAIL PROTECTED] mul Dot% } { pop } ifelse /n n 1 add def } for } for }% [EMAIL PROTECTED] } \makeatother \begin{document} \psset{unit=10} \begin{pspicture}(-0.1,-0.1)(1.1,1.1) \psaxes[Dx=0.1,Dy=0.1]{-}(1,1) \psset{dotsize=5pt} \specialPlot{matrix.txt} \end{pspicture} \end{document} Herbert
Re: OT: Converter matrix to picture
You should try Matplotlib under python. You've got a lot of the MATLAB functionality re-implemented in python. http://matplotlib.sourceforge.net/ There is a sample sparsity diagram that I produced, see here (scroll down to near the bottom) https://pse.cheme.cmu.edu/wiki/view/Ascend/PythonWrapper Using matplotlib you can also render directly to various formats including SVG, I believe. Hope that helps JP Paul Smith wrote: Dear All This may be a bit out of topic. I have a matrix of ones and zeros with which I would like to produce a picture in such a way that the ones would be represented in black, say, and the zeros in yellow. Does somebody know of a program (for Linux) to create my picture? Thanks in advance, Paul -- John Pye School of Mechanical and Manufacturing Engineering The University of New South Wales Sydney NSW 2052 Australia t +61 2 9385 5127 f +61 2 9663 1222 mailto:john.pye_AT_student_DOT_unsw.edu.au http://pye.dyndns.org/
Re: OT: Converter matrix to picture
On 2/3/06, Herbert Voss [EMAIL PROTECTED] wrote: tell me the structure of your data file? Are the values also saved as a matrix? Thanks to all. An example of a data file is attached. It is a text file with a matrix. Each column corresponds to x-coordinate, whereas each row corresponds to y-coordinate. Both x and y have the same range: [0,1]. From column to column, x increases 0.1. From row to row, y increases 0.1. First column corresponds to x=0 and first row to y=0. 0 1 1 0 0 0 0 1 1 1 0 1 1 0 1 1 1 0 1 0 understood. Here an example if you could have your textfile as /matrix [ 0 1 1 0 0 0 0 1 1 1 0 1 1 0 1 1 1 0 1 0 ] def Great, Herbert! That is it. Maybe, a spy-like command could be added to the list of commands of PSTricks. Well, that is just a suggestion... Paul
Re: OT: Converter matrix to picture
On 2/3/06, John Pye [EMAIL PROTECTED] wrote: You should try Matplotlib under python. You've got a lot of the MATLAB functionality re-implemented in python. http://matplotlib.sourceforge.net/ There is a sample sparsity diagram that I produced, see here (scroll down to near the bottom) https://pse.cheme.cmu.edu/wiki/view/Ascend/PythonWrapper Using matplotlib you can also render directly to various formats including SVG, I believe. Thanks, John. That is a quite useful set of commands. Paul
Re: OT: Converter matrix to picture
Paul Smith wrote: On 2/3/06, Herbert Voss [EMAIL PROTECTED] wrote: tell me the structure of your data file? Are the values also saved as a matrix? Thanks to all. An example of a data file is attached. It is a text file with a matrix. Each column corresponds to x-coordinate, whereas each row corresponds to y-coordinate. Both x and y have the same range: [0,1]. From column to column, x increases 0.1. From row to row, y increases 0.1. First column corresponds to x=0 and first row to y=0. 0 1 1 0 0 0 0 1 1 1 0 1 1 0 1 1 1 0 1 0 understood. Here an example if you could have your textfile as /matrix [ 0 1 1 0 0 0 0 1 1 1 0 1 1 0 1 1 1 0 1 0 ] def Great, Herbert! That is it. Maybe, a spy-like command could be added to the list of commands of PSTricks. Well, that is just a suggestion... let's see ... However, I was a bit too clever ... the textfile should be with a first and last line of /dotmatrix [ 0 1 1 0 0 0 0 1 1 1 ... ... ] def I forgot that PSTricks also defines a /matrix array for internal purposes. It collides with the one from this text matrix. Name it /dotmatrix [ ... ] def instead and everything will be ok. See example, which also shows the possibility of printing the dots as squares without whitespace. Herbert \documentclass[a4paper]{article} \usepackage{pst-plot} \makeatletter \def\specialPlot#1{% [EMAIL PROTECTED] [EMAIL PROTECTED] [EMAIL PROTECTED] (#1) run% load the data file [EMAIL PROTECTED] % scale dot [EMAIL PROTECTED]@[EMAIL PROTECTED] % dotstyle /n 0 def% index for element 0 0.1 1 { % the y loop /y exch def % save y 0 0.1 1 { % the x loop /x exch def % save x dotmatrix n get % get value from matrix dup 0 gt { % test if 0 x [EMAIL PROTECTED] mul y [EMAIL PROTECTED] mul Dot% } { pop } ifelse /n n 1 add def } for } for }% [EMAIL PROTECTED] } \makeatother \begin{document} \psset{unit=10} \begin{pspicture}(-0.1,-0.1)(1.1,1.1) \psaxes[Dx=0.1,Dy=0.1]{-}(1,1) \psset{dotscale=3,dotstyle=square*,linecolor=magenta} \specialPlot{matrix.txt} % must be of /dotmatrix [ ... ] def \end{pspicture} \begin{pspicture}(-0.1,-0.1)(1.1,1.1) \psaxes[Dx=0.1,Dy=0.1]{-}(1,1) \psset{dotsize=1.1cm,dotstyle=square*,linecolor=magenta} \specialPlot{matrix.txt} \end{pspicture} Paul
Re: OT: Converter matrix to picture
On 2/3/06, Herbert Voss [EMAIL PROTECTED] wrote: Great, Herbert! That is it. Maybe, a spy-like command could be added to the list of commands of PSTricks. Well, that is just a suggestion... let's see ... However, I was a bit too clever ... the textfile should be with a first and last line of /dotmatrix [ 0 1 1 0 0 0 0 1 1 1 ... ... ] def I forgot that PSTricks also defines a /matrix array for internal purposes. It collides with the one from this text matrix. Name it /dotmatrix [ ... ] def instead and everything will be ok. See example, which also shows the possibility of printing the dots as squares without whitespace. Works fine! Thanks, Herbert. Paul
Re: OT: Converter matrix to picture
On Thu, Feb 02, 2006 at 12:35:14PM +, Paul Smith wrote: Dear All This may be a bit out of topic. I have a matrix of ones and zeros with which I would like to produce a picture in such a way that the ones would be represented in black, say, and the zeros in yellow. Does somebody know of a program (for Linux) to create my picture? Have a look at any .xpm immage with your favourite text editor. Andre'
Re: OT: Converter matrix to picture
Paul Smith wrote: On 2/2/06, Herbert Voss <[EMAIL PROTECTED]> wrote: Yes, that is what I mean. An illustration is at http://www.mathworks.com/access/helpdesk/help/techdoc/ref/spy.html tell me the structure of your data file? Are the values also saved as a matrix? Thanks to all. An example of a data file is attached. It is a text file with a matrix. Each column corresponds to x-coordinate, whereas each row corresponds to y-coordinate. Both x and y have the same range: [0,1]. From column to column, x increases 0.1. From row to row, y increases 0.1. First column corresponds to x=0 and first row to y=0. Paul 0 1 1 0 0 0 0 1 1 1 0 1 1 0 1 1 1 0 1 0 understood. Here an example if you could have your textfile as /matrix [ 0 1 1 0 0 0 0 1 1 1 0 1 1 0 1 1 1 0 1 0 ] def \documentclass[a4paper]{article} \usepackage{pst-plot} \makeatletter \def\specialPlot#1{% [EMAIL PROTECTED] [EMAIL PROTECTED] (#1) run% load the data file /n 0 def% index for element [EMAIL PROTECTED] /Dot { DS 0 360 arc fill } bind def 0 0.1 1 { /y exch def 0 0.1 1 { /x exch def matrix n get dup 0 gt { x [EMAIL PROTECTED] mul y [EMAIL PROTECTED] mul Dot% } { pop } ifelse /n n 1 add def } for } for }% [EMAIL PROTECTED] } \makeatother \begin{document} \psset{unit=10} \begin{pspicture}(-0.1,-0.1)(1.1,1.1) \psaxes[Dx=0.1,Dy=0.1]{->}(1,1) \psset{dotsize=5pt} \specialPlot{matrix.txt} \end{pspicture} \end{document} Herbert
Re: OT: Converter matrix to picture
You should try Matplotlib under python. You've got a lot of the MATLAB functionality re-implemented in python. http://matplotlib.sourceforge.net/ There is a sample sparsity diagram that I produced, see here (scroll down to near the bottom) https://pse.cheme.cmu.edu/wiki/view/Ascend/PythonWrapper Using matplotlib you can also render directly to various formats including SVG, I believe. Hope that helps JP Paul Smith wrote: >Dear All > >This may be a bit out of topic. I have a matrix of ones and zeros with >which I would like to produce a picture in such a way that the ones >would be represented in black, say, and the zeros in yellow. Does >somebody know of a program (for Linux) to create my picture? > >Thanks in advance, > >Paul > > > -- John Pye School of Mechanical and Manufacturing Engineering The University of New South Wales Sydney NSW 2052 Australia t +61 2 9385 5127 f +61 2 9663 1222 mailto:john.pye_AT_student_DOT_unsw.edu.au http://pye.dyndns.org/
Re: OT: Converter matrix to picture
On 2/3/06, Herbert Voss <[EMAIL PROTECTED]> wrote: > >>tell me the structure of your data file? > >>Are the values also saved as a matrix? > > > > Thanks to all. An example of a data file is attached. It is a text > > file with a matrix. Each column corresponds to x-coordinate, whereas > > each row corresponds to y-coordinate. Both x and y have the same > > range: [0,1]. From column to column, x increases 0.1. From row to row, > > y increases 0.1. First column corresponds to x=0 and first row to y=0. > > > > > > > > 0 1 1 0 0 0 0 1 1 1 > > 0 1 1 0 1 1 1 0 1 0 > > understood. Here an example if you could have your textfile > as > > /matrix [ > 0 1 1 0 0 0 0 1 1 1 > 0 1 1 0 1 1 1 0 1 0 > > ] def Great, Herbert! That is it. Maybe, a "spy-like" command could be added to the list of commands of PSTricks. Well, that is just a suggestion... Paul
Re: OT: Converter matrix to picture
On 2/3/06, John Pye <[EMAIL PROTECTED]> wrote: > You should try Matplotlib under python. You've got a lot of the MATLAB > functionality re-implemented in python. > http://matplotlib.sourceforge.net/ > > There is a sample sparsity diagram that I produced, see here (scroll > down to near the bottom) > https://pse.cheme.cmu.edu/wiki/view/Ascend/PythonWrapper > > Using matplotlib you can also render directly to various formats > including SVG, I believe. Thanks, John. That is a quite useful set of commands. Paul
Re: OT: Converter matrix to picture
Paul Smith wrote: On 2/3/06, Herbert Voss <[EMAIL PROTECTED]> wrote: tell me the structure of your data file? Are the values also saved as a matrix? Thanks to all. An example of a data file is attached. It is a text file with a matrix. Each column corresponds to x-coordinate, whereas each row corresponds to y-coordinate. Both x and y have the same range: [0,1]. From column to column, x increases 0.1. From row to row, y increases 0.1. First column corresponds to x=0 and first row to y=0. 0 1 1 0 0 0 0 1 1 1 0 1 1 0 1 1 1 0 1 0 understood. Here an example if you could have your textfile as /matrix [ 0 1 1 0 0 0 0 1 1 1 0 1 1 0 1 1 1 0 1 0 ] def Great, Herbert! That is it. Maybe, a "spy-like" command could be added to the list of commands of PSTricks. Well, that is just a suggestion... let's see ... However, I was a bit too clever ... the textfile should be with a first and last line of /dotmatrix [ 0 1 1 0 0 0 0 1 1 1 ... ... ] def I forgot that PSTricks also defines a /matrix array for internal purposes. It collides with the one from this text matrix. Name it /dotmatrix [ ... ] def instead and everything will be ok. See example, which also shows the possibility of printing the dots as squares without whitespace. Herbert \documentclass[a4paper]{article} \usepackage{pst-plot} \makeatletter \def\specialPlot#1{% [EMAIL PROTECTED] [EMAIL PROTECTED] [EMAIL PROTECTED] (#1) run% load the data file [EMAIL PROTECTED] % scale dot [EMAIL PROTECTED]@[EMAIL PROTECTED] % dotstyle /n 0 def% index for element 0 0.1 1 { % the y loop /y exch def % save y 0 0.1 1 { % the x loop /x exch def % save x dotmatrix n get % get value from matrix dup 0 gt { % test if > 0 x [EMAIL PROTECTED] mul y [EMAIL PROTECTED] mul Dot% } { pop } ifelse /n n 1 add def } for } for }% [EMAIL PROTECTED] } \makeatother \begin{document} \psset{unit=10} \begin{pspicture}(-0.1,-0.1)(1.1,1.1) \psaxes[Dx=0.1,Dy=0.1]{->}(1,1) \psset{dotscale=3,dotstyle=square*,linecolor=magenta} \specialPlot{matrix.txt} % must be of /dotmatrix [ ... ] def \end{pspicture} \begin{pspicture}(-0.1,-0.1)(1.1,1.1) \psaxes[Dx=0.1,Dy=0.1]{->}(1,1) \psset{dotsize=1.1cm,dotstyle=square*,linecolor=magenta} \specialPlot{matrix.txt} \end{pspicture} Paul
Re: OT: Converter matrix to picture
On 2/3/06, Herbert Voss <[EMAIL PROTECTED]> wrote: > > Great, Herbert! That is it. Maybe, a "spy-like" command could be added > > to the list of commands of PSTricks. Well, that is just a > > suggestion... > > let's see ... > > However, I was a bit too clever ... > the textfile should be with a first and last line of > > /dotmatrix [ > 0 1 1 0 0 0 0 1 1 1 > ... > ... > ] def > > I forgot that PSTricks also defines a /matrix array for internal > purposes. It collides with the one from this text matrix. Name it > /dotmatrix [ ... ] def instead and everything will be ok. See > example, which also shows the possibility of printing the dots > as squares without whitespace. Works fine! Thanks, Herbert. Paul
Re: OT: Converter matrix to picture
On Thu, Feb 02, 2006 at 12:35:14PM +, Paul Smith wrote: > Dear All > > This may be a bit out of topic. I have a matrix of ones and zeros with > which I would like to produce a picture in such a way that the ones > would be represented in black, say, and the zeros in yellow. Does > somebody know of a program (for Linux) to create my picture? Have a look at any .xpm immage with your favourite text editor. Andre'
Re: OT: Converter matrix to picture
Paul Smith writes: Dear All This may be a bit out of topic. I have a matrix of ones and zeros with which I would like to produce a picture in such a way that the ones would be represented in black, say, and the zeros in yellow. Does somebody know of a program (for Linux) to create my picture? www.processing.org (also for Windows) -- Kevin Pfeiffer [EMAIL PROTECTED] Tiros-Translations
Re: OT: Converter matrix to picture
Paul Smith wrote: This may be a bit out of topic. I have a matrix of ones and zeros with which I would like to produce a picture in such a way that the ones would be represented in black, say, and the zeros in yellow. Does somebody know of a program (for Linux) to create my picture? what kind of matrix? Herbert
Re: OT: Converter matrix to picture
On Feb 2, 2006, at 9:00 AM, Herbert Voss wrote: Paul Smith wrote: This may be a bit out of topic. I have a matrix of ones and zeros with which I would like to produce a picture in such a way that the ones would be represented in black, say, and the zeros in yellow. Does somebody know of a program (for Linux) to create my picture? what kind of matrix? Matlab will do that with the 'spy' command
Re: OT: Converter matrix to picture
On 2/2/06, Herbert Voss [EMAIL PROTECTED] wrote: This may be a bit out of topic. I have a matrix of ones and zeros with which I would like to produce a picture in such a way that the ones would be represented in black, say, and the zeros in yellow. Does somebody know of a program (for Linux) to create my picture? what kind of matrix? An example follows: x\y 0.1 0.2 0.3 0.1 1 0 1 0.2 0 1 1 0.3 1 1 0 but my matrix is much larger, i.e., with many more rows and columns. Paul
Re: OT: Converter matrix to picture
Paul Smith wrote: On 2/2/06, Herbert Voss [EMAIL PROTECTED] wrote: This may be a bit out of topic. I have a matrix of ones and zeros with which I would like to produce a picture in such a way that the ones would be represented in black, say, and the zeros in yellow. Does somebody know of a program (for Linux) to create my picture? what kind of matrix? An example follows: x\y 0.1 0.2 0.3 0.1 1 0 1 0.2 0 1 1 0.3 1 1 0 but my matrix is much larger, i.e., with many more rows and columns. I need the exact LaTeX Definition, e.g. \begin{pmatrix} The above make things complicated, because 0.1 and 1 different Herbert
Re: OT: Converter matrix to picture
Paul Smith wrote: On 2/2/06, Herbert Voss [EMAIL PROTECTED] wrote: This may be a bit out of topic. I have a matrix of ones and zeros with which I would like to produce a picture in such a way that the ones would be represented in black, say, and the zeros in yellow. Does somebody know of a program (for Linux) to create my picture? what kind of matrix? An example follows: x\y 0.1 0.2 0.3 0.1 1 0 1 0.2 0 1 1 0.3 1 1 0 but my matrix is much larger, i.e., with many more rows and columns. hope, this helps Herbert \documentclass[12pt]{article} \usepackage{amsmath,xcolor} \pagestyle{empty} \begingroup \makeatletter \catcode`\0=\active \catcode`\1=\active [EMAIL PROTECTED] \newenvironment{makeActive}{% \catcode`\0=\active \catcode`\1=\active \def0{\colorbox{black}{\phantom{I}}}% \def1{\colorbox{yellow}{\phantom{I}}}% }{}% } \makeatother \def\zero{\string0} \def\one{\string1} \begin{document} \[ \begin{makeActive} \begin{pmatrix} x\backslash y \zero.\one \zero.2 \zero.3 \zero.4 \zero.5 \zero.6\\ \zero.\one1 0 1 1 0 1\\ \zero.2 0 1 1 1 0 1\\ \zero.3 1 1 0 1 1 0\\ \end{pmatrix} \end{makeActive} \] \end{document}
Re: OT: Converter matrix to picture
On 2/2/06, Herbert Voss [EMAIL PROTECTED] wrote: This may be a bit out of topic. I have a matrix of ones and zeros with which I would like to produce a picture in such a way that the ones would be represented in black, say, and the zeros in yellow. Does somebody know of a program (for Linux) to create my picture? what kind of matrix? An example follows: x\y 0.1 0.2 0.3 0.1 1 0 1 0.2 0 1 1 0.3 1 1 0 but my matrix is much larger, i.e., with many more rows and columns. hope, this helps Thanks, Herbert. That is a beautiful example, but it does not correspond to what I mean. I admit that it is my fault, as it seems that I was not clear enough. I will try to be clearer now. Imagine that you need to draw a circumference, and that you are given only a set of hundreds and hundreds of points (x,y) belonging to the circumference. Furthermore, suppose that you are unable to determine the circumference equation. My problem is similar to the one just described: I have hundreds of points in the form (x,y) that I want to display in an appropriate rectangle, along the same lines as one draws level curves. Is it now clear? Paul
Re: OT: Converter matrix to picture
On 2/2/06, Stephen Buonopane [EMAIL PROTECTED] wrote: This may be a bit out of topic. I have a matrix of ones and zeros with which I would like to produce a picture in such a way that the ones would be represented in black, say, and the zeros in yellow. Does somebody know of a program (for Linux) to create my picture? Matlab will do that with the 'spy' command Yes, that is what I mean. An illustration is at http://www.mathworks.com/access/helpdesk/help/techdoc/ref/spy.html but, unfortunately, I do not have Matlab. Paul
Re: OT: Converter matrix to picture
Paul Smith wrote: On 2/2/06, Stephen Buonopane [EMAIL PROTECTED] wrote: This may be a bit out of topic. I have a matrix of ones and zeros with which I would like to produce a picture in such a way that the ones would be represented in black, say, and the zeros in yellow. Does somebody know of a program (for Linux) to create my picture? Matlab will do that with the 'spy' command Yes, that is what I mean. An illustration is at http://www.mathworks.com/access/helpdesk/help/techdoc/ref/spy.html tell me the structure of your data file? Are the values also saved as a matrix? Herbert
Re: OT: Converter matrix to picture
On 2/2/06, Stephen Buonopane [EMAIL PROTECTED] wrote: This may be a bit out of topic. I have a matrix of ones and zeros with which I would like to produce a picture in such a way that the ones would be represented in black, say, and the zeros in yellow. Does somebody know of a program (for Linux) to create my picture? Matlab will do that with the 'spy' command Yes, that is what I mean. An illustration is at http://www.mathworks.com/access/helpdesk/help/techdoc/ref/spy.html but, unfortunately, I do not have Matlab. And unfortunately this command is not in Octave (the open source version of Matlab) I think you are going to have to do some programming.
Re: OT: Converter matrix to picture
Paul Smith writes: Yes, that is what I mean. An illustration is at http://www.mathworks.com/access/helpdesk/help/techdoc/ref/spy.html Having not looked at Herbert's suggestion, I am now quite confused (as I would have guessed that that is what it does). It seems you simply want to plot points on a grid whose intersections correspond to row and columns in your matrix of ones and zeros. (Isn't that what Herbert's code did? Perhaps you just needed to scale the grid? Or set the background to same color as the zeroes?) Processing (see prev. post) would also do this for you in perhaps 6 to 8 lines of code. -- Kevin Pfeiffer [EMAIL PROTECTED] Tiros-Translations
Re: OT: Converter matrix to picture
En/na Stephen Buonopane ha escrit: On 2/2/06, Stephen Buonopane [EMAIL PROTECTED] wrote: This may be a bit out of topic. I have a matrix of ones and zeros with which I would like to produce a picture in such a way that the ones would be represented in black, say, and the zeros in yellow. Does somebody know of a program (for Linux) to create my picture? Matlab will do that with the 'spy' command Yes, that is what I mean. An illustration is at http://www.mathworks.com/access/helpdesk/help/techdoc/ref/spy.html but, unfortunately, I do not have Matlab. And unfortunately this command is not in Octave (the open source version of Matlab) I think you are going to have to do some programming. Gnuplot has some colormap drawing capabilities. You could try that.
Re: OT: Converter matrix to picture
On 2/2/06, Herbert Voss [EMAIL PROTECTED] wrote: Yes, that is what I mean. An illustration is at http://www.mathworks.com/access/helpdesk/help/techdoc/ref/spy.html tell me the structure of your data file? Are the values also saved as a matrix? Thanks to all. An example of a data file is attached. It is a text file with a matrix. Each column corresponds to x-coordinate, whereas each row corresponds to y-coordinate. Both x and y have the same range: [0,1]. From column to column, x increases 0.1. From row to row, y increases 0.1. First column corresponds to x=0 and first row to y=0. Paul 0 1 1 0 0 0 0 1 1 1 0 1 1 0 1 1 1 0 1 0 1 0 1 1 0 0 0 1 1 0 0 0 1 0 0 0 0 0 1 1 1 1 1 1 1 0 1 0 0 1 0 0 1 1 0 1 0 1 1 1 1 0 0 0 1 1 0 0 0 1 0 0 0 1 1 1 0 1 1 0 1 1 0 0 0 0 1 0 0 1 1 0 1 0 0 1 1 1 0 0
Re: OT: Converter matrix to picture
On 2/2/06, Paul Smith [EMAIL PROTECTED] wrote: Yes, that is what I mean. An illustration is at http://www.mathworks.com/access/helpdesk/help/techdoc/ref/spy.html tell me the structure of your data file? Are the values also saved as a matrix? Thanks to all. An example of a data file is attached. It is a text file with a matrix. Each column corresponds to x-coordinate, whereas each row corresponds to y-coordinate. Both x and y have the same range: [0,1]. From column to column, x increases 0.1. From row to row, y increases 0.1. First column corresponds to x=0 and first row to y=0. Gnuplot seems to be able to plot points and export the result as a LaTeX file. I will give it a try tomorrow. Paul
Re: OT: Converter matrix to picture
Paul Smith writes: Dear All This may be a bit out of topic. I have a matrix of ones and zeros with which I would like to produce a picture in such a way that the ones would be represented in black, say, and the zeros in yellow. Does somebody know of a program (for Linux) to create my picture? www.processing.org (also for Windows) -- Kevin Pfeiffer [EMAIL PROTECTED] Tiros-Translations
Re: OT: Converter matrix to picture
Paul Smith wrote: This may be a bit out of topic. I have a matrix of ones and zeros with which I would like to produce a picture in such a way that the ones would be represented in black, say, and the zeros in yellow. Does somebody know of a program (for Linux) to create my picture? what kind of matrix? Herbert
Re: OT: Converter matrix to picture
On Feb 2, 2006, at 9:00 AM, Herbert Voss wrote: Paul Smith wrote: This may be a bit out of topic. I have a matrix of ones and zeros with which I would like to produce a picture in such a way that the ones would be represented in black, say, and the zeros in yellow. Does somebody know of a program (for Linux) to create my picture? what kind of matrix? Matlab will do that with the 'spy' command
Re: OT: Converter matrix to picture
On 2/2/06, Herbert Voss [EMAIL PROTECTED] wrote: This may be a bit out of topic. I have a matrix of ones and zeros with which I would like to produce a picture in such a way that the ones would be represented in black, say, and the zeros in yellow. Does somebody know of a program (for Linux) to create my picture? what kind of matrix? An example follows: x\y 0.1 0.2 0.3 0.1 1 0 1 0.2 0 1 1 0.3 1 1 0 but my matrix is much larger, i.e., with many more rows and columns. Paul
Re: OT: Converter matrix to picture
Paul Smith wrote: On 2/2/06, Herbert Voss [EMAIL PROTECTED] wrote: This may be a bit out of topic. I have a matrix of ones and zeros with which I would like to produce a picture in such a way that the ones would be represented in black, say, and the zeros in yellow. Does somebody know of a program (for Linux) to create my picture? what kind of matrix? An example follows: x\y 0.1 0.2 0.3 0.1 1 0 1 0.2 0 1 1 0.3 1 1 0 but my matrix is much larger, i.e., with many more rows and columns. I need the exact LaTeX Definition, e.g. \begin{pmatrix} The above make things complicated, because 0.1 and 1 different Herbert
Re: OT: Converter matrix to picture
Paul Smith wrote: On 2/2/06, Herbert Voss [EMAIL PROTECTED] wrote: This may be a bit out of topic. I have a matrix of ones and zeros with which I would like to produce a picture in such a way that the ones would be represented in black, say, and the zeros in yellow. Does somebody know of a program (for Linux) to create my picture? what kind of matrix? An example follows: x\y 0.1 0.2 0.3 0.1 1 0 1 0.2 0 1 1 0.3 1 1 0 but my matrix is much larger, i.e., with many more rows and columns. hope, this helps Herbert \documentclass[12pt]{article} \usepackage{amsmath,xcolor} \pagestyle{empty} \begingroup \makeatletter \catcode`\0=\active \catcode`\1=\active [EMAIL PROTECTED] \newenvironment{makeActive}{% \catcode`\0=\active \catcode`\1=\active \def0{\colorbox{black}{\phantom{I}}}% \def1{\colorbox{yellow}{\phantom{I}}}% }{}% } \makeatother \def\zero{\string0} \def\one{\string1} \begin{document} \[ \begin{makeActive} \begin{pmatrix} x\backslash y \zero.\one \zero.2 \zero.3 \zero.4 \zero.5 \zero.6\\ \zero.\one1 0 1 1 0 1\\ \zero.2 0 1 1 1 0 1\\ \zero.3 1 1 0 1 1 0\\ \end{pmatrix} \end{makeActive} \] \end{document}
Re: OT: Converter matrix to picture
On 2/2/06, Herbert Voss [EMAIL PROTECTED] wrote: This may be a bit out of topic. I have a matrix of ones and zeros with which I would like to produce a picture in such a way that the ones would be represented in black, say, and the zeros in yellow. Does somebody know of a program (for Linux) to create my picture? what kind of matrix? An example follows: x\y 0.1 0.2 0.3 0.1 1 0 1 0.2 0 1 1 0.3 1 1 0 but my matrix is much larger, i.e., with many more rows and columns. hope, this helps Thanks, Herbert. That is a beautiful example, but it does not correspond to what I mean. I admit that it is my fault, as it seems that I was not clear enough. I will try to be clearer now. Imagine that you need to draw a circumference, and that you are given only a set of hundreds and hundreds of points (x,y) belonging to the circumference. Furthermore, suppose that you are unable to determine the circumference equation. My problem is similar to the one just described: I have hundreds of points in the form (x,y) that I want to display in an appropriate rectangle, along the same lines as one draws level curves. Is it now clear? Paul
Re: OT: Converter matrix to picture
On 2/2/06, Stephen Buonopane [EMAIL PROTECTED] wrote: This may be a bit out of topic. I have a matrix of ones and zeros with which I would like to produce a picture in such a way that the ones would be represented in black, say, and the zeros in yellow. Does somebody know of a program (for Linux) to create my picture? Matlab will do that with the 'spy' command Yes, that is what I mean. An illustration is at http://www.mathworks.com/access/helpdesk/help/techdoc/ref/spy.html but, unfortunately, I do not have Matlab. Paul
Re: OT: Converter matrix to picture
Paul Smith wrote: On 2/2/06, Stephen Buonopane [EMAIL PROTECTED] wrote: This may be a bit out of topic. I have a matrix of ones and zeros with which I would like to produce a picture in such a way that the ones would be represented in black, say, and the zeros in yellow. Does somebody know of a program (for Linux) to create my picture? Matlab will do that with the 'spy' command Yes, that is what I mean. An illustration is at http://www.mathworks.com/access/helpdesk/help/techdoc/ref/spy.html tell me the structure of your data file? Are the values also saved as a matrix? Herbert
Re: OT: Converter matrix to picture
On 2/2/06, Stephen Buonopane [EMAIL PROTECTED] wrote: This may be a bit out of topic. I have a matrix of ones and zeros with which I would like to produce a picture in such a way that the ones would be represented in black, say, and the zeros in yellow. Does somebody know of a program (for Linux) to create my picture? Matlab will do that with the 'spy' command Yes, that is what I mean. An illustration is at http://www.mathworks.com/access/helpdesk/help/techdoc/ref/spy.html but, unfortunately, I do not have Matlab. And unfortunately this command is not in Octave (the open source version of Matlab) I think you are going to have to do some programming.
Re: OT: Converter matrix to picture
Paul Smith writes: Yes, that is what I mean. An illustration is at http://www.mathworks.com/access/helpdesk/help/techdoc/ref/spy.html Having not looked at Herbert's suggestion, I am now quite confused (as I would have guessed that that is what it does). It seems you simply want to plot points on a grid whose intersections correspond to row and columns in your matrix of ones and zeros. (Isn't that what Herbert's code did? Perhaps you just needed to scale the grid? Or set the background to same color as the zeroes?) Processing (see prev. post) would also do this for you in perhaps 6 to 8 lines of code. -- Kevin Pfeiffer [EMAIL PROTECTED] Tiros-Translations
Re: OT: Converter matrix to picture
En/na Stephen Buonopane ha escrit: On 2/2/06, Stephen Buonopane [EMAIL PROTECTED] wrote: This may be a bit out of topic. I have a matrix of ones and zeros with which I would like to produce a picture in such a way that the ones would be represented in black, say, and the zeros in yellow. Does somebody know of a program (for Linux) to create my picture? Matlab will do that with the 'spy' command Yes, that is what I mean. An illustration is at http://www.mathworks.com/access/helpdesk/help/techdoc/ref/spy.html but, unfortunately, I do not have Matlab. And unfortunately this command is not in Octave (the open source version of Matlab) I think you are going to have to do some programming. Gnuplot has some colormap drawing capabilities. You could try that.
Re: OT: Converter matrix to picture
On 2/2/06, Herbert Voss [EMAIL PROTECTED] wrote: Yes, that is what I mean. An illustration is at http://www.mathworks.com/access/helpdesk/help/techdoc/ref/spy.html tell me the structure of your data file? Are the values also saved as a matrix? Thanks to all. An example of a data file is attached. It is a text file with a matrix. Each column corresponds to x-coordinate, whereas each row corresponds to y-coordinate. Both x and y have the same range: [0,1]. From column to column, x increases 0.1. From row to row, y increases 0.1. First column corresponds to x=0 and first row to y=0. Paul 0 1 1 0 0 0 0 1 1 1 0 1 1 0 1 1 1 0 1 0 1 0 1 1 0 0 0 1 1 0 0 0 1 0 0 0 0 0 1 1 1 1 1 1 1 0 1 0 0 1 0 0 1 1 0 1 0 1 1 1 1 0 0 0 1 1 0 0 0 1 0 0 0 1 1 1 0 1 1 0 1 1 0 0 0 0 1 0 0 1 1 0 1 0 0 1 1 1 0 0
Re: OT: Converter matrix to picture
On 2/2/06, Paul Smith [EMAIL PROTECTED] wrote: Yes, that is what I mean. An illustration is at http://www.mathworks.com/access/helpdesk/help/techdoc/ref/spy.html tell me the structure of your data file? Are the values also saved as a matrix? Thanks to all. An example of a data file is attached. It is a text file with a matrix. Each column corresponds to x-coordinate, whereas each row corresponds to y-coordinate. Both x and y have the same range: [0,1]. From column to column, x increases 0.1. From row to row, y increases 0.1. First column corresponds to x=0 and first row to y=0. Gnuplot seems to be able to plot points and export the result as a LaTeX file. I will give it a try tomorrow. Paul
Re: OT: Converter matrix to picture
Paul Smith writes: > Dear All > > This may be a bit out of topic. I have a matrix of ones and zeros > with which I would like to produce a picture in such a way that the > ones would be represented in black, say, and the zeros in yellow. > Does somebody know of a program (for Linux) to create my picture? www.processing.org (also for Windows) -- Kevin Pfeiffer <[EMAIL PROTECTED]> Tiros-Translations
Re: OT: Converter matrix to picture
Paul Smith wrote: This may be a bit out of topic. I have a matrix of ones and zeros with which I would like to produce a picture in such a way that the ones would be represented in black, say, and the zeros in yellow. Does somebody know of a program (for Linux) to create my picture? what kind of matrix? Herbert
Re: OT: Converter matrix to picture
On Feb 2, 2006, at 9:00 AM, Herbert Voss wrote: Paul Smith wrote: This may be a bit out of topic. I have a matrix of ones and zeros with which I would like to produce a picture in such a way that the ones would be represented in black, say, and the zeros in yellow. Does somebody know of a program (for Linux) to create my picture? what kind of matrix? Matlab will do that with the 'spy' command
Re: OT: Converter matrix to picture
On 2/2/06, Herbert Voss <[EMAIL PROTECTED]> wrote: > > This may be a bit out of topic. I have a matrix of ones and zeros with > > which I would like to produce a picture in such a way that the ones > > would be represented in black, say, and the zeros in yellow. Does > > somebody know of a program (for Linux) to create my picture? > > what kind of matrix? An example follows: x\y 0.1 0.2 0.3 0.1 1 0 1 0.2 0 1 1 0.3 1 1 0 but my matrix is much larger, i.e., with many more rows and columns. Paul
Re: OT: Converter matrix to picture
Paul Smith wrote: On 2/2/06, Herbert Voss <[EMAIL PROTECTED]> wrote: This may be a bit out of topic. I have a matrix of ones and zeros with which I would like to produce a picture in such a way that the ones would be represented in black, say, and the zeros in yellow. Does somebody know of a program (for Linux) to create my picture? what kind of matrix? An example follows: x\y 0.1 0.2 0.3 0.1 1 0 1 0.2 0 1 1 0.3 1 1 0 but my matrix is much larger, i.e., with many more rows and columns. I need the exact LaTeX Definition, e.g. \begin{pmatrix} The above make things complicated, because 0.1 and 1 different Herbert
Re: OT: Converter matrix to picture
Paul Smith wrote: On 2/2/06, Herbert Voss <[EMAIL PROTECTED]> wrote: This may be a bit out of topic. I have a matrix of ones and zeros with which I would like to produce a picture in such a way that the ones would be represented in black, say, and the zeros in yellow. Does somebody know of a program (for Linux) to create my picture? what kind of matrix? An example follows: x\y 0.1 0.2 0.3 0.1 1 0 1 0.2 0 1 1 0.3 1 1 0 but my matrix is much larger, i.e., with many more rows and columns. hope, this helps Herbert \documentclass[12pt]{article} \usepackage{amsmath,xcolor} \pagestyle{empty} \begingroup \makeatletter \catcode`\0=\active \catcode`\1=\active [EMAIL PROTECTED] \newenvironment{makeActive}{% \catcode`\0=\active \catcode`\1=\active \def0{\colorbox{black}{\phantom{I}}}% \def1{\colorbox{yellow}{\phantom{I}}}% }{}% } \makeatother \def\zero{\string0} \def\one{\string1} \begin{document} \[ \begin{makeActive} \begin{pmatrix} x\backslash y &\zero.\one & \zero.2 & \zero.3 & \zero.4 & \zero.5 & \zero.6\\ \zero.\one & 1 & 0 & 1 & 1 & 0 & 1\\ \zero.2 & 0 & 1 & 1 & 1 & 0 & 1\\ \zero.3 & 1 & 1 & 0 & 1 & 1 & 0\\ \end{pmatrix} \end{makeActive} \] \end{document}
Re: OT: Converter matrix to picture
On 2/2/06, Herbert Voss <[EMAIL PROTECTED]> wrote: > >>>This may be a bit out of topic. I have a matrix of ones and zeros with > >>>which I would like to produce a picture in such a way that the ones > >>>would be represented in black, say, and the zeros in yellow. Does > >>>somebody know of a program (for Linux) to create my picture? > >> > >>what kind of matrix? > > > > An example follows: > > > > x\y 0.1 0.2 0.3 > > 0.1 1 0 1 > > 0.2 0 1 1 > > 0.3 1 1 0 > > > > but my matrix is much larger, i.e., with many more rows and columns. > > hope, this helps Thanks, Herbert. That is a beautiful example, but it does not correspond to what I mean. I admit that it is my fault, as it seems that I was not clear enough. I will try to be clearer now. Imagine that you need to draw a circumference, and that you are given only a set of hundreds and hundreds of points (x,y) belonging to the circumference. Furthermore, suppose that you are unable to determine the circumference equation. My problem is similar to the one just described: I have hundreds of points in the form (x,y) that I want to display in an appropriate rectangle, along the same lines as one draws level curves. Is it now clear? Paul
Re: OT: Converter matrix to picture
On 2/2/06, Stephen Buonopane <[EMAIL PROTECTED]> wrote: > >> This may be a bit out of topic. I have a matrix of ones and zeros with > >> which I would like to produce a picture in such a way that the ones > >> would be represented in black, say, and the zeros in yellow. Does > >> somebody know of a program (for Linux) to create my picture? > > > Matlab will do that with the 'spy' command Yes, that is what I mean. An illustration is at http://www.mathworks.com/access/helpdesk/help/techdoc/ref/spy.html but, unfortunately, I do not have Matlab. Paul
Re: OT: Converter matrix to picture
Paul Smith wrote: On 2/2/06, Stephen Buonopane <[EMAIL PROTECTED]> wrote: This may be a bit out of topic. I have a matrix of ones and zeros with which I would like to produce a picture in such a way that the ones would be represented in black, say, and the zeros in yellow. Does somebody know of a program (for Linux) to create my picture? Matlab will do that with the 'spy' command Yes, that is what I mean. An illustration is at http://www.mathworks.com/access/helpdesk/help/techdoc/ref/spy.html tell me the structure of your data file? Are the values also saved as a matrix? Herbert
Re: OT: Converter matrix to picture
On 2/2/06, Stephen Buonopane <[EMAIL PROTECTED]> wrote: This may be a bit out of topic. I have a matrix of ones and zeros with which I would like to produce a picture in such a way that the ones would be represented in black, say, and the zeros in yellow. Does somebody know of a program (for Linux) to create my picture? Matlab will do that with the 'spy' command Yes, that is what I mean. An illustration is at http://www.mathworks.com/access/helpdesk/help/techdoc/ref/spy.html but, unfortunately, I do not have Matlab. And unfortunately this command is not in Octave (the open source version of Matlab) I think you are going to have to do some programming.
Re: OT: Converter matrix to picture
Paul Smith writes: > Yes, that is what I mean. An illustration is at > > http://www.mathworks.com/access/helpdesk/help/techdoc/ref/spy.html Having not looked at Herbert's suggestion, I am now quite confused (as I would have guessed that that is what it does). It seems you simply want to plot points on a grid whose intersections correspond to row and columns in your matrix of ones and zeros. (Isn't that what Herbert's code did? Perhaps you just needed to scale the grid? Or set the background to same color as the zeroes?) Processing (see prev. post) would also do this for you in perhaps 6 to 8 lines of code. -- Kevin Pfeiffer <[EMAIL PROTECTED]> Tiros-Translations
Re: OT: Converter matrix to picture
En/na Stephen Buonopane ha escrit: On 2/2/06, Stephen Buonopane <[EMAIL PROTECTED]> wrote: This may be a bit out of topic. I have a matrix of ones and zeros with which I would like to produce a picture in such a way that the ones would be represented in black, say, and the zeros in yellow. Does somebody know of a program (for Linux) to create my picture? Matlab will do that with the 'spy' command Yes, that is what I mean. An illustration is at http://www.mathworks.com/access/helpdesk/help/techdoc/ref/spy.html but, unfortunately, I do not have Matlab. And unfortunately this command is not in Octave (the open source version of Matlab) I think you are going to have to do some programming. Gnuplot has some colormap drawing capabilities. You could try that.
Re: OT: Converter matrix to picture
On 2/2/06, Herbert Voss <[EMAIL PROTECTED]> wrote: > > Yes, that is what I mean. An illustration is at > > > > http://www.mathworks.com/access/helpdesk/help/techdoc/ref/spy.html > > tell me the structure of your data file? > Are the values also saved as a matrix? Thanks to all. An example of a data file is attached. It is a text file with a matrix. Each column corresponds to x-coordinate, whereas each row corresponds to y-coordinate. Both x and y have the same range: [0,1]. From column to column, x increases 0.1. From row to row, y increases 0.1. First column corresponds to x=0 and first row to y=0. Paul 0 1 1 0 0 0 0 1 1 1 0 1 1 0 1 1 1 0 1 0 1 0 1 1 0 0 0 1 1 0 0 0 1 0 0 0 0 0 1 1 1 1 1 1 1 0 1 0 0 1 0 0 1 1 0 1 0 1 1 1 1 0 0 0 1 1 0 0 0 1 0 0 0 1 1 1 0 1 1 0 1 1 0 0 0 0 1 0 0 1 1 0 1 0 0 1 1 1 0 0
Re: OT: Converter matrix to picture
On 2/2/06, Paul Smith <[EMAIL PROTECTED]> wrote: > > > Yes, that is what I mean. An illustration is at > > > > > > http://www.mathworks.com/access/helpdesk/help/techdoc/ref/spy.html > > > > tell me the structure of your data file? > > Are the values also saved as a matrix? > > Thanks to all. An example of a data file is attached. It is a text > file with a matrix. Each column corresponds to x-coordinate, whereas > each row corresponds to y-coordinate. Both x and y have the same > range: [0,1]. From column to column, x increases 0.1. From row to row, > y increases 0.1. First column corresponds to x=0 and first row to y=0. Gnuplot seems to be able to plot points and export the result as a LaTeX file. I will give it a try tomorrow. Paul