|
From: Thomas S. <t.s...@fz...> - 2012-05-24 08:29:53
|
you are requesting xtics explicitly:
fprintf(pipe, "plot 'data.d' using 1:xtic(1) t col, '' u 2 ti col, '' u 3 ti
col, '' u 4 ti col\n");
remove "xtic(1)" from the "plot" command and there should be no xtics
anymore.
rihii wrote:
>
> Hello everyone, i have read many threads in forums, but havent found my
> answer yet.
>
> The problem is that GNUPLOT is plotting my xtics, that are in my data
> file, but i dont need that...
> Im calling gnuplot from C via pipes.
>
> CODE:
>
> void plotBox(FILE *pipe)
> {
> fprintf(pipe, "set grid\n"); // show grid
> // fprintf(pipe, "show grid\n");
> fprintf(pipe, "set boxwidth 0.9 relative\n");
> fprintf(pipe, "set style fill solid 1.00 border lt -1\n");
> fprintf(pipe, "set key outside right top vertical\n"); // show legend
> fprintf(pipe, "set style data histograms\n"); // plot data in
> histograms
> fprintf(pipe, "set style histogram clustered\n");
> fprintf(pipe, "set datafile missing '-'\n");
> fprintf(pipe, "set ytics 0,1\n");
> fprintf(pipe, "set xtics border in scale 0,0 nomirror rotate by -45
> autojustify\n");
> fprintf(pipe, "set xtics norangelimit font ',13'\n");
> fprintf(pipe, "set xtics ()\n");
> fprintf(pipe, "set title 'boxiishi' \n");
> // fprintf(pipe, "set yrange [ 0.00000 : 300000. ] noreverse
> nowriteback\n");
> // fprintf(pipe, "i = 22\n");
> fprintf(pipe, "plot 'data.d' using 1:xtic(1) t col, '' u 2 ti col, ''
> u 3 ti col, '' u 4 ti col\n");
> // fprintf(pipe, "plot 'data.d' using 2 ti col, '' u 3 ti col, '' u 4
> ti col\n");
> }
>
> and this is what i get.
> http://old.nabble.com/file/p33900443/histogram.jpeg
>
> I havent found my answer anywhere, so i posted here :)
>
>
--
View this message in context: http://old.nabble.com/gnuplot-tics-tp33900443p33900508.html
Sent from the Gnuplot - User mailing list archive at Nabble.com.
|
|
From: Thomas S. <t.s...@fz...> - 2012-05-25 08:54:07
|
so you want the xtic labels, but don't want the label values to be
plotted?
try this:
fprintf(pipe, "plot 'data.d' using 2:xtic(1) t col, '' u 3 ti col, '' u 4 ti
col\n");
rihii wrote:
>
> yes, i already did that, but then xtics dont have the names that i need,
> respectively the ones thet are written in my data file...
>
>
> Thomas Sefzick wrote:
>>
>> you are requesting xtics explicitly:
>>
>> fprintf(pipe, "plot 'data.d' using 1:xtic(1) t col, '' u 2 ti col, '' u 3
>> ti col, '' u 4 ti col\n");
>>
>> remove "xtic(1)" from the "plot" command and there should be no xtics
>> anymore.
>>
>>
>> rihii wrote:
>>>
>>> Hello everyone, i have read many threads in forums, but havent found my
>>> answer yet.
>>>
>>> The problem is that GNUPLOT is plotting my xtics, that are in my data
>>> file, but i dont need that...
>>> Im calling gnuplot from C via pipes.
>>>
>>> CODE:
>>>
>>> void plotBox(FILE *pipe)
>>> {
>>> fprintf(pipe, "set grid\n"); // show grid
>>> // fprintf(pipe, "show grid\n");
>>> fprintf(pipe, "set boxwidth 0.9 relative\n");
>>> fprintf(pipe, "set style fill solid 1.00 border lt -1\n");
>>> fprintf(pipe, "set key outside right top vertical\n"); // show
>>> legend
>>> fprintf(pipe, "set style data histograms\n"); // plot data in
>>> histograms
>>> fprintf(pipe, "set style histogram clustered\n");
>>> fprintf(pipe, "set datafile missing '-'\n");
>>> fprintf(pipe, "set ytics 0,1\n");
>>> fprintf(pipe, "set xtics border in scale 0,0 nomirror rotate by -45
>>> autojustify\n");
>>> fprintf(pipe, "set xtics norangelimit font ',13'\n");
>>> fprintf(pipe, "set xtics ()\n");
>>> fprintf(pipe, "set title 'boxiishi' \n");
>>> // fprintf(pipe, "set yrange [ 0.00000 : 300000. ] noreverse
>>> nowriteback\n");
>>> // fprintf(pipe, "i = 22\n");
>>> fprintf(pipe, "plot 'data.d' using 1:xtic(1) t col, '' u 2 ti col,
>>> '' u 3 ti col, '' u 4 ti col\n");
>>> // fprintf(pipe, "plot 'data.d' using 2 ti col, '' u 3 ti col, '' u 4
>>> ti col\n");
>>> }
>>>
>>> and this is what i get.
>>> http://old.nabble.com/file/p33900443/histogram.jpeg
>>>
>>> I havent found my answer anywhere, so i posted here :)
>>>
>>>
>>
>>
>
>
--
View this message in context: http://old.nabble.com/gnuplot-tics-tp33900443p33906656.html
Sent from the Gnuplot - User mailing list archive at Nabble.com.
|
|
From: Thomas S. <t.s...@fz...> - 2012-06-14 12:01:41
|
'help plot using xtic' says:
xticlabels(N) is shorthand for xticlabels(stringcolumn(N))
so you may use
plot 'data2.dat' using 3:xtic(stringcolumn(1)." ".stringcolumn(2)) t col
to have the ytics start at '0' you need to set yrange, not ytics:
set yrange [0:*]
column 3 has no header, you need to tell gnuplot to use
the header of column '2' instead:
plot 'data2.dat' using 3:xtic(stringcolumn(1)." ".stringcolumn(2)) t
columnheader(2)
rihii wrote:
>
> Hey, i have another problem :)
>
> i have this code:
> void plotBox(FILE *pipe){
>
> fprintf(pipe, "set grid\n"); // show grid
> fprintf(pipe, "set boxwidth 0.9 relative\n");
> fprintf(pipe, "set style fill solid 1.00 border lt -1\n");
> fprintf(pipe, "set key outside right top vertical\n"); // show legend
> fprintf(pipe, "set style data histograms\n"); // plot data in histograms
> fprintf(pipe, "set style histogram clustered\n");
> fprintf(pipe, "set datafile missing '-'\n");
> fprintf(pipe, "set xtics border in scale 0,0 nomirror rotate by -45
> autojustify\n");
> fprintf(pipe, "set xtics norangelimit font ',13'\n");
> fprintf(pipe, "set xtics ()\n");
> fprintf(pipe, "set ytics 0, 1\n"); // set y starting point and step
> fprintf(pipe, "set ylabel 'Used current'\n"); // set y starting point and
> step
> fprintf(pipe, "set xlabel 'time'\n"); // set y starting point and step
> fprintf(pipe, "set title 'Current sense data'\n"); // title of graph
> fprintf(pipe, "plot 'data2.dat' using 3:xtic(2) t col\n"); // plot data
> }
> and data2.dat looks like this:
> name Current
> 2012.06.13 12:41:04,52 24
> 2012.06.13 12:41:04,6 24
> 2012.06.13 12:41:04,72 24
> 2012.06.13 12:41:04,81 24
> 2012.06.13 12:41:04,91 24
> 2012.06.13 12:41:05,0 24
> 2012.06.13 12:41:05,12 24
> 2012.06.13 12:41:05,21 24
> 2012.06.13 12:41:05,31 24
> 2012.06.13 12:41:05,4 24
> 2012.06.13 12:41:05,52 24
> 2012.06.13 12:41:05,61 23
> 2012.06.13 12:41:05,71 24
> 2012.06.13 12:41:05,8 24
> 2012.06.14 12:41:05,61 23
> 2012.06.14 12:41:05,71 24
> 2012.06.14 12:41:05,8 24
>
> and the plot looks like this:
>
> http://old.nabble.com/file/p34010550/55.png 55.png
>
> soo, i would like to get the date into the xtics, so it would look like
> this: 2012.06.14 12:41:05,8
>
> i tried fprintf(pipe, "plot 'data2.dat' using 3:xtic(1, 2) t col\n"); but
> it didnt work
>
> also why ytics are starting from 23 and going to 24 if i hade specified
> fprintf(pipe, "set ytics 0, 1\n");
>
> and lastly i had the first row: Name Current as the name of red stick, but
> now its 24. also dont know why.
> Can you please help me? :)
>
--
View this message in context: http://old.nabble.com/gnuplot-tics-tp33900443p34011452.html
Sent from the Gnuplot - User mailing list archive at Nabble.com.
|
|
From: rihii <rih...@gm...> - 2012-06-15 07:04:32
|
Everything worked great :) just had some glitches as i call gnuplot from C i use "this is the command so insidme i have to use ' ' " another thing what i need to do is set the value of ticks on top of them, is that possible? i have been looking around but haven't found suitable solution... I need to do that because my data are very different, there is y range from 0 to 25000 and more... -- View this message in context: http://old.nabble.com/gnuplot-tics-tp33900443p34016147.html Sent from the Gnuplot - User mailing list archive at Nabble.com. |
|
From: Thomas S. <t.s...@fz...> - 2012-06-15 16:10:14
|
the options 'offset' and 'center' for the 'set ytics' command may be useful. rihii wrote: > > Everything worked great :) > > just had some glitches as i call gnuplot from C i use "this is the command > so insidme i have to use ' ' " > > another thing what i need to do is set the value of ticks on top of them, > is that possible? > i have been looking around but haven't found suitable solution... > > I need to do that because my data are very different, there is y range > from 0 to 25000 and more... > -- View this message in context: http://old.nabble.com/gnuplot-tics-tp33900443p34019022.html Sent from the Gnuplot - User mailing list archive at Nabble.com. |