Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

plotting output #3

Open
eggulbahar opened this issue Dec 10, 2024 · 1 comment
Open

plotting output #3

eggulbahar opened this issue Dec 10, 2024 · 1 comment

Comments

@eggulbahar
Copy link

Hello, I have been using pyxspec for a while and I have been trying to run the example threads here too, however, whenever I try to plot outside of the the Matplotlib option I never get an output (see image attached). This is the case when running the PyXspecWalkthrough1.ipynb as well. Is there something I am missing?
image

@c181gordon
Copy link

This is a known problem with the svg plotting driver in Heasoft-6.34 (and earlier) when used with recent versions of Jupyter Notebook. We've made a fix that will be in the next release of Heasoft. But in the meantime if you have the Heasoft-6.34 source code distribution and would like to make a patch fix yourself in your local build, please follow these instructions:

  1. Copy and paste the following into a file named "sgdriv.patch"
@@ -523,7 +523,7 @@
 
     /* ... or writing to stdout, so just save the viewbox here because that's
        all we can do. */
-    fprintf(cdev->fp,"<!-- _PGPLOT_SVG_ATEND: viewbox=\"%20f %20f %20f %20f\" -->\n",
+    fprintf(cdev->fp,"<!-- _PGPLOT_SVG_ATEND: viewBox=\"%20f %20f %20f %20f\" -->\n",
 	    cdev->bbox[0], cdev->bbox[1], 
 	    cdev->bbox[2]-cdev->bbox[0], 
 	    cdev->bbox[3]-cdev->bbox[1]);
@@ -1804,7 +1804,7 @@
        store the location of the viewbox string position for later, so we can 
        fill in bounding box information upon close. */
     if (!cdev->sgstdout) {
-      fprintf(cdev->fp, "viewbox=\"");
+      fprintf(cdev->fp, "viewBox=\"");
       cdev->viewbox_pos = ftell(cdev->fp);
       fprintf(cdev->fp,"%20s %20s %20s %20s\" \n",
 	      "","","","");
  1. Copy your sgdriv.patch file into the directory heasoft-6.34/tcltk/pgplot/drivers

  2. From that same directory, do:

    patch sgdriv.c sgdriv.patch

(This final step assumes you have already run your $HEADAS/headas-init.(c)sh script.
Otherwise you'll get an "hmake: Command not found." error.)

  1. 'cd' up 1 level into the directory heasoft-6.34/tcltk/pgplot and run the following 2 commands:

    hmake
    hmake install

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants