What is the difference between AquaTerm and gnuplot.
Also is it true that Octave uses AquaTerm instead of X11?
I know AquaTerm might be more rendering of the actual graphic and gnuplot is probably the engine but what does that means?
AquaTerm is a graphics renderer. Basically, it is a library with an API with allows various programming languages to display graphics on the screen. gnuplot is a plotting utility. In a lot of ways, gnuplot functions like a special purpose programming language used for creating plots. It is able to write those plots to a whole bunch of different devices ("terminals"). examples of some devices are files (png, pdf, postscript) printers and graphics libraries (X11, AquaTerm). Ultimately, any graph that you can make with gnuplot + AquaTerm for the display on the backend could be made without gnuplot. Gnuplot's purpose is to abstract the details of the output device away from the user as much as possible so that if you make a plot and display it using AquaTerm, you can then easily save that plot to a png file for future reference. In reality, there are always some terminal dependent behaviours, but most of the time it doesn't actually matter.
Related
Plotting packages offer a variety of methods for displaying data. Write an interactive plotting application for two dimensionsional curves. Your application should be able to allow the user to choose the mode (line strip or polyline display of the data, bar chart or pie charts), colours, and line styles.
You should start with the GUI editation like this:
Does anyone know of a low level (no frameworks) example of a drag & drop, re-order-able list?
and change it to your primitives (more points per primitive instead of one ... handle each point as (sub)object so you can change its position later).
Then just add tools like add object,del object,... For hand drawing tool use piece wise interpolation cubics
The grid can be done like this:
How to draw dynamic 2D grid that adjusts according to camera zoom: OpenGL
Mouse zooming/panning is also important
Zooming graphics based on current mouse position
Putting all above together into simple editor looks like this:
Using GPU for curve rendering might give you some nice speed and functionality boost:
Is it possible to express "t" variable from Cubic Bezier Curve equation?
Mouse selection of objects might be a speed problem if your scene contains too many objects so in such case its best to use index buffers where you can mouse select with pixel perfect precision for almost free in O(1):
OpenGL 3D-raypicking with high poly meshes
The example is for 3D , in 2D is much simpler ...
Also do not forget to implement save/load functionality to some vector file format. I recommend using SVG it might be complicated to start with it but you can quickly check it contents in any SVG viewer or browser also in notepad as its just a text file. If you use just basic path elements and ignore the rest of SVG features you will see the parsing and creating SVG is not that hard for example See these:
Get Vertices/Edges From BMP or SVG (C#)
Discrete probability distribution plot with given values
For really big datasets you might want to use spatial subdivision techniques (Bounding (Volume)Area Hierarchy, or Quad tree) to ease up the operations...
More in depth implementation details about 2D vector gfx editors depends on language, OS, gfx api and GUI api you using and task you are aiming for ...
I am using plotting tool named 'Trend' with linux OS (Raspbian GNU/Linux 11 (bullseye)).
I am plotting live data from ADC to see (almost) real-time plot.
The problem I see is that after initial screen-wide plot, there is historic plot visible as well, which is disturbing.
How to get rid of the historic plot?
Picture of what I have, with real-time line and historic data line (the one which is faint on the left, coming stronger with progressing to the right side of the screen).
The manual of 'Trend' is somehow unfinished, and can be found under this link: https://www.thregr.org/~wavexx/software/trend/files/trend.1.html
It would be even better if there is more elaborated manual for 'Trend' tool. As you may guess google search for 'trend' brings all kind of trading, plotting and statistical results...
I'd like to improve the magnification of images (*.png) when they are exported in gnuplot. I had tried to increase the pixels of these images but when they are zoomed too many times, the quality is so bad. So could you please help me for this case.
Here are my commands for exporting the images *.png in gnuplot:
set term pngcairo transparent enhanced lw 2.2 \
font "Century,20" fontscale 1.2 size 1642,1140"
The problem you are facing is not related to gnuplot but to the bitmap nature of png images. Since these images are not vectorial, when you "zoom in" you simply increase the bit size, but not the resolution. The only way to solve this problem is to export to eps instead of png. There are a few terminals in gnuplot that you might be interested in. In my opinion the most powerful is the epslatex terminal: have a look at the documentation with help epslatex.
As mentioned by Miguel, likely the source of your problem is that by exporting a PNG you are exporting an array of pixels. When you zoom in you will start to see the individual pixels of your image.
Probably the best way to solve your problem is to export to some form of vector graphics. Take a look at EPS (side note: most journals will prefer if you submit a vector graphic rather then a PNG).
If you are certain you want to use PNG you should take a look at https://stackoverflow.com/a/9118990/2372604 which mentions changing your terminal to pngcairo to produce smoother results.
Another note to make, if your function is particularly noisy, you may need to increase the number of sample points, consider the command set samples 1000.
Besides the other answers, here are two other options:
increase terminal size (say 4000x3000), until you got something that looks good enough. PNG format is compressed so if most of the plot is white, it won"t add much bytes.
As already said, use a vector graphics format as terminal. The others suggest EPS, but is less common today than svg. The SVG terminal produces .svg files that can be easily post-processed with a tool such as Inkscape.
I have a frivolous question. Is there any way to use an image in lieu of points in gnuplot? For example, if I was plotting data about pasta consumption or something, I would have pictures of pasta (instead of usual gnuplot points).
Another option is to find a dingbats type of font with a suitable glyph. Then you can use "plot with labels" using that glyph as the label string. See for example the 5th plot in the demo
http://gnuplot.sourceforge.net/demo/stringvar.html
I haven't played around with this feature at all myself, however, there is:
http://gnuplot.sourceforge.net/demo/barchart_art.html
Which shows the use of png files on a bar chart (Note, that this feature was added in Gnuplot 4.5 -- I think). With a little creativity, it seems like you could use that feature to do what you're asking -- although it would require a whole bunch of plot commands so it might be useful to write a script to generate the gnuplot script (or use iteration depending on your dataset) -- Obviously your image files would have to be in a format that your version of gnuplot understands as well ...
A possible strategy may be the plot with rgbimage option in gnuplot.
See the second example over here: http://www.gnuplot.info/demo_4.2/image.html
If you relate the center option with your data points, this may be possible.
I'm looking for some tool/library that is able to draw simple 2d geometries from text file or programatically. I already found List of interactive geometry software but that not quite what I'm looking for. I would prefer something more similar in usage to graphviz or gnuplot. I already wrote some scripts for gnuplot but this tool has been designed for different purposes. Required functionality:
support for different kind of 2D geometries: points, segments, lines, circles, polygons
simple input type format maybe similar to postgis Well Known Text
support for objects additional data like tags and colors definition
output in common image format or some kind of interactive GUI (with zoom in/out and select object)
configurable grid
autoscale or draw in defined area
I will use it for testing geometry algorithms and don't want to reinvent the wheel.
Matplotlib. I'm not familiar with all the aspects of this Python library but I've heard it is pretty good.
To quote their introduction,
matplotlib is a python 2D plotting
library which produces publication
quality figures in a variety of
hardcopy formats and interactive
environments across platforms.
matplotlib can be used in python
scripts, the python and ipython shell
(ala MATLAB®* or Mathematica®†), web
application servers, and six graphical
user interface toolkits.
matplotlib tries to make easy things
easy and hard things possible. You can
generate plots, histograms, power
spectra, bar charts, errorcharts,
scatterplots, etc, with just a few
lines of code. For a sampling, see the
screenshots, thumbnail gallery, and
examples directory
(source: sourceforge.net)
>
For example, using "ipython -pylab" to
provide an interactive environment, to
generate 10,000 gaussian random
numbers and plot a histogram with 100
bins, you simply need to type
x = randn(10000)
hist(x, 100)
For the power user, you have full
control of line styles, font
properties, axes properties, etc, via
an object oriented interface or via a
set of functions familiar to MATLAB
users. The pylab mode provides all of
the pyplot plotting functions listed
below, as well as non-plotting
functions from numpy and
matplotlib.mlab.
Maybe dia, with it's SVG output option is what you're looking for? It can be scripted in Python.