considering the Assignments given, I am posed with several lines of codes to run on bash. Hence, I will continue with your method.
Since you’re using this platform, I believe you’ll continue to assist me!
Update:
I have been able to update and upgrade successfully.
Also, I was able to perform the rest of the previous codes, but with 2 constrains:
I wasn’t able to run ( mv gshhg-gmt-*/* ~/gmt/share/coast) successfully, I skipped it and ran the remaining lines of code.
After successfully downloading and extracting the files, the installation code which is the last task brought the following prompt (-bash: cd: too many arguments)
I am satiated with profound joy…What took me several days and abrupt night rest, was solved by your sagacity, patience, and willingness to help me. I bless you from my heart! This is the output!
Going forward, I will need assistance on how to navigate my way around the app. Such as:
Using the given files to plot topo maps, and other maps.
Where do I create my files (is it in the /b directory?) 3. The next step I need to take from here.
Also, if you have materials that I could peruse in expediting my knowledge on GMT and its environmental functions, I deeply welcome it.
Thanks again and again @Andreas
I don’t know the technical details, but WSL has it’s own kind of filesystem, which is generally hidden from Windows’ that you’re used(?) to. You can run GMT everywhere you want, but assuming that you’ll use Windows programs to e.g. look at the figures, it’s best to work in a place easily accessable from both systems. I tend to use the desktop. To reach the ‘Windows filesystem’ you do:
cd /mnt/c
Try doing an ls -l; what you see should be somewhat familiar. Then go to your desktop:
cd /mnt/c/Users/<your username/Desktop
Make a file:
echo "Hello from WSL" > hello.txt
You should now see a file called hello.txt on your Windows desktop.
Make a folder and try to make a plot or two:
mkdir plot
cd plot
gmt psbasemap -R10/70/-3/8 -JX4i/3i -Bafg -B+glightred+t"My first plot" > my_first_plot.ps
If you’re new to the terminal and bash you might feel that the learning curve is steep, but once you get the hang of it becomes very powerful (as GMT itself).
I will give attention to the tutorial sites and I’m truly grateful for all you have done.
I was able to locate the path where Ubuntu saves the folder on the PC via: C:\Users\<PC name>/AppData\Local\Packages\CanonicalGroupLimited... But, using the Desktop directory you highlighted is just perfect!
Also, I tried running the my_first_plot.ps but didn’t see any plotted figure or output!
I downloaded and installed Ghostscript using sudo apt install gv, which was successful, but still didn’t output any figure.
What you’re trying to do is correct if you used a Window manager on Ubuntu (e.g. Xorg). But since you’re on Windows, we can deal with that at a later stage .
After you’ve installed those, you should be able to double click my_first_plot.ps and it should open in GSview.
Based on your screenshots: remember that the file plotMap.sh only contains text (commands) for GMT to execute (I assume). GMT interprets those commands and outputs Postscript, which basically is text (it’s a descriptive programming language), that tells a program (GSView in this case) how your figure should look like. So there is no need to make the *.ps executable.
Try to do a gmt psbasemap -R10/70/-3/8 -JX4i/3i -Bafg -B+glightred+t"My first plot" without redirecting to a file, and behold the postscript pouring at you.
PS! If you dont care about the Postscript-files, you can use psconvert -Tf -A my_first_plot.ps to convert the figure to PDF. I’m sure you’re able to look at PDF’s without installing new software.
Also, I downloaded and installed the Ghostscript 64 bit, but wasn’t able to install the downloaded gs (x86_64)
So, I tried installing the 32 bit Ghostscript and Gsview…, but wasn’t able to view the .ps file as it resulted in the following error:
GSview 5.0 2012-01-17
Unknown in Comments section at line 7:
%%DocumentNeededResources: font Helvetica
Unknown in Page section at line 677:
%%BeginObject PSL_Layer_1
Unknown in Page section at line 823:
%%EndObject
Failed to load C:\Program Files (x86)\Ghostgum\gs7.04\bin\gsdll32.dll, error 126
The specified module could not be found.
Failed to load C:\Program Files (x86)\Ghostgum\gsview\gsdll32.dll, error 126
The specified module could not be found.
Failed to load gsdll32.dll, error 126
The specified module could not be found.
Can't load Ghostscript DLL
I’m sorry, I forgot to put gmt at the start of the command.
It should be gmt psconvert -Tf -A my_first_plot.ps. (Note -Tf, not -If)
Now for the trouble with GSview, I’m not sure why this. Did you manage to install ghostscript successfully? It looks like GSview doesnt find ghostscript.
You can create a script and call it whatever you want. I use .sh so I know it’s a script. You should not use .ps since that indicates that it’s a postscript file.
Use an editor that you like, e.g. nano and make a simple script, then execute it:
$ nano test.sh
And write:
ps=test.ps
gmt psbasemap -R10/70/-3/8 -JX4i/3i -Bafg -B+glightred+t"My first plot" > $ps
gmt psconvert -Tf -A $ps
Hi @Andreas
I trust you have been good. I apologize for the late response, I have been studying
First, I have installed the gsview on my laptop! The reason for the previous error was that I had downloaded the recent version of the Ghostscript, and the gsview requires a version lesser than 9.99. I was able to solve the puzzle by downloading and installing Ghostscript 9.52. I think I have the full package on my laptop now!
Thanks again @Andreas
Second, I wasn’t able to run your simple code as it brought this error:
Hi @Andreas,
I trust you have been very good!
Thank you so much for your assistance throughout my installation process. I have been practicing and modify codes with supporting documents, and I have been able to output the files successfully in .ps and .pdf file format. But, I think I am having difficulty in outputing a oneliner code just like the one you gave me. This is another example with the following errors. $ gmt coast -R19.42/22.95/59.71/60.56 -W0.1p,black -png archi_sea
If you want to use graphical stuff with Ubuntu (WSL) you also need a Window manager (e.g. Xorg). The only thing you would get out of this is that gmt automatically opens the figure for you (I think).
It’s a long time since i tried Xorg on/with WSL. I think I used Xming X Server for Windows.
Thanks, @pwessel! I have successfully installed xdg-utils and it solved the problem.
@Andreas, Ubuntu was able to use my windows 10 image viewer to popup the image, after bringing the error Error: no "view" mailcap rules found for type "image/png"
But, in all, I was able to solve the puzzle. I am following a steady process on how to write codes to draw maps and use the GMT as a whole, and I needed to see the step-to-step output from my PC. In general, I am very grateful to @Andreas, Joaquim, @pwessel, and the entire GMT community for your unwavering support.
Thanks in total admiration.