How to add custom Http Header for C# Web Service Client consuming Axis 1.4 Web service

It seems the original author has found their solution, but for anyone else who gets here looking to add actual custom headers, if you have access to mod the generated Protocol code you can override GetWebRequest: protected override System.Net.WebRequest GetWebRequest(Uri uri) { System.Net.WebRequest request = base.GetWebRequest(uri); request.Headers.Add(“myheader”, “myheader_value”); return request; } Make sure you remove … Read more

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 = … Read more

Axes class – set explicitly size (width/height) of axes in given units

The axes size is determined by the figure size and the figure spacings, which can be set using figure.subplots_adjust(). In reverse this means that you can set the axes size by setting the figure size taking into acount the figure spacings: import matplotlib.pyplot as plt def set_size(w,h, ax=None): “”” w, h: width, height in inches … Read more

How to set the subplot axis range

You have pylab.ylim: pylab.ylim([0,1000]) Note: The command has to be executed after the plot! Update 2021 Since the use of pylab is now strongly discouraged by matplotlib, you should instead use pyplot: from matplotlib import pyplot as plt plt.ylim(0, 100) #corresponding function for the x-axis plt.xlim(1, 1000)

matplotlib (equal unit length): with ‘equal’ aspect ratio z-axis is not equal to x- and y-

I like the above solutions, but they do have the drawback that you need to keep track of the ranges and means over all your data. This could be cumbersome if you have multiple data sets that will be plotted together. To fix this, I made use of the ax.get_[xyz]lim3d() methods and put the whole … Read more