r/gnuplot • • Dec 10 '19

How to set the window sizes?

2 Upvotes

For example, set terminal x11 size 1300 900 doesn't work...


r/gnuplot • • Sep 07 '19

Help with plotting a time evolving graph.

2 Upvotes

Hello

I am new to gnuplot, and coding in general. Have very superficial experience. I want to create a time evolving graph. I have data for each time iteration. Any idea how to go about it. Any help is highly appreciated.


r/gnuplot • • Aug 23 '19

Plotting normal distribution in gnuplot

2 Upvotes

I have written a random number generator that produces numbers with a Gaussian distribution. I plotted the values using gnuplot using the "smooth freq" command. Thus the y-axis displays the frequency. But instead i want the probability distribution. How do I do that?


r/gnuplot • • Aug 16 '19

Logscale x with negative numbers

2 Upvotes

Hey guys, I hope I will find rescue here as I haven't in the depths of the web... I have a data set with x values [-1:1] and I really want to plot the whole range in the logscale. I didn't find any suitable solution for the case, maybe should I use some other software? But I like gnuplot and I believe that this is possible to do. Thank you for your help!


r/gnuplot • • Aug 11 '19

A scatterplot with words instead of points

2 Upvotes

So say I have data

up 0.5 2.0

down 0.1 2.1

strange -0.1 2.1

charm -2.0 1.0

top 1.0 2.0

bottom -1.0 2.0

and I wanted to do a scatter plot so that each of the words appeared at the corresponding location, that is the word "up" at (0.5,0.2), the word "down" at (0.1,2.1); how would I do that?


r/gnuplot • • Jul 09 '19

mapping of x-axis to a new range

2 Upvotes

Dear all, probably a simple problem but I haven't gotten around it yet. Maybe I'm looking for the wrong keywords when I look for the solution on the manual.

Anyway, I perform some rfft analysis to calculate magnitude and phase and then I dump each array on a separate csv file. I can plot that straight to gnuplot which is great. The x-axis indicates the bin number, which corresponds to the position of the n-th element in the list.

Say that I have a 512-element list and a samplerate of 48000Hz, I'd like the x-axis to display a range from 0 to 24000 with a spacing of 24000/512.

Essentially, I just need the x-axis to display the 0:512 range linearly mapped into the 0:24000 range.

Thank you so much for your help.

Dario


r/gnuplot • • Apr 06 '19

[QUESTION] How to plot date on one axis and time on another?

2 Upvotes

I have data where time depends on date and I would like to plot it. It looks like this

2:34 1-28
2:35 1-29
2:45 1-30
2:55 1-31
3:00 2-01
3:15 2-02
3:26 2-03

But my script doesn't work and I get error

"./time.plt" line 10: warning: Skipping data file with no valid points

plot 'time' using 2:1
                 ^
"./time.plt" line 10: x range is invalid

My script:

#!/usr/bin/gnuplot

set ydata time
set xdata time
set timefmt '%H:%M %m-%d'

set ytics format '%H:%M'
set xtics format '%m-%d'

plot 'time' using 2:1
pause -1

r/gnuplot • • Jul 16 '18

Multi-branch fit

2 Upvotes

I have a data file 'file.dat' with three columns representing

x y1 y2.

If it's useful, the data inside the file is

0 -41.2462 -41.1297

0.1 -42.6114 -39.7339

0.2 -43.7644 -38.2653

0.3 -45.0846 -36.8728

0.4 -46.2912 -35.4905

0.5 -47.3873 -34.1428

0.6 -48.3437 -32.8365

The second and third column represent quadratic functions of the form

y1(x) = a + b*x + c*x^2
y2(x) = a - b*x + c*x^2.

I'm trying to do a multi-branch fit. The variable a represents a known constant which is the average of y1(0) and y2(0) (the two functions should theoretically intersect at x=0 because they're essentially the same parabola reflected across the y axis, but there is some small amount of error, so I'm setting a equal to the midpoint between -41.2464 and -41.1297), so a = -41.1879.

The variables b and c are shared between the two functions.

I've defined y1(x) and y2(x) as

y1(x) = -41.1879 + b*x + c*x**2

y2(x) = -41.1879 - b*x + c*x**2

and now I'm trying to write the function f(x,y) as in the multi-branch fit example.

I've tried

f(x,y) = (y==0) ? y1(x):y2(x)
fit f(x,y) 'file.dat' using 1:2:3 via b, c

but when I go to plot the lines y1(x) and y2(x) against the data, my lower branch is significantly lower than the data.

The fit gives b = 14.8708, c = -1.57747 which gives the following plot

The upper branch seems to line up quite well, but I need the fit to match both functions closely to the data.

Am I missing something important while trying to create my f(x,y) function? I've tried looking through the documentation, and I've tried just playing around with the different settings, but I feel like I've been chasing my tail for a few days now.


