albertxavier001 / gnuplot-cpp Goto Github PK
View Code? Open in Web Editor NEWAutomatically exported from code.google.com/p/gnuplot-cpp
Automatically exported from code.google.com/p/gnuplot-cpp
What steps will reproduce the problem?
1. cppcheck -a --style gnuplot-cpp/
2. Checking gnuplot-cpp-read-only/example.cc...
[gnuplot-cpp-read-only/gnuplot_i.hpp:553]: (style) Member variable not
initialized in the constructor 'Gnuplot::nplots'
[gnuplot-cpp-read-only/gnuplot_i.hpp:553]: (style) Member variable not
initialized in the constructor 'Gnuplot::two_dim'
[gnuplot-cpp-read-only/gnuplot_i.hpp:553]: (style) Member variable not
initialized in the constructor 'Gnuplot::valid'
[gnuplot-cpp-read-only/gnuplot_i.hpp:553]: (style) Member variable not
initialized in the constructor 'Gnuplot::gnucmd'
[gnuplot-cpp-read-only/gnuplot_i.hpp:563]: (style) Member variable not
initialized in the constructor 'Gnuplot::nplots'
[gnuplot-cpp-read-only/gnuplot_i.hpp:563]: (style) Member variable not
initialized in the constructor 'Gnuplot::two_dim'
[gnuplot-cpp-read-only/gnuplot_i.hpp:563]: (style) Member variable not
initialized in the constructor 'Gnuplot::valid'
[gnuplot-cpp-read-only/gnuplot_i.hpp:563]: (style) Member variable not
initialized in the constructor 'Gnuplot::gnucmd'
[gnuplot-cpp-read-only/gnuplot_i.hpp:583]: (style) Member variable not
initialized in the constructor 'Gnuplot::nplots'
[gnuplot-cpp-read-only/gnuplot_i.hpp:583]: (style) Member variable not
initialized in the constructor 'Gnuplot::two_dim'
[gnuplot-cpp-read-only/gnuplot_i.hpp:583]: (style) Member variable not
initialized in the constructor 'Gnuplot::valid'
[gnuplot-cpp-read-only/gnuplot_i.hpp:583]: (style) Member variable not
initialized in the constructor 'Gnuplot::gnucmd'
[gnuplot-cpp-read-only/gnuplot_i.hpp:604]: (style) Member variable not
initialized in the constructor 'Gnuplot::nplots'
[gnuplot-cpp-read-only/gnuplot_i.hpp:604]: (style) Member variable not
initialized in the constructor 'Gnuplot::two_dim'
[gnuplot-cpp-read-only/gnuplot_i.hpp:604]: (style) Member variable not
initialized in the constructor 'Gnuplot::valid'
[gnuplot-cpp-read-only/gnuplot_i.hpp:604]: (style) Member variable not
initialized in the constructor 'Gnuplot::gnucmd'
The member variables of class Gnuplot are not initialized with default
variables in the constructors. If have modified the code, now they are
intialized.
PS: I used the static code analyis tool cppcheck to find this issues.
http://cppcheck.wiki.sourceforge.net/
I have attached the modified file (gnuplot_i.hpp)
The modified version was tested on Ubuntu Linux 8.10. With gcc-4.3.2 with
no errors or warnings.
Best Regards
Ettl Martin
What version of the product are you using? On what operating system?
Please provide any additional information below.
Original issue reported on code.google.com by [email protected]
on 7 Mar 2009 at 10:24
Attachments:
I am sorry to abuse the issue-tracker, but I could not find any other way
to contact the project owners (guess I have missed the point somewhere).
Thanks for continue maintainment of gnuplot_i++ (and to
Rajarshi Guha for porting it in the first hand).
I use it for a small project for easy plotting, but find it a bit overhead
to make a svn checkout to be able to use it (not that it is difficult, just
inconvenient :) ).
Would you be so kind and provide a tarball to download?
Enjoy
-- Felix
Original issue reported on code.google.com by [email protected]
on 12 May 2009 at 4:24
What steps will reproduce the problem?
1. Plot some data
2. Right click on plot to create zoom box
What is the expected output? What do you see instead?
From a gnuplot script with the x11 window, right clicking should create a box
which zooms in on the plot. Instead the gnuplot interpreter errors.
Example:
Just plotting sin(x) gives me
plot sin(x) title "f(x) = sin(x)" with linesr[0.0124240021147:0.536875495638];
set x2r[-7.05945:-1.74612]; set y2r[ 0.0124164: 0.536545]
"linesr[...]" is not a valid plotting command, so the program does not zoom and
breaks.
What version of the product are you using? On what operating system?
v1.0 on linux x86_46
Original issue reported on code.google.com by [email protected]
on 11 Aug 2010 at 2:00
What steps will reproduce the problem?
1.
2.
3.
What is the expected output? What do you see instead?
if the Gnuplot path contains a blank like "C:/program files/gnuplot/binary"
the creation of the pipe fails
What version of the product are you using? On what operating system?
Version 1.0 on MinGW on Windows 7 professional
Please provide any additional information below.
If I install the gnuplot directory under, say, C:\MinGW it works.
Still, it keeps all gnuplot terminals open.
Thanks for looking into it,
Helmut.
Original issue reported on code.google.com by [email protected]
on 21 Jul 2011 at 3:34
What steps will reproduce the problem?
- Not applicable
What is the expected output? What do you see instead?
- Not applicable.
What version of the product are you using? On what operating system?
- Gentoo Linux amd64, 2.6.31
Please provide any additional information below.
- I checked out head from svn today (03 Dec 2009) and am finding this code
very useful. After going through the code, I find that all plot functions
use templates for storing data variable; however the [] operator used to
access individual data elements restricts templates to those containers
that define the [] operator (such as std::vector). It might be more useful
if elements are accessed using iterators instead as it will allow use of
greater range of containers.
Original issue reported on code.google.com by [email protected]
on 3 Dec 2009 at 5:49
make
g++ -c -ggdb -W -Wall -ansi -pedantic -DDEBUGGA example.cc
example.cc:27: warning: unused parameter ‘argc’
example.cc:27: warning: unused parameter ‘argv’
g++ -c -ggdb -W -Wall -ansi -pedantic -DDEBUGGA gnuplot_i.cc
gnuplot_i.cc: In member function ‘Gnuplot& Gnuplot::plot_image(const
unsigned char*, unsigned int, unsigned int, const std::string&)’:
gnuplot_i.cc:848: warning: comparison between signed and unsigned integer
expressions
gnuplot_i.cc:850: warning: comparison between signed and unsigned integer
expressions
gnuplot_i.cc: In member function ‘bool Gnuplot::file_available(const
std::string&)’:
gnuplot_i.cc:1111: warning: control reaches end of non-void function
g++ -o example -ggdb -W -Wall -ansi -pedantic example.o gnuplot_i.o -lstdc++
I have attached the modified file.
Best regards
Ettl Martin
Original issue reported on code.google.com by [email protected]
on 13 Mar 2009 at 9:47
Attachments:
What steps will reproduce the problem?
1. compile with -ansi -pedantic -Wall using clang++
2. compile with -ansi -pedantic -Wall using g++
3.
What is the expected output? What do you see instead?
Expected output is to have no warnings or errors. Instead, I see:
$ clang++ -ansi -pedantic -Wall example.cc
In file included from example.cc:10:
./gnuplot_i.hpp:259:64: warning: extra ';' inside a class [-pedantic]
inline Gnuplot& unset_smooth(){ smooth = ""; return *this;};
^
./gnuplot_i.hpp:266:63: warning: extra ';' inside a class [-pedantic]
inline Gnuplot& set_grid() {cmd("set grid");return *this;};
^
./gnuplot_i.hpp:268:66: warning: extra ';' inside a class [-pedantic]
inline Gnuplot& unset_grid(){cmd("unset grid");return *this;};
^
./gnuplot_i.hpp:277:73: warning: extra ';' inside a class [-pedantic]
inline Gnuplot& set_multiplot(){cmd("set multiplot") ;return *this;};
^
./gnuplot_i.hpp:286:76: warning: extra ';' inside a class [-pedantic]
inline Gnuplot& unset_multiplot(){cmd("unset multiplot");return *this;};
^
./gnuplot_i.hpp:302:63: warning: extra ';' inside a class [-pedantic]
Gnuplot& set_hidden3d(){cmd("set hidden3d");return *this;};
^
./gnuplot_i.hpp:311:75: warning: extra ';' inside a class [-pedantic]
inline Gnuplot& unset_hidden3d(){cmd("unset hidden3d"); return *this;};
^
./gnuplot_i.hpp:323:72: warning: extra ';' inside a class [-pedantic]
inline Gnuplot& unset_contour(){cmd("unset contour");return *this;};
^
./gnuplot_i.hpp:332:68: warning: extra ';' inside a class [-pedantic]
inline Gnuplot& set_surface(){cmd("set surface");return *this;};
^
./gnuplot_i.hpp:409:101: warning: extra ';' inside a class [-pedantic]
...xrange restore");cmd("set autoscale x");return *this;};
^
./gnuplot_i.hpp:418:101: warning: extra ';' inside a class [-pedantic]
...yrange restore");cmd("set autoscale y");return *this;};
^
./gnuplot_i.hpp:427:101: warning: extra ';' inside a class [-pedantic]
...zrange restore");cmd("set autoscale z");return *this;};
^
./gnuplot_i.hpp:444:78: warning: extra ';' inside a class [-pedantic]
inline Gnuplot& unset_xlogscale(){cmd("unset logscale x"); return *this;};
^
./gnuplot_i.hpp:453:78: warning: extra ';' inside a class [-pedantic]
inline Gnuplot& unset_ylogscale(){cmd("unset logscale y"); return *this;};
^
./gnuplot_i.hpp:462:78: warning: extra ';' inside a class [-pedantic]
inline Gnuplot& unset_zlogscale(){cmd("unset logscale z"); return *this;};
^
./gnuplot_i.hpp:563:78: warning: extra ';' inside a class [-pedantic]
inline Gnuplot& replot(void){if (nplots > 0) cmd("replot");return *this;};
^
./gnuplot_i.hpp:582:43: warning: extra ';' inside a class [-pedantic]
inline bool is_valid(){return(valid);};
^
./gnuplot_i.hpp:1874:1: warning: control may reach end of non-void function
[-Wreturn-type]
}
^
18 warnings generated.
g++ also generates warnings, but not as many:
$ g++ -ansi -pedantic -Wall example.cc
In file included from example.cc:10:
gnuplot_i.hpp: In member function ‘Gnuplot& Gnuplot::plot_image(const
unsigned char*, unsigned int, unsigned int, const std::string&)’:
gnuplot_i.hpp:1600: warning: comparison between signed and unsigned integer
expressions
gnuplot_i.hpp:1602: warning: comparison between signed and unsigned integer
expressions
gnuplot_i.hpp: In member function ‘bool Gnuplot::file_available(const
std::string&)’:
gnuplot_i.hpp:1874: warning: control reaches end of non-void function
[kmess@bellagio gnuplot-cpp]$
What version of the product are you using? On what operating system?
version 3, dated 10/03/08
$ uname -a
Linux bellagio 2.6.32-358.6.2.el6.centos.plus.i686 #1 SMP Thu May 16 17:02:17
UTC 2013 i686 i686 i386 GNU/Linux
$ g++ --version
g++ (GCC) 4.4.7 20120313 (Red Hat 4.4.7-3)
Copyright (C) 2010 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
$ clang++ --version
clang version 2.8 (branches/release_28)
Target: i386-redhat-linux-gnu
Thread model: posix
Please provide any additional information below.
Original issue reported on code.google.com by [email protected]
on 30 May 2013 at 6:25
There is a problem in your gnuplot_i.hpp. In particular you incur in a
multiple definition problem in linking phase if you
1. create two or more .h / .cpp file where you include and use the library
2. this two or more file are part of a single project (executable)
3. compile, you get the multiple definition error
Why it occurs?
Because in the .hpp you use normal function definition instead than only
inline function definitions. Moreover some variables are duplicated in the
linking phase (the part under // initialize static data) and the functions
after (
//------------------------------------------------------------------------------
//
// define static member function: set Gnuplot path manual
// for windows: path with slash '/' not backslash '\'
//
)
A trivial solution consist in cut and paste these two section and save them
in a separate .cpp file.
Original issue reported on code.google.com by [email protected]
on 11 Oct 2009 at 4:13
Attachments:
What steps will reproduce the problem?
1. Unix-like system, plot_xy.
2. using a for loop to plot/reset_plot(), it return
*************************************************
terminate called after throwing an instance of 'GnuplotException'
what(): Cannot create temporary file "/tmp/gnuplotiXXXjloUiy"
*************************************************
after 1020(I have tried, always 1020) draw.
3.
What is the expected output? What do you see instead?
The gnuplot should keep plot the figure, but it can't create temporary file
then terminate.
What version of the product are you using? On what operating system?
OS: ArchLinux 3.8.5 i686
My gnuplot is v4.6 patchlevel 2
Please provide any additional information below.
Original issue reported on code.google.com by [email protected]
on 8 Apr 2013 at 4:02
What steps will reproduce the problem?
See bugtest.cpp in the attached archive.
What is the expected output? What do you see instead?
Use the makefile in the attached archive to make bugtest-pass and
bugtest-fail. Running bugtest-pass will show the expected output and
bugtest-fail will show the output resulting from the bug. You may also just
view the contents of bugtest-pass.output and bugtest-fail.output, which are
also included in the archive.
What version of the product are you using? On what operating system?
Version 1.0, released May 2009. Running on Fedora Core 10 Linux with the
2.6.27.41-170.2.117.fc10.x86_64 kernel and GCC version 4.3.2 20081105 (Red
Hat 4.3.2-7)
Please provide any additional information below.
This bug is a result of the fact that the mkstemp() POSIX function call on
line 1921 of gnuplot_i.hpp in the 1.0 version of the product opens the
generated path for reading and writing, but that file descriptor is not
subsequently closed. The Linux operating system limits the number of open
file descriptors each process can have, and therefore, once the product has
opened enough temp files to exceed the limit, it receives a “Too many open
files” error.
It does not appear that the similarly used WIN32 call on line 1919 opens
the file, meaning that this bug should not affect the WIN32 platform. For
details about the POSIX and WIN32 calls, see
http://www.opengroup.org/onlinepubs/009695399/functions/mkstemp.html and
http://msdn.microsoft.com/en-us/library/34wc6k1f(VS.80).aspx respectively.
The attached archive contains the following files:
* bugtest.cpp
* bugtest-fail.output
* bugtest-pass.output
* gnuplot_i.hpp
* gnuplot_i.hpp.patch
* gnuplot_i_fixed.hpp
* Makefile
The bugtest.cpp file, as discussed above, provides sample code that will
identify the bug.
The bugtest-fail.output contains the expected output of the bugtest-fail
executable.
The bugtest-pass.output contains the expected output of the bugtest-pass
executable.
The gnuplot_i.hpp file contains the 1.0 version of the product.
The gnuplot_i.hpp.patch file contains a patch that fixes the bug.
The gnuplot_i_fixed.hpp file contains the 1.0 version of the product with
the patch applied to fix the bug.
The Makefile can be used to make the bugtest-fail and bugtest-pass
executables that demonstrate the expected and received output, respectively.
Original issue reported on code.google.com by [email protected]
on 31 Mar 2010 at 9:29
Attachments:
What steps will reproduce the problem?
1. running example on a macos 10.8
2.
3.
What is the expected output? What do you see instead?
I see:
gnuplot> set terminal aqua
^
line 0: unknown or ambiguous terminal type; type just 'set terminal' for a list
on typing set terminal .. aqua is not even in list
What version of the product are you using? On what operating system?
latest trunk
Please provide any additional information below.
Original issue reported on code.google.com by [email protected]
on 21 Oct 2013 at 12:46
I have a loop in my program and at each iteration I'm creating a plot that
is displayed. But since there are more than GP_MAX_TMP_FILES iterations I
get an exception. How do I properly clean up the temporary files in each
iteration?
What steps will reproduce the problem?
1. Create more than GP_MAX_TMP_FILES plots.
What version of the product are you using? On what operating system?
I'm using the latest version running on linux.
Original issue reported on code.google.com by [email protected]
on 23 Oct 2009 at 8:20
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.