## How to change border width of a matplotlib graph

Maybe this is what you are looking for? It sets the value globally. import matplotlib as mpl mpl.rcParams[‘axes.linewidth’] = 0.1

## Drawing average line in histogram

You can use plot or vlines to draw a vertical line, but to draw a vertical line from the bottom to the top of the y axis, axvline is the probably the simplest function to use. Here’s an example: In : import numpy as np In : import matplotlib.pyplot as plt In : np.random.seed(6789) In …

## how to turn on minor ticks only on y axis

Nevermind, I figured it out. ax.tick_params(axis=”x”, which=”minor”, bottom=False)

## Matplotlib axis with two scales shared origin

use the align_yaxis() function: import numpy as np import matplotlib.pyplot as plt def align_yaxis(ax1, v1, ax2, v2): “””adjust ax2 ylimit so that v2 in ax2 is aligned to v1 in ax1″”” _, y1 = ax1.transData.transform((0, v1)) _, y2 = ax2.transData.transform((0, v2)) inv = ax2.transData.inverted() _, dy = inv.transform((0, 0)) – inv.transform((0, y1-y2)) miny, maxy = …

## How to display all minor tick marks on a semi-log plot

solution for matplotlib >= 2.0.2 Let’s consider the following example which is produced by this code: import matplotlib.pyplot as plt import matplotlib.ticker import numpy as np y = np.arange(12) x = 10.0**y fig, ax=plt.subplots() ax.plot(x,y) ax.set_xscale(“log”) plt.show() The minor ticklabels are indeed gone and usual ways to show them (like plt.tick_params(axis=”x”, which=”minor”)) fail. The first …

## How to limit d3.svg.axis to integer labels?

You should be able to use d3.format instead of writing your own format function for this. d3.svg.axis() .tickFormat(d3.format(“d”)); You can also use tickFormat on your scale which the axis will automatically use by default.

## Setting the position of the `ylabel`

You can move the ylabel using ax.yaxis.set_label_coords, which does accept negative numbers. For your example, I removed the line with set_label_position, and added: axPres.yaxis.set_label_coords(-0.1,1.02) From the documentation: Axis.set_label_coords(x, y, transform=None) Set the coordinates of the label. By default, the x coordinate of the y label and the y coordinate of the x label are determined …

## Problem generating Java SOAP web services client with JDK tool wsimport from a WSDL generated by a .NET 2.0 application

I don’t know if this was ever solved, but I spent some time googling for a solution to this same problem. I found a fix here – https://jax-ws.dev.java.net/issues/show_bug.cgi?id=228 The solution is to run wsimport with the -B-XautoNameResolution (no spaces)

## Content is not allowed in Prolog SAXParserException

This error is probably related to a byte order mark (BOM) prior to the actual XML content. You need to parse the returned String and discard the BOM, so SAXParser can process the document correctly. You will find a possible solution here.

## How do I swap tensor’s axes in TensorFlow?

tf.transpose provides the same functionality as np.swapaxes, although in a more generalized form. In your case, you can do tf.transpose(orig_tensor, [1, 0, 2]) which would be equivalent to np.swapaxes(orig_np_array, 0, 1).