gnuplot


Gnuplot histogram x logscale


I'm using gnuplot in a bash script to draw several things.
For this special graphic, I need to print the amount of matrices (y axis) with the matrix size as the x-axis.
As the distribution can be pretty sparsed, I want to use a logscale for x and y. It works great with y, but gnuplot tells me I can't have a logscale for the x-axis when I'm using histogram style.
Any ideas to debug this? or on how to present the results using a similar way?
set style data histogram
set style histogram cluster gap 1
set style fill solid border -1
set logscale xy
plot '$res/histo-$ld-$lr-$e-$r' using 2:xtic(1) title 'Run'
The error is :
line 0: Log scale on X is incompatible with histogram plots
Thanks in advance.
Edit : btw, I was using gnuplot 4.4 patchlevel 4 and just updated to the newest version (i.e. 4.6 patchlevel 5)
Gnuplot histograms work a bit differently from what you might think. The x-axis isn't numeric. In your case the value in the first row, second column is placed at an x-value of 0 with the y-value taken from the second column and a manual label taken from the first column, first row. The values of the second row are placed at x=1 etc.
You can try using the boxes plotting style, which is used with a 'conventional' x-axis and supports a logscale in x:
set logscale xy
set offset 0,0,1,1
set boxwidth 0.9 relative
set style fill solid noborder
plot 'data.dat' with boxes
With the data file data.dat
1 1000
2 300
5 150
20 10
135 3
this gives the result (with 4.6.5):
In order to have a fixed boxwidth and a varying box distance, you can use a third column to specify a box width as percentage of the x-value:
set logscale xy
set offset 0,0,1,1
set style fill solid noborder
plot 'data.dat' using 1:2:($1*0.5) with boxes
Putting the actual values on the x-axis works as follows:
set logscale xy
set offset 0,0,1,1
set style fill solid noborder
plot 'data.dat' using 1:2:($1*0.5):xtic(1) with boxes

Related Links

Custom string in xticlabels in gnuplot
How to set a line style as default for multiple plots in Gnuplot?
Gnuplot sparse matrix display
Gnuplot lines overlap with tics
how to plot data which has mostly true values in gnuplot?
GNUplot concatenate 2 macros in an xlabel
Determine min and max in gnuplot
Plot cyclic sum of some row data
How to count the number of indices in a Gnuplot input file
GNU Plot how to plot histogram in timeseries
Create groups of dots histogram with gnuplot
Gnuplot: Missing values on second y-axis
Gnuplot fat lines overlap with axis
Using relative paths in gnuplot plot files
increment of ytics in gnuplot
gnuplot: Plot and fit 2d function with two variables

Categories

HOME
node.js
docker
github
sitecore8
magento-1.9
jsoup
migration
soap
monitoring
g2o
dfa
javafx-2
google-cloud-kms
widget
dijkstra
webassembly
tablesorter
esapi
pixel
ietf-netmod-yang
uidocumentinteraction
polymer-1.0
mitmproxy
apprtcdemo
jquery-animate
gnome
google-cloud-vision
frama-c
filenames
u2
biblatex
fread
uisegmentedcontrol
get-eventlog
quickbooks-online
crossfilter
dexguard
tail-recursion
google-optimize
rrd4j
hana-cloud-platform
spring-cloud-sleuth
webos
mapped-drive
yield
paypal-adaptive-payments
grunt-string-replace
winlims
react-d3
monocle-scala
asana-connect
suppress-warnings
gio
news-feed
countdowntimer
nsthread
xlconnect
tizen-sdb
mime-mail
jquery-widgets
assignment-operator
realbasic
supercsv
offsetheight
sin
spatialite
beta-testing
xlet
openni
rgs
centura
kiosk-mode
jquery-dynatree
jaggery-js
editplus
angularjs-ng-show
knockout-mapping-plugin
graphael
imagecreatefrompng
jquery-ui-selectable
payflowlink
jquery-mobile-collapsible
jwebunit
ipad-2
nsinteger
nexus-7
endl
bootclasspath
visual-programming
pvcs

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App