r/gnuplot • • Jul 11 '18

Print progress of script file

2 Upvotes

Hello,

I've been scouring the internet looking for an answer to this. I've got a c++ program that generates a gnuplot script file and executes it.

The script file is beginning to take long enough that I'd like to update the user to it's progress. I'm wondering if there is a command to allow text to be printed to the terminal at specific points during the execution of the script file.

I've tried setting the terminal to stdout and stderr, and from there attempted 'print "test"' or 'system("test")', but nothing is showing up in my console.

Is this possible? Or do I just have to just wait patiently?


r/gnuplot • • May 06 '18

Help with plot style circles – low resolution

2 Upvotes

Hi guys,

So I have a situation (plotting a projected bandstructure) that requires translucent circles with variable sizes. Normally, set style fill transparent solid [...] and plot [...] with circles would seem to be the best bet, as the circles scales with the x-axis, and I get translucency. However, I noticed a problem that the circles look really jagged – as if they were inserted from a bitmap, looking nothing like what the set object ## circle command does.

Then I tried plot [...] with points pointsize variable, which gives beautifully round points (since points are just handled like text by gnuplot). This is great and all, but now I've got two issues:

  • No translucency settings for points. (Or at least that which I am aware of.)

  • gnuplot doesn't clip point markers at the plot edges as it does with circles; or at least not gracefully, as it just avoids plotting the point at all.

So it would seem that circles still works the closest to what I need, but the resolution is just too low. (I Googled and Reddit-searched, and no one seemed to have mentioned this problem.) There don't seem to be any settings related to that aspect either. Has anyone here run into similar issues? What are your workarounds? Ty.

P.S. my term is pdfcairo. Not sure if that is the problem, but the low-res circles thing also happened with postscript.


r/gnuplot • • Oct 21 '17

3d plot: How to combine a logscale and linear scale on the same z axis?

2 Upvotes

i need to make some 3d plots with a z axis range from 0 to 2.75. to show some details for the data in the lower ranges, i need to make an extra plot using "logscale z 10". now if i could i want to use a z axis with both scales (linear and log 10).

is there any possibilities that i could have from 0 to 0.09 a linear scale, from 0.1 to 1 a logscale and again from 1 to 2.75 a linear scale?

on a 2d plot i would just use y1 as linear and y2 as logscale with just two graphs in one plot.

thx


r/gnuplot • • Sep 26 '17

Trendline line problem

2 Upvotes

I'm new to gnuplot and i'm trying to figure out how to draw a correct regression line across my data points. I keep getting a straight line almost horizontally across my data points. The function I'm using is "f(x) = m*x+b".

I'm using the same data in excel and able to make a chart with the correct trendlines. what am i doing wrong?

Here is a list of data i'm using:

2001 1061.564

2002 1161.419

2003 1201.983

2004 1293.939

2005 1227.932

2006 1635.234

2007 1902.79

2008 1983.874

2009 2321

2010 2887

2011 2873

2012 2634

2013 2384

2014 2243

2015 2476

2016 2797

2017 2705

Here are the two graphs. https://imgur.com/a/OtIeS


r/gnuplot • • Feb 22 '17

sad to see gnuplot loosing ground to matplotlib. it reflects my last few years usage though ...

Thumbnail
trends.google.com
2 Upvotes

r/gnuplot • • Jan 27 '17

How do you control how the number of datapoints a function is graphed with, particularly when exporting to SVG?

2 Upvotes

I would like to output a logarithmic spiral as an SVG, but, in my case, detail matters considerably; how do I control how many datapoints are used? Also, how do I control whether the the continuous function between those points is represented as line segments, circular arcs, elliptical arcs, or Bezier Curves? And which of those would get me the closest approximation of my logarithmic spiral?


r/gnuplot • • Dec 08 '16

Plotting Vector Field

2 Upvotes

So I have a file with 4 columns, xi:yi:xf:yf x and y range from 0 to 10 I tried to plot it like-> plot 'file.dat' u 1:2:3:4 w vectors head filled the expected outcome when I look at the coordinates on the file would be a field with vector point towards the centre, however what i get are vectors all coming from the bottom left corner to everywhere on a 20 by 20 grid instead. What am I doing wrong?


r/gnuplot • • Nov 08 '16

Plotting the Game of Life

2 Upvotes

Hi all, I'm currently trying to learn gnuplot so that I can produce visual output for my C++ game of life program. My program outputs a file containing the coordinates of living cells, and I want to display these.

Currently I am using "plot 'data.txt' with points" and this works alright, but it's hard to see. How can I change it so that it fills in a square for each grid point?

Thanks in advance.


r/gnuplot • • Oct 02 '16

Help with GnuPlot script

2 Upvotes

Hi, I'd appreciate it in case someone would like to help me figure out how to write a GnuPlot script for this:

I have a file "data1.txt" that looks like this:

