Gnuplot 4.6.5 ylabel not visible - gnuplot

im running gnuplot 4.6.5 on top of ubuntu 12.04 and use the x11 terminal. I use the script as follows but the ylabel is not visible (xlabel is fine). What i have to do to fix it? offset?
thanks for help
plot "512bytesCBR3000client4server1numofnodes.txt" using 1:2 title 'NativeOF' with linespoints lw 2 ps 3 pt 6 lt 3
set grid
set ylabel "End to end delay"
set xlabel "number of nodes"

Normally, you have to do all the settings (set xlabel, set ylabel, set grid) before you call plot if you want them them to show up in the plot. I am not sure why set xlabel is working for you unless you set it in a previous plot or while trying commands from the gnuplot command line.
Try moving the plot command to the end of the file.

Sometimes, this might be related to the margins of the canvas. Therefore, might be wise to play with the margin settings, for example:
# other grid settings
set lmargin 10
set rmargin 10
set tmargin 5
set bmargin 5
# plot command

Related

Gnuplot 5.4 ylabel collapse [duplicate]

I use gnuplot 5.4.5 for processing the following script:
set key enhanced font "Monospaced,13"
set grid
set style line 1 \
linecolor rgb '#a82828' \
linetype 1 linewidth 3 \
pointtype 5 pointsize 1.0
set xlabel "Entropy"
set xrange [-0.05:1.05]
set ylabel "Amortized work"
set terminal png enhanced font "Monospaced,13" size 500,350
set output 'EntropyToAmortizedWork.png'
plot 'EntropyToAmortizedWork.dat' with linespoints linestyle 1 notitle
replot
exit
The file EntropyToAmortizedWork.dat lives here.
All in all, I get:
Clearly, we have a typesetting artifact. How could I deal with it?
I can reproduce this on Win10 with gnuplot 5.4.5 and terminal png, but not with gnuplot 5.4.4.
Even terminal pngcairo seems to have a problem with 5.4.5, check the missing horizontal lines on some xticlabels.
So, suggested solution would be to go back to gnuplot 5.4.4 or earlier versions.
This would be a minimal script (no need for data).
Script:
### wrong ylabel with 5.4.5 and png terminal
reset session
set ylabel "This is the y-label"
set term png size 640,384
set output "SO74179232_png.png"
plot x
set term pngcairo size 640,384
set output "SO74179232_pngcairo.png"
plot x
set output
### end of script
Results:
gnuplot 5.4.5, terminal png
gnuplot 5.4.5, terminal pngcairo
gnuplot 5.4.4, terminal png
gnuplot 5.4.4, terminal pngcairo

Print null or transparent label in Gnuplot

I would like to place a few graphs beside each other horizontally. The issue is only the one at the middle should have an xlabel.
On implementing that, the other graphs appear to start a bit below on merging all the images together. I have tried to change the color of xlabel, but it hasn't been working on epslatex. Neither supplying a null value worked ("").
set format "$%g$"
set terminal epslatex size 5.25,4.2 color standalone
set output "count.tex"
unset key
set yrange [0:18]
set xrange [0:18]
set cbrange [0:1400]
unset colorbox
set ylabel "Species 2 ----->"
set xlabel "Species 1 ----->" tc rgb "white"
plot 'combine.txt' u 1:2:3 with points pointtype 7 pointsize 3 palette
Please help me regarding this.
I found a workaround regarding this. A space could be printed instead.
set encoding iso_8859_1
set xlabel "\240"
Most (if not all) labels and similar can be deactivated by unset. So you are looking for:
unset xlabel

gnuplot multiplot images in column

I'm trying to use multiplot to stack two image plots on top of one another, in a column. When I try to test this with x11 terminal, the images are produced separately, only one visible at a time. When I use the epslatex terminal, which is what I want, then the text is drawn correctly within the LaTeX document, but the EPS portion of the plot is produced as two separate pages, resulting in a figure that is missing a lower half.
Here's the multiplot section of my script:
set multiplot 2,1
set cbrange [-0.4:0.4]
set cbtics -0.4,0.2,0.4
unset xlabel
set tmargin at screen 0.95
set bmargin at screen 0.60
plot data u 1:2:3 with image notitle
set cbrange [-0.1:0.1]
set cbtics -0.1,0.05,0.1
set xlabel "$x$"
set tmargin at screen 0.50
set bmargin at screen 0.15
plot data u 1:2:3 with image notitle
unset multiplot
unset output
What results in the document is this:
I have tried enlarging the vertical size of the plotting area(per this question), but what this does is increase size of each page in the EPS file. To be clear, the product of plotting with epslatex is an EPS file containing two pages, the first with the first plot at the position that I want (near the top), and the second with the second plot at the position that I want (near the bottom).
This normally happens when you are not in multiplot mode. For me, set multiplot 2,1 gives an error message "only valid in the context of an auto-layout command". The command set multiplot layout 2,1 works with Gnuplot 5.0 and 4.6.
As a side note: This behavior can be used to produce animated gifs with set terminal gif animate, each plot command creates a new frame.

