Where can I find all the properties for customization in matplotlib? - python

I'm trying to create my own style, like 'ggplot', and I'm looking for a dictionary or a guide where I can find all the customizable properties. At the end of this page of the documentation of matplotlib there is a file called 'matplotlibrc' and i want to know if that files contains all the possible options on customization or there is something else.

Yes, the example file contains all possible parameters. This file is embedded into each documentation built; and there is a test that ensures that whenever a new parameter is added or removed, this file is updated. So you can consider it being complete.
However, make sure to always refer to the version of the documentation that corresponds to your matplotlib version.
The most up to date version at any time is at
https://matplotlib.org/tutorials/introductory/customizing.html
while for example the version of matplotlib 3.0.3 would be available through
https://matplotlib.org/3.0.3/tutorials/introductory/customizing.html

Related

Can't create custom labels with XlsxWriter

I am trying to add custom data Labels into a "column chart" with the XlsxWriter version: 1.2.1.
No matter what, it never displays custom labels but always the current values.
Like this chart with current values:
I already tried to copy some example code from here:
Chart data label position is ignored for custom data labels · Issue #754
The chart should look like this:
But when I execute it, it shows up like this:
Does somebody have any solution? Is it because of the version?
P.S. I'm working on my work computer in the office — that's why I can't update the library that easily.
Thanks!
Support for custom data labels was added in XlsxWriter version 1.3.2. It wasn't supported in the version you have (1.2.1). So you will need to upgrade the library version to at least 1.3.7 but preferably to the latest version.

How can vscode view detailed usage information for certain python package library functions? (like the sum function in pytorch)?

I used to use spyder-IDE for python programming, for example, I used the sum function in pytorch library, torch.sum(), using keyboard shortcut "ctrl+I" to quickly see how to use the function, input and output parameters, examples code and so on. However, with the latest pylance_v2021.9.1+vscode 1.6+pytorch 1.9 you cannot see the detailed help information, it seems that you can only see it by typing torch.sum()? in the terminal, Is there some extensions that provides this feature? Thank you!
Official vscode says (IntelliSense through the Pylance language server) that use pylance+pytorch 1.8.1 or later release support mouse hover to see pytroch detailed preview information, but I use the latest version of vscode 1.6+pytorch 1.9 but it doesn't work, it only shows function signature hints, not detailed help information.
2021.9.17 update, Description example update:
This image is the detailed help information of "torch.sum" obtained by spyder-IDE
However, it is not easy to get such detailed help information in vscode, but only the function signature shown below(left), unless you type torch.sum? in the python interactive window to see the full help information every time(right). Moreover, the full "Docstring" is not rendered, so it is not easy to read visually like spyder-IDE.
The above two use the same python environment,the various versions used are: vscoder1.6+pytorch1.9+(microsoft)python_v2021.9.1230869389+pylance_v2021.9.2, spyderIDE4.0
Have you click this?
Then it should be like this:
the sum would be like this:
But if you want to get more information, it depends on the docs, such as AdaptiveAvgPool2d:
But the sum does not contains that:

Scatterplot in seaborn 0.8

I'm on a remote server where I have access to seaborn=0.8.1 and have no way of updating the package. I'd like to use seaborn.scatterplot, but I'm getting an error that the function does not exist.
Either the function did not exist in the older version, or it had a different name. I am unable to find earlier versions of the documentation (numpy does a great job of providing manuals for earlier versions), so I am kind of stuck here.
How do I find out the API for earlier versions of seaborn, and whether there are older alternatives to scatterplot?
You can use the GitHub repo to find documentation of older versions - just navigate to the correct tag that corresponds to your version, and enter the doc directory -
https://github.com/mwaskom/seaborn/tree/v0.8.1/doc
It's very common for documentation to be stored alongside the code and versioned along with it.
It seems the scatterplot function was added in 0.9 to seaborn/relational.py, which has the line:
__all__ = ["relplot", "scatterplot", "lineplot"], so "seaborn.scatterplot" gets "created" when seaborn/__init__.py performs from .relational import *.
I'm not sure if there's a similar function in v0.8.1. A quick search shows that class class _RegressionPlotter(_LinearPlotter) has a method called scatterplot in version 0.8.1, but I don't think it's the same (not familiar enough with Seaborn to know).

InDesign script labels in appscript python module

I'm using appscript to create an InDesign document from Database data, but I can't seem to figure out how to set the contents of the objects in my page. In older versions of ID (CS4 and earlier, if i'm correct) I could get the object with script label foo by calling spread.page_items['foo']. However, this does not seem to work anymore. spread.page_items.ID(<foo_id>).label.get() does show foo, so the script label is set correctly.
The Adobe documentation speaks of a label property, however I haven't yet figured out how to use that property to correctly select the right object.
If there is a way to obtain an object's ID easily, that might also do the trick.
I managed to solve this after finding this article about references in appscript. I had to use a filter, like so: spread.page_items[its.label == 'foo'].
Also, as suggested by Youngware below, the script labels support is indeed replaced by layer names.

How do I deal with conflicting names when building python docs with doxygen

I'm having a problem with Doxygen for Windows with Python where input files with the same failename cause a conflict wth the output files. This seems to be a bug in doxygen - is there a way to work-around this problem?
Background
We build docs for our API using Doxygen. Our project is overwhelmingly written in python and the only components that our clients care about are python. Due to accidents of history our classes often have unfortunate naming conventions.
For example we have a classes whose fully-qualified name are:
tools.b.foo.Foo
tools.b.bar.Bar
Later this class was re-implemented and put into a new module:
tools.c.foo.Foo_improved
tools.c.bar.Bar_improved
When we want to build our tools API documentation we have a process which checks out tools.* into a directory on the build-server and then we call doxygen with a fairly standard configuration file.
We'd expect that there should be four HTML files in the output, two for foo and two for bar. However what we get is only two files. Both sets of sripts are parsed, however since the module names are the same the documentation for the old version ends up over-writing the documentation which was generated for the new versions. As a result in every case where a python module name is duplicated (but in a different sub-package) we are only getting a single doc file for every file name.
FYI, we are using doxygen 1.7.1 on Windows XP 32bit with Python 2.4.4
Config file is here:
http://pastebin.me/002f3ec3145f4e1896a9cf79e7179493
UPDATE 1: In the generated doc index I can see entries for all four files, however if I follow the links to both Foo and Foo_improved both point to the same file.
You could try explicitly declaring a class w/ full namespace
http://www.doxygen.nl/manual/commands.html#cmdclass

Categories

Resources