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

Creating basins of attraction from data file
Plotting a text file by using gnuplot
Gnuplot Expand Plot to Fill Area
Extending value range in gnuplot
Auto-scale setting the window too small GNUPLOT
Gnuplot Data and Parametric
gnuplot: can a function be plotted with vectors?
Tab completion not working correctly in gnuplot
gnuplot with lines is not working
Add guiding lines over pm3d map in Gnuplot
How to plot a smooth surface in GNUplot?
Two plots on the same graph
Plot contours from one graph into another in Gnuplot
gnuplot: silent error reading (non-standard form of) scientific format numbers
gnuplot plotting against time-difference
grid lines are changed in multiplot if lines styles of y column is changed

Categories

HOME
menu
loadrunner
sails.js
recaptcha
knn
accounting
modularity
monitoring
linux-device-driver
conditional
flannel
delaunay
visio
shoutem
lokijs
access-control
video-processing
executable-jar
libreoffice-base
nlog
coap
actionlink
heatmap
white
jqassistant
ipc
android-ffmpeg
webm
podcast
radio
fixtures
lightgallery
winrt-xaml
sqlcmd
smtpclient
jenkinsfile
instrumentation
qnx
lpc
tiles
wso2dss
nosuchelementexception
magicalrecord
istanbul
nsoutlineview
sonarqube-4.5
dbx
git-stash
mockery
kindle
mailman
agile-project-management
arithmetic-expressions
ienumerable
throttle
timedelta
snap-lang
kdiff3
oracle-streams
couchbase-sync-gateway
togglz
datamapper
sin
qubole
unique-constraint
bpopup
proto
visual-studio-2010-sp1
httplib
mysql-error-1093
swift-protocols
mux
fast-esp
zurb-joyride
triples
facebook-app-center
real-time-data
rdata
jquery-textext
icarousel
mercurial-subrepos
appmobi
html-validation
generic-list
twisted.internet
mfi
abpeoplepickerview
assetslibrary
bootclasspath
httpverbs

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