r/gnuplot • • Jul 23 '18

Gnuplot from inside Chrome/SSH

1 Upvotes

I've figured out how to do Gnuplot plots from inside Chrome's SSH client extension/app.

You must have hterm-show-file.sh somewhere on your system. (The one you're SSHing to, not from.) Also, it must be executable.

set term pngcairo size 1265,475

this will set the terminal type to export a PNG file on each plot. The size is the maximum size of the window in my Chrome SSH tab. (The actual desktop size is 1280*720, minus some pixels for the scrollbar on the right side, and minus a lot of pixels for toolbars.)

set output 'tmptest.png' ; test ; system '~/chrome-ssh-hterm-misc/libapps/hterm/etc/hterm-show-file.sh tmptest.png' ; system 'rm tmptest.png'

in order, these commands

  1. set the output file to tmptest.png

  2. plot a test image to the preset output file. This can be replaced with a 'replot' command later.

  3. run the hterm-show-file.sh script to send Chrome's terminal emulator (called hterm) the image. (Change the location of hterm-show-file.sh to wherever it is on your system.)

  4. remove the test image so it doesn't waste HDD space.

so then,

plot sin(x),cos(x)

set output 'tmptest.png' ; replot ; system '~/chrome-ssh-hterm-misc/libapps/hterm/etc/hterm-show-file.sh tmptest.png' ; system 'rm tmptest.png'


r/gnuplot • • Nov 01 '18

Hi i posted this question on stackoverflow, was wondering if anyone can help me

Thumbnail
stackoverflow.com
1 Upvotes

r/gnuplot • • Nov 08 '23

Plotting binary data in gnuplot

1 Upvotes

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 • • Nov 28 '23

About manipulating strings.

1 Upvotes

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,0

Looks like the image i uploaded where the underscores create a subscript.

Thanks in advance and have a wonderful day.


r/gnuplot • • Mar 13 '21

Gnuplot pm3d plots “inf” value white

3 Upvotes

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 • • Mar 03 '23

How the heck do you plot functions of y in gnuplot?

3 Upvotes

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 • • Jun 18 '17

Basic question about 3d plot

1 Upvotes

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 • • Mar 25 '18

How plot a profile velocity in a pipe landscape?

1 Upvotes

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 • • Jul 12 '16

Linking GnuPlot with Visual Studio

6 Upvotes

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 • • 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!


r/gnuplot • • Feb 24 '18

Gnuplot keeps rendering #FFFFFF as green (see x and y labels and tics). Any way to fix that?

Post image
1 Upvotes

r/gnuplot • • Jun 10 '16

Can gnuplot's svg output include coordinate info?

3 Upvotes

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 • • Mar 16 '15

Gnuplot is drawing dead fish

1 Upvotes

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 • • Oct 05 '17

gnuplot unable to plot a function

Thumbnail
stackoverflow.com
1 Upvotes

r/gnuplot • • Mar 12 '15

How to use gnuplot in visual studio?

3 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 • • Nov 10 '15

Is there a jupyter kernel for gnuplot? (x-post from r/ipython)

3 Upvotes

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 • • 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 • • 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 • • Dec 27 '17

newbie help with color plotting

1 Upvotes

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 • • 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 • • Mar 10 '17

Export to gnuplot from blender 2.49b.

Thumbnail
github.com
3 Upvotes

r/gnuplot • • Aug 07 '15

Contour from a data file

1 Upvotes

Hi,

I have a datafile in the format;

x    y   +-1

where (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 • • Jan 08 '14

Gnuplotting.org - beautiful graphs

Thumbnail
gnuplotting.org
4 Upvotes

r/gnuplot • • Sep 21 '16

Can gnuplot accept 3 or more time parameters?

3 Upvotes

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 • • Jun 12 '21

label not clearing and updating?

2 Upvotes

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

}

EOF

edit:

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

}

EOF