5960

Redundant space at right side of Y axis

Question:

I'm trying to make plot with GNU Plot for some data of experiments, but I cannot figure how to remove the redundant padding/space between Y axis and the first sample (left side of the first sample):

<img alt="The output plot has a redundant spaces at the left side of the first sample" class="b-lazy" data-src="https://i.stack.imgur.com/VTiCD.png" data-original="https://i.stack.imgur.com/VTiCD.png" src="https://etrip.eimg.top/images/2019/05/07/timg.gif" />

Code:

set terminal pngcairo size 800,800 enhanced font 'WenQuanYiZenHei,12' set title "All Elements" set xlabel "Sample" set ylabel "Element Amounts" set ytics nomirror set style fill transparent solid 0.5 noborder plot data u 2:xticlabels(1) w histograms title "K",\ data u 3:xticlabels(1) w histograms title "Ca",\ data u 4:xticlabels(1) w histograms title "Mg",\ data u 5:xticlabels(1) w histograms title "Fe",\ data u 6:xticlabels(1) w histograms title "Mn",\ data u 7:xticlabels(1) w histograms title "Zn"

Data:

| Sample | K | Ca | Mg | Fe | Mn | Zn | |--------+-------+-------+------+--------+-------+------| | -Ca 1U | 58800 | 4800 | 2700 | 222.5 | 28.0 | 30.0 | | -Ca 2U | 59000 | 5475 | 3200 | 105.5 | 29.5 | 35.0 | | -Mg 1U | 57600 | 12275 | 2900 | 92.0 | 45.5 | 37.0 | | -Mg 2U | 57200 | 13850 | 3200 | 266.0 | 59.5 | 39.0 | |--------+-------+-------+------+--------+-------+------| | -Ca 1D | 19700 | 1100 | 3400 | 1708.0 | 79.0 | 48.5 | | -Ca 2D | 20900 | 1025 | 3300 | 1812.0 | 102.5 | 54.5 | | -Mg 1D | 23200 | 3175 | 3200 | 312.0 | 49.5 | 61.0 | | -Mg 2D | 21800 | 4325 | 2300 | 2136.0 | 86.5 | 55.5 |

Answer1:

That's because of the header line in the data. You can skip it with

plot data every ::1 u 2: ...

Or just remove it before feeding the data to gnuplot.

Recommend

  • Pandas Dataframe to Seaborn Grouped Barchart
  • Finding R peak from a heart signal input from a stethoscope
  • MATLAB - Plot multiple surface fits in one figure
  • GNUPLOT: Trying to increase the quality
  • use parent 'Exporter' vs. use Exporter 'import';
  • How can I plot the results of the spectrogram function?
  • override y axis tick labels without affecting the graph shape in pyplot
  • WatiN through TFS on Windows 2008 Server
  • How to generate a bar chart of occurrences per year in matplotlib python?
  • AWS S3 implementation for serving private files
  • Nested not working on slide
  • Jquery resizable reposition handle after scroll
  • Function JavaScript : on Menu CSS HTML
  • Select inner HTML item in CSS
  • Problems with matplotlib.pyplot.xticks()
  • How to add closing tag for canvas in three js rendered Canvas?
  • Cut the background to expose the layer below
  • Reading a file into a multidimensional array
  • Android application: how to use the camera and grab the image bytes?
  • C: Incompatible pointer type initializing
  • why xml file does not aligned properly after append the string in beginning and end of the file usin
  • Does it make sense to call System.gc() and Thread.sleep() when working on Bitmaps?
  • how to display data from 1st point on words on y axis for line chart in d3.js
  • How to clear text inside text field when radio button is select
  • Highlight and Bold text in JTextPane
  • Scrapy recursive link crawler
  • MongoDB in PHP using aggregate to group by _id is null not working
  • Xamarin Forms - UWP Fonts
  • Display issues when we change from one jquery mobile page to another in firefox
  • Why HTML5 Canvas with a larger size stretch a drawn line?
  • Why doesn't :active or :focus work on text links in webkit? (safari & chrome)
  • How to apply VCL Styles to DLL-based forms in Inno Setup?
  • Change an a tag attribute in JavaScript based on screen width
  • When should I choose bucket sort over other sorting algorithms?
  • Weird JavaScript statement, what does it mean?
  • To display the title for the current loaction in map in iphone
  • jquery mobile loadPage not working
  • Unanticipated behavior
  • trying to dynamically update Highchart column chart but series undefined
  • Django query for large number of relationships