Gnuplot image on axis

I'm trying to model a certain progress through some environment. The x axis would represent the location (based on x coordinate) in the environment.
In order to make this clear, I'd like an image of the environment (based on a .png) on the x axis (the environment is rather wide and not that high, so it should look good) of my plot, basically as an xtics/x-axis label.
Do you have any suggestions on how to approach this?
Thanks in advance!
You can either plot both the image and the data in one plot command, or with multiplot. The first variant is easier, but the image is inside the plot, the other is a bit more complicated, but allows arbitrary positioning of the "axis image".
The dummy image "gradient.png" for the axis is
One plot command:
set yrange[0:1]
set xrange[0:1]
plot 'gradient.png' binary filetype=png dx=0.0015 dy=0.002 with rgbimage t '',\
x**2
The result is:
Using multiplot
set yrange[0:1]
set xrange[0:1]
set lmargin at screen 0.1
set rmargin at screen 0.98
set tmargin at screen 0.98
set bmargin at screen 0.2
set xtics offset 0,-1.5
set xlabel 'xlabel' offset 0,-1.5
set ylabel 'ylabel'
set multiplot
plot x**2
set tmargin at screen 0.2
set bmargin at screen 0.15
unset border
unset tics
unset xlabel
unset ylabel
unset key
set autoscale xy
plot 'gradient.png' binary filetype=png with rgbimage
unset multiplot
As you can see, this requires a bit more effort. To explain the details:
You must set explicit margins so that the axis image can be placed exactly below the main plot.
Before plotting the axis image, you must remove tics, labels, reset ranges to autoscale etc. (Therefore you must also set fixed lmargin and rmargin).
To plot the image itself, use the plotting style with rgbimage.
You must fine-tune the xtics and xlabel offset, as well as the marings.
The resulting image is:

Gnuplot 4.6 xtics label disappear

I decided to migrate to the latest version of gnuplot from 4.4 to 4.6
I am having issue with the x label disappearing with version 4.6 but being there with version 4.4.
here is a stripped down version of my script.
set key outside
set title "MY TITLE"
set timefmt "%m/%d/%Y-%H:%M:%S"
set format x "%m/%d %H:%M"
set xdata time
set ylabel "Y LABEL"
set xlabel "Time"
set grid
set xtics rotate by 90 offset 0,-5
set terminal pngcairo size 1000,500 font ",9"
set xtics font ",8.0"
set ytics font ",8.0"
set output 'test.png'
plot '-' using 1:2 with linespoints ti "legend"
01/01/2013-00:15 186557
01/01/2013-01:15 254654
01/01/2013-04:00 180146
01/01/2013-06:15 191059
e
set key inside
I've identified the issue to this line
set xtics rotate by 90 offset 0,-5
Because my label is too long the offset makes it go away
if you remove the offset to
set xtics rotate by 90
Not the label show but in the middle of the chart.
Version 4.4 used to compress the chart to leave room for the label.
I guess my knowledge to gnuplot is limited.
Anyone has an idea?
thanks
UPDATED ANSWER, courtesy of Ethan Merritt
A better way to do this is to change the justification of the labels to being right justified (rather than the default centered).
set xtics rotate by 90 right
This correctly calculates the margin without needing to hardcode a margin size
The label placement here seems a little flaky to me. I think there might be a bug which I'll probably report. One workaround is to explicitly set the location of the "x-axis" via:
set bmargin at screen 0.2
The reason it seems flakey is because with set bmargin at screen 0.2, the xtic labels clearly extend higher than the position of the xlabel. However, if you comment that line out, all of a sudden they don't extend higher than the position of the xlabel.
Here are the plots with and without that line:
Perhaps cairo/pango cut out labels where any portion of the label extends past the visible "canvas" area?
As a side note, the plot also seems to be roughly correct if I use the postscript terminal...

Resources