Help with xyerrorbars

View: New views
5 Messages — Rating Filter:   Alert me  

Help with xyerrorbars

by Noora :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Dear all,

I am trying to plot a set of data from an experiment with xy errorbars. However, whenever I try to do this and export the file to jpeg or png, I can see the vertical and horizontal error bars on the first two data points only(see image). I have tried making the values larger and smaller to make sure that it's not just the scale that's making them impossible to see.

I used the load command in gnuplot to load the following .txt file

set terminal jpeg
set output "graph.jpeg"
set bars 0
set points 1
set multiplot title "The Current-Voltage Characteristics of the DSSCs" layout 2,1
set grid
set title "pH 1.0"
plot "pH1.txt" using 1:3 w linespoints, "pH1.txt" using 1:3:7:6 w xyerrorbars
unset title
set title "pH 3.0"
plot "pH3.txt" using 1:3 w linespoints, "pH3.txt" using 1:3:7:6 w xyerrorbars
unset title
unset multiplot


columns 7 and 6 include the delta x and delta y for my values for x and y.

(I am using Windows Vista.)

If anyone can offer any help at all I would be extremely grateful.

Thank you!

Re: Help with xyerrorbars

by Thomas Sefzick :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

what does your data files look like?

seems that there are no valid errorbar values starting from line '3'

Noora wrote:
Dear all,

I am trying to plot a set of data from an experiment with xy errorbars. However, whenever I try to do this and export the file to jpeg or png, I can see the vertical and horizontal error bars on the first two data points only(see image). I have tried making the values larger and smaller to make sure that it's not just the scale that's making them impossible to see.

I used the load command in gnuplot to load the following .txt file

set terminal jpeg
set output "graph.jpeg"
set bars 0
set points 1
set multiplot title "The Current-Voltage Characteristics of the DSSCs" layout 2,1
set grid
set title "pH 1.0"
plot "pH1.txt" using 1:3 w linespoints, "pH1.txt" using 1:3:7:6 w xyerrorbars
unset title
set title "pH 3.0"
plot "pH3.txt" using 1:3 w linespoints, "pH3.txt" using 1:3:7:6 w xyerrorbars
unset title
unset multiplot


columns 7 and 6 include the delta x and delta y for my values for x and y.

(I am using Windows Vista.)

If anyone can offer any help at all I would be extremely grateful.

Thank you!

Re: Help with xyerrorbars

by Noora :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Dear Thomas,

this is what my datafile "pH1.txt" looks like

#V A Photocurrent(mA/cm2) I short circuit V open current Uncertainty current
#Uncertainty vol
0.046 4.74 0.0901 0.45 0 0.01 0.01
0.086 4.74 0.0762 0 0.225 0.05 0.001
0.129 4.74 0.0586 0.002 0.001
0.146 4.74 0.0511 0.05 0.001
0.157 4.74 0.0458 0.05 0.001
0.167 4.74 0.0409 0.002 0.01
0.176 4.74 0.0359 0.002 0.001
0.184 4.74 0.0316 0.002 0.001
0.188 4.74 0.0293 0.002 0.001
0.193 4.74 0.0264 0.002 0.001
0.195 4.74 0.0243 0.01 0.001
0.199 4.74 0.0215 0.002 0.001
0.203 4.74 0.0190 0.002 0.01
0.204 4.74 0.0177 0.002 0.001
0.206 4.74 0.0169 0.002 0.001
0.206 4.74 0.0162 0.002 0.001
0.208 4.74 0.0154 0.002 0.001
0.209 4.74 0.0143 0.002 0.001
0.210 4.74 0.0133 0.002 0.001
0.211 4.74 0.0127 0.002 0.001
0.212 4.74 0.0120 0.002 0.001
0.212 4.74 0.0114 0.002 0.001
0.212 4.74 0.0110 0.05 0.001
0.212 4.74 0.0105 0.002 0.001
0.214 4.74 0.0095 0.002 0.001
0.215 4.74 0.0095 0.05 0.01


The uncertainty columns are the sixth and seventh column.
I would be very grateful if you could give me a hint. It's for a chemistry project and I really would like to make my graphs with gnuplot.
Thank you!



what does your data files look like?

seems that there are no valid errorbar values starting from line '3'

Noora wrote:
Dear all,

I am trying to plot a set of data from an experiment with xy errorbars. However, whenever I try to do this and export the file to jpeg or png, I can see the vertical and horizontal error bars on the first two data points only(see image). I have tried making the values larger and smaller to make sure that it's not just the scale that's making them impossible to see.

I used the load command in gnuplot to load the following .txt file

set terminal jpeg
set output "graph.jpeg"
set bars 0
set points 1
set multiplot title "The Current-Voltage Characteristics of the DSSCs" layout 2,1
set grid
set title "pH 1.0"
plot "pH1.txt" using 1:3 w linespoints, "pH1.txt" using 1:3:7:6 w xyerrorbars
unset title
set title "pH 3.0"
plot "pH3.txt" using 1:3 w linespoints, "pH3.txt" using 1:3:7:6 w xyerrorbars
unset title
unset multiplot


columns 7 and 6 include the delta x and delta y for my values for x and y.

(I am using Windows Vista.)

If anyone can offer any help at all I would be extremely grateful.

Thank you!


Re: Help with xyerrorbars

by Noora :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

sorry to clutter everyone's inbox, but here's the .txt file, which
contains the first set of my data
 uploadedpH1.txt

The columns for the error bars are the sixth and seventh column.

In addition, I am unable to access the gnuplot help, because my system will not allow it, so
please forgive me if I'm asking something that is thoroughly covered in the help section.

Re: Help with xyerrorbars

by Thomas Sefzick :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

this can not work, because in gnuplot the contents of one record in the
file are separated by whitespace (=one or more blanks or tabs)
this means starting from the 3rd record your data file contains
only 5 values per record:
<pre>
0.046 4.74 0.0901 0.45 0 0.01 0.01
0.086 4.74 0.0762 0 0.225 0.05 0.001
0.129 4.74 0.0586 0.002 0.001
0.146 4.74 0.0511 0.05 0.001
</pre>

set datafile missing "?"
and produce a new data file with this missing character
at the place of a missing values:
<pre>
0.046 4.74 0.0901 0.45 0 0.01 0.01
0.086 4.74 0.0762 0 0.225 0.05 0.001
0.129 4.74 0.0586 ? ? 0.002 0.001
0.146 4.74 0.0511 ? ? 0.05 0.001
</pre>

or,
set datafile separator "\t"
this should work because the values in your file are separated by
tab characters.

Noora wrote:
sorry to clutter everyone's inbox, but here's the .txt file, which
contains the first set of my data
 uploadedpH1.txt

The columns for the error bars are the sixth and seventh column.

In addition, I am unable to access the gnuplot help, because my system will not allow it, so
please forgive me if I'm asking something that is thoroughly covered in the help section.