Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.graphics.apps.gnuplot > #2621 > unrolled thread
| Started by | ChaMi <ck.mitra@gmail.com> |
|---|---|
| First post | 2014-10-23 06:47 -0700 |
| Last post | 2014-10-24 12:09 +0200 |
| Articles | 4 — 2 participants |
Back to article view | Back to comp.graphics.apps.gnuplot
Reading pattern from a column... ChaMi <ck.mitra@gmail.com> - 2014-10-23 06:47 -0700
Re: Reading pattern from a column... Karl <mail.kfr@gmx.net> - 2014-10-23 18:13 +0200
Re: Reading pattern from a column... ChaMi <ck.mitra@gmail.com> - 2014-10-23 22:31 -0700
Re: Reading pattern from a column... Karl <mail.kfr@gmx.net> - 2014-10-24 12:09 +0200
| From | ChaMi <ck.mitra@gmail.com> |
|---|---|
| Date | 2014-10-23 06:47 -0700 |
| Subject | Reading pattern from a column... |
| Message-ID | <6e475ddd-8f01-4d0a-aa0d-18ec78fc93f7@googlegroups.com> |
I am using gnuplot 4.6 on ubuntu linux. I am plotting a histogram but I want the bars to have different fill styles. I have added one column of data (0,1,2,3,4 etc.) and I am trying to using the plot command as: plot 'kk.csv' usi 9:xtic(1) with boxes fillstyle pattern $10 As you have guessed, it is not not working; it says ; expected. Please tell me what I am doing wrong?
[toc] | [next] | [standalone]
| From | Karl <mail.kfr@gmx.net> |
|---|---|
| Date | 2014-10-23 18:13 +0200 |
| Message-ID | <m2b99e$2dt$1@news.rz.uni-karlsruhe.de> |
| In reply to | #2621 |
Am 23.10.2014 um 15:47 schrieb ChaMi: > I am using gnuplot 4.6 on ubuntu linux. > > I am plotting a histogram but I want the bars to have different fill styles. I have added one column of data (0,1,2,3,4 etc.) and I am trying to using the plot command as: > > plot 'kk.csv' usi 9:xtic(1) with boxes fillstyle pattern $10 > > As you have guessed, it is not not working; it says ; expected. > > Please tell me what I am doing wrong? > I think you want something similar to plot $data usi 0:1:(.5):2:xtic(3) with boxes lc variable only the pattern should change instead of the colour (which is taken here from column 2)? ($data is a new inline data variant in gp5.0, just replace it with your file name) The keyword "variable" unfortunately is not implemented for fillstyles, so i´m not sure it is possible to take the fillstyle from a column. As there are not so many patterns available anyway, you could however do this (pattern in column 2 again): plot for [i=1:5] $data us ($2==i ? $0 : NaN):1:(.5):xtic(3) \ with boxes fillst pattern i i.e. cycle though the patterns and eacht time only plot the data in rows where $2 matches. Karl
[toc] | [prev] | [next] | [standalone]
| From | ChaMi <ck.mitra@gmail.com> |
|---|---|
| Date | 2014-10-23 22:31 -0700 |
| Message-ID | <94d8d4c3-cd68-4795-9076-156556796192@googlegroups.com> |
| In reply to | #2622 |
On Thursday, October 23, 2014 9:40:23 PM UTC+5:30, Karl wrote: > Am 23.10.2014 um 15:47 schrieb ChaMi: > > I am using gnuplot 4.6 on ubuntu linux. > > > > I am plotting a histogram but I want the bars to have different fill styles. I have added one column of data (0,1,2,3,4 etc.) and I am trying to using the plot command as: > > > > plot 'kk.csv' usi 9:xtic(1) with boxes fillstyle pattern $10 > > > > As you have guessed, it is not not working; it says ; expected. > > > > Please tell me what I am doing wrong? > > > > I think you want something similar to > > plot $data usi 0:1:(.5):2:xtic(3) with boxes lc variable > > only the pattern should change instead of the colour (which is taken > here from column 2)? > > ($data is a new inline data variant in gp5.0, just replace it with your > file name) > > The keyword "variable" unfortunately is not implemented for fillstyles, > so i´m not sure it is possible to take the fillstyle from a column. > > As there are not so many patterns available anyway, you could however do > this (pattern in column 2 again): > > plot for [i=1:5] $data us ($2==i ? $0 : NaN):1:(.5):xtic(3) \ > with boxes fillst pattern i > > i.e. cycle though the patterns and eacht time only plot the data in rows > where $2 matches. > > Karl Thanks a lot! That did it. Although I am getting a lot of warning, but the result is what I wanted.
[toc] | [prev] | [next] | [standalone]
| From | Karl <mail.kfr@gmx.net> |
|---|---|
| Date | 2014-10-24 12:09 +0200 |
| Message-ID | <m2d8bs$pf2$1@news.rz.uni-karlsruhe.de> |
| In reply to | #2623 |
Am 24.10.2014 um 07:31 schrieb ChaMi: > On Thursday, October 23, 2014 9:40:23 PM UTC+5:30, Karl wrote: >> Am 23.10.2014 um 15:47 schrieb ChaMi: >>> I am using gnuplot 4.6 on ubuntu linux. >>> >>> I am plotting a histogram but I want the bars to have different fill styles. I have added one column of data (0,1,2,3,4 etc.) and I am trying to using the plot command as: >>> >>> plot 'kk.csv' usi 9:xtic(1) with boxes fillstyle pattern $10 >>> >>> As you have guessed, it is not not working; it says ; expected. >>> >>> Please tell me what I am doing wrong? >>> >> >> I think you want something similar to >> >> plot $data usi 0:1:(.5):2:xtic(3) with boxes lc variable >> >> only the pattern should change instead of the colour (which is taken >> here from column 2)? >> >> ($data is a new inline data variant in gp5.0, just replace it with your >> file name) >> >> The keyword "variable" unfortunately is not implemented for fillstyles, >> so i´m not sure it is possible to take the fillstyle from a column. >> >> As there are not so many patterns available anyway, you could however do >> this (pattern in column 2 again): >> >> plot for [i=1:5] $data us ($2==i ? $0 : NaN):1:(.5):xtic(3) \ >> with boxes fillst pattern i >> >> i.e. cycle though the patterns and each time only plot the data in rows >> where $2 matches. >> >> Karl > > Thanks a lot! That did it. Although I am getting a lot of warning, but the result is what I wanted. > You mean these warning: add_tic_user: list sort error ? Yes, i get those too. I say they´re harmless, but you might want to check if all tics are labeled correctly. Karl
[toc] | [prev] | [standalone]
Back to top | Article view | comp.graphics.apps.gnuplot
csiph-web