From: Daniel J S. <dan...@ie...> - 2004-03-03 16:31:51
|
Justace Clutter wrote: >I like the idea of this pixels based image. The fact that the image >could be 10 megs does not bother me. > Well, in my case my web space is only 10 M. > It is the idea that an image could >be 120 megs bothers me. So I got the patch and applyed. It did not go >clean as one hunk did not make it. But I fixed it by hand. I was >patching against 3.8k.1. So, I guess that I do not understand the >syntax. Here is the datafile that I have, or really a sample: > >0.999849 0.652204 0.678995 0.658985 0.585981 0.566624 0.547193 0.615902 >0.539023 0.556559 0.547578 0.53746 0.522146 0.535582 0.530735 0.531924 >0.554801 0.518362 0.479106 0.527362 0.534836 0.546124 0.522834 0.508155 >0.54706 0.469279 0.581292 0.468283 0.535739 0.557979 0.490128 0.536971 >0.530735 0.506848 0.523189 0.531732 0.550917 0.484002 0.57789 0.460027 >0.556111 0.535427 0.508878 0.558746 0.459494 0.578337 0.45805 0.595234 > >So I have a grid here, 8x6, that I would like displayed. Each of these >floats would need to be mapped onto a color. PM3D did this great. So >when I try to use the matrix modifier with just plot it is not happy, >then I tried to use splot, still not happy. Here is what I was trying.. > >gnuplot> plot 'tmp.data' matrix with image > >GNUPLOT (plot_image): Image grid must be at least 2 x 2. > >Warning: empty x range [0.999849:0.999849], adjusting to >[0.989851:1.00985] > >GNUPLOT (plot_image): Image grid must be at least 2 x 2. > >gnuplot> splot 'tmp.data' matrix with image > >GNUPLOT (plot_image): Image grid must be at least 2 x 2. > >gnuplot> set view map >gnuplot> splot 'tmp.data' matrix with image > >GNUPLOT (plot_image): Image grid must be at least 2 x 2. > >gnuplot> > >Can you give me some ideas on how I can use the image style with this >setup? I looked at the information on the image but it seems pretty >biased toward images like the tux and not array'd data. Thanks in >advance. > Well, here is the issue. You are putting the data in ASCII format in what looks to you like a grid. However, Gnuplot hasn't been set up to read ASCII data in such a way. It is set up to read ordered tuples of data, such as x1 y1 z1 x2 y2 z2 ... where the position is part of the data specification. Telling Gnuplot what the underlying grid is without specifying it is the problem. That is why the "binary" file specifications have extra qualifiers to indicate grid dimensions, grid spacing, etc. Another alternative for binary is "Gnuplot binary" where the first line and row of the matrix give the x and y spacing information. I've generally not used that for images, but I think it should work. (Type "help splot binary" at Gnuplot's command line for more info on that format.) The reason you may want to avoid putting your image in ASCII format is that you are playing the numbers game again. Your example above has 9 characters for each pixel element. 1800 x 1800 x 9 or roughly 27 M at a minimum, and if when you add the (x,y) coordinates it goes to 81 M. That's too big. If in the program or software you are using to generate the data you could multiply by 2^16 and then save the values in binary as unsigned 16 bit ints you would be better off. Can you do that? Dan >Justace > >On Wed, 2004-03-03 at 01:00, Daniel J Sebald wrote: > > >>Justace Clutter wrote: >> >> >> >>>So, >>> >>> I have this project where I have computed a bunch of channel >>>correlations. The entire matrix is like 1800x1800 with one side of the >>>diaganal set to NaN since it is symetric. Now to the root of the >>>problem. I use the pm3d portion of gnuplot to create a 2D map of the >>>matrix. Here is the snipplit of code that I use... >>> >>> >>> >><snip> >> >> >> >>>I used the first set size command to try to bring the file size down, of >>>course it did not work. The resultant file is 120Meg. This is crazy. >>>Am I doing somehting wrong? >>> >>> >>> >>Justace, >> >>Am I understanding correctly that you are essentially attempting to >>display an 1800x1800 matrix as an image? Ethan's comment is correct >>that each element, i.e., pixel, will be drawn as a rectangle, i.e., >>polygon. There is a lot of ASCII text associated with each rectangle. >> You might try the image patch on SourceForge (something originally >>titled "with pixels"). That will put the image into a PostScript file >>in a compact form. >> >>Realize though that 1800x1800 is a lot of data. Saved as bytes, that >>alone would be roughly 3M. I've tried 1000x1000 images with no >>problems, but things really do slow down. So, unless it is necessary to >>keep such high resolution for the image, your first step might be to >>down sample the data appropriately. Keep in mind what your eventual >>display will be. (For example, people often put high res photos on >>their web pages which take close to a minute to download. However, the >>display is usually low resolution so a condensed image would have served >>equally well and, in fact, would save space on their server.) Ethan's >>suggestion of PNG is a good idea because that inherently brings down the >>resolution. >> >>Dan >> >> |