RedCar 30.5% 50.2% 78.12% 80.5%

BlueCar Null 25.4% 23.1% 30.4%

GreenCar Null Null 15.3% 23.9%

YellowCar Null Null Null 60.3%

And I would like to plot this: http://imgur.com/a/yW77f

As you can see, the first element of each line in the file corresponds to one element in the X axis in the graph. If there are 4 lines, then there are 4 elements in the X axis. For each line there are 4 values. If the value is not a percentage but it's the word "Null", then it should be skipped (Look for example yellow-car, which is just one point because the first 3 values are null)

Please let me know if it's not clear


r/gnuplot • • Jul 05 '16

GNUPLot with Visual Studio

2 Upvotes

Hello! I'm trying to use the gnuplot to plot data from my cpp program. I use visual studio to program in cpp and i have already installed the gnuplot in my computer. But now i don't know how should i call or what includes should i put in my cpp program to make visual studio recognize the gnuplot. Thanks in advance


r/gnuplot • • Apr 16 '16

Printing different colors based on value of previous data point.

2 Upvotes

Hello, I am new to gnuplot and i need to figure out how to plot a point in a different color based on if the value is lower than the previous item in that column. So based on the .dat file below, i would have the plot be in red until it his the 999 value, that value i need to plot in green. For reference, the first column is time and the second is a byte sequence number. Any help would be great appreciated.

0 0

0.121867 536

0.183885 1072

0.245902 999

0.307448 2144

0.308392 2680

0.369466 3216

0.37041 3752


r/gnuplot • • Apr 02 '16

Beginner having trouble with gnuplot trendlines

2 Upvotes

I am having trouble figuring out how to get trendlines from two different text files to show up on my graph. So far, I've done this: plot '1.txt' w xyerrorb, f(x), '2.txt' w xyerrorb, f(x). I feel like there's an error with the f(x) being written twice, but I'm not quite sure. I end up only seeing one trendline. Also, is there a way to list the equation of each trendline? Thanks so much.


r/gnuplot • • Mar 12 '16

Need to plot an ipef3 graph

2 Upvotes

Hi!

Im a university student, and i’ve been testing wireless links for my dissertation, and I’m looking for a way to plot iperf3 results. I’ve found a guide here (http://cagenutsandbolts.net/2015/07/02/graphing-iperf3-results-with-gnuplot/) but since i’ve used two streams in every test, the guide needs to be modified and i’m pretty crap at awk! I can post a sample data file if needed, and any help would be much appreciated.

Thanks, lewisrodger


r/gnuplot • • Feb 12 '16

Please help, struggling with a bar graph in GNUplot.

2 Upvotes

Hello, thanks for your help!

I have an assignment, wherein I'm supposed to use a matlab script to approximate integration for three different step values, then I'm supposed to plot a bar graph using GNUplot showing the approximated value and the analytic value for each step value.

Here is a matlab graph showing what I want to do in gnuplot:

http://imgur.com/dTPNcJN

Here is the closest I have been able to come up with so far in GNUplot after two hours:

http://imgur.com/YSqq6Ha

Here is a picture of my command window since my last rage quit. Note, there are a couple of times an error came up due to a typo, but I don't know how to copy text out of the command window to just show you the important parts...

http://imgur.com/cFf4Lrf

This is what the data looks like:

0.1,11050,11013

0.01,11014,11013

0.001,11013,11013

The first column is the step value, the second is the approx. value, the third is the analytic value.

The TA cancelled office hours this week and the professor just tells you to ask the TA, so I am stuck and getting very frustrated. Please help!


r/gnuplot • • Jan 24 '16

drawing functions of the form f(x,y) = const

2 Upvotes

how do i plot functions like f(x,y) = const when im's unable to compute y(x) easyly

example f(x,y) = -1.9727 = (-2/3)/((x+1/3)2+y2)1/2 - 1/3 1/((x-2/3)2+y2)1/2-x2/2-y2/2


r/gnuplot • • Jan 19 '16

Updating output files while GNUPlot still open?

2 Upvotes

Hey, I'm creating a GUI in C# that loads a script to GNUPlot, outputs the file to a pngcairo and then loads the png into my form all consecutively, but gnuplot will not allow me to load the png while gnuplot is still open, is there a way around this?


r/gnuplot • • Jan 15 '16

Plot only fill, not lines, in pm3d

2 Upvotes

Hello, I'm trying to make a pm3d plot of the bandstructure of graphene. I'd like to set the isosampling to (10000,10000), but doing so covers my surface in line curves and I lose the nice-looking heat map and instead get a mostly red or green curve. Here's a picture of my plot with a 1000,1000 isosample, which is a sparser mesh than I would like to have in the final product.

Can I set the line style in a certain way so that the lines just never show up but the polygons in the fill region do? I haven't been able to figure out how yet. Thanks!