.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "auto_examples/quickflat/plot_make_svg.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note Click :ref:`here ` to download the full example code .. rst-class:: sphx-glr-example-title .. _sphx_glr_auto_examples_quickflat_plot_make_svg.py: =============================== Save a 2D static flatmap as SVG =============================== Plot a 2D static flatmap and save it as SVG file. **Some words on the `rechache` parameter before we begin:** Setting the `recache=True` parameter recaches the flatmap cache located in //cache. By default intermediate steps for a flatmap are cached after the first generation to speed up the process for the future. If any of the intermediate steps changes, the flatmap generation may fail. `recache=True` will load these intermediate steps new. This can be helpful if you think there is no reason that the `quickflat.make_figure` to fail but it nevertheless fails. Try it, it's magic! The default background is set to be a transparent image. If you want to change that use the parameter `bgcolor`. .. GENERATED FROM PYTHON SOURCE LINES 21-36 .. image-sg:: /auto_examples/quickflat/images/sphx_glr_plot_make_svg_001.png :alt: plot make svg :srcset: /auto_examples/quickflat/images/sphx_glr_plot_make_svg_001.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-script-out Out: .. code-block:: none Failed to get connection ** (inkscape:5223): CRITICAL **: 01:27:55.257: dbus_g_proxy_new_for_name: assertion 'connection != NULL' failed ** (inkscape:5223): CRITICAL **: 01:27:55.257: dbus_g_proxy_call: assertion 'DBUS_IS_G_PROXY (proxy)' failed ** (inkscape:5223): CRITICAL **: 01:27:55.257: dbus_g_connection_register_g_object: assertion 'connection != NULL' failed Failed to get connection ** (inkscape:5226): CRITICAL **: 01:27:56.295: dbus_g_proxy_new_for_name: assertion 'connection != NULL' failed ** (inkscape:5226): CRITICAL **: 01:27:56.295: dbus_g_proxy_call: assertion 'DBUS_IS_G_PROXY (proxy)' failed ** (inkscape:5226): CRITICAL **: 01:27:56.295: dbus_g_connection_register_g_object: assertion 'connection != NULL' failed | .. code-block:: default import cortex import matplotlib.pyplot as plt import numpy as np np.random.seed(1234) # Create a random pycortex Volume volume = cortex.Volume.random(subject='S1', xfmname='fullhead') # Plot a flatmap with the data projected onto the surface _ = cortex.quickflat.make_figure(volume) plt.show() # Save this flatmap filename = "./my_flatmap.svg" _ = cortex.quickflat.make_png(filename, volume, recache=False) .. rst-class:: sphx-glr-timing **Total running time of the script:** ( 0 minutes 4.189 seconds) .. _sphx_glr_download_auto_examples_quickflat_plot_make_svg.py: .. only :: html .. container:: sphx-glr-footer :class: sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_make_svg.py ` .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_make_svg.ipynb ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_