r/gnuplot • u/berlengas • Nov 01 '18
r/gnuplot • u/huijunchen9260 • Nov 08 '23
Plotting binary data in gnuplot
Hi all, I would like to ask questions about gnuplot regarding reading and plotting binary data that is generated by unformated Fortran write.
Usually if I want to do plotting over a Y(:, :) matrix on X(:) vector, I would put X(:) at the first column and Y(:,:) at the second and third column in a .dat file and write a simple script in gnuplot to plot the 2D figures.
If now both the X(:) and Y(:,:) are stored in binary, can I use gnuplot alone and plot those? Do I need to provide the dimensions of the X(:) and Y(:,:) to read into gnuplot?
Thanks!
r/gnuplot • u/AlchemicRez • Nov 28 '23
About manipulating strings.
I can't seem to figure out how to replace substrings such as the underscore "_".
Alternately, I'm not sure how to tell gnuplot not to recognize the underscore as formatting markup.
I'm doing the following:
myString = "Something_I_Made_Up"
set label 99 myString at 0,0Looks like the image i uploaded where the underscores create a subscript.
Thanks in advance and have a wonderful day.

r/gnuplot • u/McDonaldsPatatesi • Mar 13 '21
Gnuplot pm3d plots “inf” value white
I'm using these options to plot my 3D map of energy surface.
set cbrange [-60:60]
set palette maxcolors 13 model RGB defined (0 "#0ab3f7",1 "#4dabec",2 "#6da2df", 3 "#8599d3", 4 "#9a8fc5",5 "#ac84b6", 6 "#bc79a7", 7 "#cc6c95", 8 "#da5d81",9 "#e74c69", 10 "#f3364a", 11 "#f4344 7", 12 "#ff0000")
set cbtics ("-50" -50, "-40" -40, "-30" -30 , "-20" -20, "-10" -10, "0" 0, "10" 10, "20" 20, "30" 30, "40" 40, "50" 50, "inf" 60)
But can't give inf values any color. How can i do that ? plot1
r/gnuplot • u/[deleted] • Mar 03 '23
How the heck do you plot functions of y in gnuplot?
I've tried "f(x)=sin(x)" then "plot f(x)", which plots functions of x. But when I try "f(y)=sin(y)" then "plot f(y)" it doesn't work
r/gnuplot • u/meslier1986 • Jun 18 '17
Basic question about 3d plot
Here's a 3d plot of some numerical data prepared in gnuplot: http://imgur.com/a/PUh7h
I'd like to make this image more presentable, while retaining the small scale features on the left hand side of the plot. Question: How can I accomplish that?
r/gnuplot • u/msnjuegos • Mar 25 '18
How plot a profile velocity in a pipe landscape?
Hi! I have a problem plotting a profile of velocity in a horizontal pipe. I have the data in a file separated by blocks with this form:
# i j u(i,j) Where i is the position X of the pipe, j is position along Y and u(i,j) is a scalar with the velocity for each node i,j,. So I need plot something like this image but for each node i. The plot will have nx profiles, with nx the number of poitns along X. Actually I have plot y vs velocity, I don't know how plot vectors in X-Y plane. Any helps?
My data file https://pastebin.com/Mxh3h143
My gnuplot file https://pastebin.com/fJhfxQ4d
EDIT: formatt ing
r/gnuplot • u/Shashi_25 • Jul 12 '16
Linking GnuPlot with Visual Studio
Hey,
I'm trying to use the gnuplot to plot a simple graph with the data from my cpp program.
I use visual studio 13 to program in cpp and i have already installed the gnuplot 5.0 x64 mingw 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.
I would be really grateful if someone could help me out with this.
r/gnuplot • u/nwj781 • Jan 15 '16
Plot only fill, not lines, in pm3d
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!
r/gnuplot • u/CascadingBites • Feb 24 '18
Gnuplot keeps rendering #FFFFFF as green (see x and y labels and tics). Any way to fix that?
r/gnuplot • u/bobhwantstoknow • Jun 10 '16
Can gnuplot's svg output include coordinate info?
Hello,
I've created a simple plot and outputted it in svg format. But when I open the svg file in InkScape it is centered on the page. Is there a way to force the center of the plot to appear at the top left (0,0) of the page?
r/gnuplot • u/Kaligule • Mar 16 '15
Gnuplot is drawing dead fish
So there is this video about drawing dead fish. tldr: In a medium where we expect things to react to each other (like computer) a static picture is not take advantage of the opportunities delivered by this medium. So using a picture instead of a video (or video instead of a dynamic animation) might waste the opportunity of giving a deeper understanding of what you want to tell.
I am certain pictures of plots do have a place in our papers and gnuplot is good at generating this pictures. But when I want to express data in a more (inter-)active way, what tools are there to do this?
r/gnuplot • u/timunas • Mar 12 '15
How to use gnuplot in visual studio?
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 • u/bariumbitmap • Nov 10 '15
Is there a jupyter kernel for gnuplot? (x-post from r/ipython)
I would like to use gnuplot directly in an IPython/Jupyter notebook, not through a Python or Octave wrapper.
However, gnuplot is not on the list of Jupyter kernels:
https://github.com/ipython/ipython/wiki/IPython-kernels-for-other-languages
Has this already been done somewhere?
r/gnuplot • u/pedrolopes7682 • Dec 08 '16
Plotting Vector Field
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 • u/lewisrodger • Mar 12 '16
Need to plot an ipef3 graph
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 • u/ceeg3 • Dec 27 '17
newbie help with color plotting
I'm trying to plot data on a graph and be able to change the color. I seem to be failing at this despite reading multiple sources of information. Any help would be appreciated
Gnuplot V 5.2 patch 2
Heres my code:
set terminal postscript set palette set style line 1 lt 1 linecolor rgb "red" lw 1 set style line 2 lt 1 linecolor rgb "orange" lw 1 set style line 3 lt 1 linecolor rgb "yellow" lw 1 set output 'absorption.eps' set datafile separator "," set title "Total absorption" set ylabel 'abs.' set xlabel 'nm' plot 'cyclohexane_air_abs.txt' with lines linestyle 1,
'EJ309_air_abs.txt' with lines linestyle 2,
'EJ309_cyclohexane_abs.txt' with lines linestyle 3
I'm running it by typing 'gnuplot total_abs.gnu' and it runs fine, graphs everything but all the lines are black. I can't seem to get the colors to show
Am I missing something stupid?
r/gnuplot • u/Metalwater78 • Oct 02 '16
Help with GnuPlot script
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 • u/Pegguins • Aug 07 '15
Contour from a data file
Hi,
I have a datafile in the format;
x y +-1where (x,y) are coordinates and +-1 corresponds to a point I want to plot vs one I dont. As an example of part of the data the splot looks like; http://imgur.com/o3VDYJH . What I want to do is draw the contour around the data at +1. The net result being that I'll get an outline of the following plot; http://imgur.com/hQeP0Ah .
I just cant seem to get things working at the moment. Using gnuplot 4.4.
r/gnuplot • u/Philip_Pugeau • Sep 21 '16
Can gnuplot accept 3 or more time parameters?
I'm looking to plot this surface in 3D:
x(t,u,v) = ((cos(u)+2)cos(v))cos(a) + ((sin(u)+2)cos(t))sin(a)
y(t,u,v) = ((cos(u)+2)cos(v))sin(a) - ((sin(u)+2)cos(t))cos(a)
z(t,u) = (sin(u)+2)sin(t)
but, I'm having a hard time finding a program that can plot 3 time parameters.
r/gnuplot • u/[deleted] • Jun 12 '21
label not clearing and updating?
Hi, I'm having a bit of trouble getting a label to update. I'm using the following file to plot results being generated by a CFD simulation, with the plot being updated every 15 seconds.
I'd like the label to show the latest exact value and it does this but only initially, failing to update. The plot however does update as I wish it to, so I know the loop is working?
Any help or advice would be greatly appreciated.
#!/bin/bash
gnuplot -p << EOF
set title "title"
set xlabel "xlabel"
set ylabel "ylabel"
set style line 1 lt rgb "black" lw 1
i=1
while i==1 {
unset label
labelTitle = $(tail -n 1 filename | tr -s " " | cut -d' ' -f4)
set label sprintf("%E",labelTitle) at graph 0.5, graph 0.5
plot "filename" using 1:3 with lines ls 1
pause 15
reread
}
EOFedit:
ended up fixing it, hope this helps anyone looking to do something similar.
#!/bin/bash
gnuplot -p << EOF
set title "title"
set xlabel "xlabel"
set ylabel "ylabel"
set style line 1 lt rgb "black" lw 1
i=1
while i==1 {
unset label
labelTitle=system("tail -n 1 filename | tr -s ' ' | cut -d' ' -f4")
set label labelTitle at graph 0.5, graph 0.5
plot "filename" using 1:3 with lines ls 1
pause 15
reread
}
EOFr/gnuplot • u/sqrt-minus-1 • May 20 '21
Can't plot CSV with date and time for x data
Hi,
I have a data file with comma separated data:
2021-05-10 14:29:02, 528.78, 1686.84
2021-05-10 15:29:35, 531.66, 1687.86I'm trying to plot either the first value or the second value but I'm getting
all points y value undefined!
Here's how I'm attempting to plot the data:
set datafile separator ","
set xdata time
set timefmt "%Y-%m-%d %H:%M:%S"
plot "time2.dat" using 1:3 with linesAny ideas what I might be doing wrong?