Colorbar and earthquake

Hello everyone,
this is my code. It doesn’t work, i want to plot my seismicity events change the magnitude with colorbar…but don’t change.
If i use the column of depth it is work, if i use mag doesn’t work. Obviously in the file txt there isn’t the headers.
It is very strain.

The header of my file .txt
Longitude Latitude Day Month Year Hour Minute Second Depth Magnitude
13.0433 43.9588 10 01 2021 10 37 57 7.8 2.3
13.3822 43.9247 18 01 2021 14 04 22 7.9 2.2

Thanks you for the answers.

gmt begin italy png

gmt set IO_COL_SEPARATOR=tab

gmt set GMT_THEME cookbook

gmt info C:\programs\sequenza_marche.txt

gmt coast -R13.00000/13.60000/43.57919/44.2200 -Wthin -B -JM5i -Gbeige -Slightblue -I1

gmt grdimage @earth_relief_01s -R13.00000/13.60000/43.57919/44.2200 -I+d

gmt makecpt -T0.9/5.5 -Cjet -N

gmt colorbar -DJCB+ef+w10c/0.2c+h -Bx+llegend -By+lDepth(km) -G0.9/5.5 -I0.25 -Np

gmt plot C:\programs\SHP\ISS330.shp -Wthin,black

gmt plot C:\programs\SHP\DSS330.shp -Wthin,yellow

gmt plot C:\programs\SHP\CSSTOP330.shp -Wthin,green

gmt plot C:\programs\SHP\CSSPLN330.shp -Wthin,coral

gmt plot C:\programs\SHP\SUBDCNT330.shp -Wthin,purple

gmt plot C:\programs\SHP\SUBDZON330.shp -Wthin,gray

gmt plot C:\programs\sequenza_fino_a_18_gennaio.txt -C -Sci -Wfaint -i0,1,8,9+s0.15

gmt text C:\programs\ancona_1.txt -F+f18p,Times-Roman,black

gmt text C:\programs\senigallia_1.txt -F+f18p,Times-Roman,black

gmt plot C:\programs\ancona.txt -Ss0.50 -Wfaint -Gblack

gmt plot C:\programs\senigallia.txt -Ss0.50 -Wfaint -Gblack

gmt image c:\programs\north.jpg -Dg11.50000/38.70000+w0.50 -R11.50000/12.00000/38.70000/39.00000

gmt end show

Mm maybe you have to change the values of makecpt to fit the range of mag??

i change the parameter…with min/max of values for mag.

gmt plot C:\programs\marche_se.txt -C -Sci -Wfaint -i0,1,8,9+s0.15 in this line i change the radius for magnitude…but i want share to change the color for mag beynd the radius.

Try exchange positions where you’d be asked to tell why a long script doesn’t work.
Please, provide a Minimal Working Example that can be reproduced.

this is the example that the script give me for output!

Can you try -i0,1,9,8 in column order?

What @Joaquimus asking for is not the picture but a simpler version of your code, without the cosmetic, so one can help you more effectively :slight_smile:

(Your code should be within triple back ticks … see good practice )

no because otherwise I don’t have the variation of the radius with the values of the magnitude. (11.7 KB) Uploading:…

But is it coloured with depth when you invert?

Since you want to use the last column for both sizes and colors, it should be -i0,1,9,9+s0.15

thank you so much now it works perfectly.
To represent in the legend … this thing or the variation of the radius and color based on the magnitude … how do I create my external input file?
with the data you see there?

to create an automatic legend there are … but I would like to make it external to make it more organized.

C:\programs>gmt legend legend.txt -DjTR+w3c+jTR+o9.25c/-9 -F+gwhite+pthicker
plot [WARNING]: gmt_set_dataset_verify: Data set has 7 data records but header says it only has 0
text [WARNING]: gmt_set_dataset_verify: Data set has 1 segments but header says it only has 0

i have this error!
i don’t[legend.txt|attachment]understand why!
dont work, my input legend!
i have an automatic label and i want to build the legend for progressive magnitude.

this is my legend file legend.txt (562 Bytes)

thanks for your answers!

First of all it is a warning and not an error. It is mostly for us developers.
I assume you are running 6.4 or even 6.5.x?

ah okay. i use version 6.2

Ok, in my 35 years of GMT I don’t think there has ever been a reason to use an older version with bugs compared to a newer version the possibly fixes them plus add new features!

ok. i download the last version.

i have a new question…I can’t plot with an interval of 4 or 6 well spaced labels in order to better see the labels,

this is a part of code.
gmt colorbar -DJCB+ef+w10c/0.4c+h+o0/1c -Bxa25D+lTime -By+lday -I0.25

How do I tick off only 4 or 6 dates? clearly legible to each other. for the moment the writings overlap.

thanks you for answers.

When we are not satisfied with automatic/regular labels the resort is the custom labels. See the -B manual for custom labels.