
Our figure is looking better, but there are a few new and potentially tricky aspects of the above code that we will need to review.įirst, notice that we’ve used a new function, float when specifying the maximum of the x axis.
Edit plot in veusz manual#
val = True # veusz requires the manual tick locations to be specified as a list of # decimals, whereas we currently have them as a numpy array x_axis. val = "Count" # veusz can be picky about its numbers - here, we get Python to convert the # result of the max function to a decimal (called a float) x_axis. SetData ( "bin_counts", bin_counts ) bar. Add ( "graph", autoadd = False ) x_axis = graph. poisson ( lam = 4, size = n_samples ) bin_counts = np. Import veusz.embed import numpy as np n_samples = 100 samples = np. We can implement such changes as follows: The tick marks pointing upwards might interfere with our ability to see low values, so let’s point them downwards instead.There is not much to be gained by having the additional axis at the top of the figure, so let’s remove it.There is enough space to include all the major tick labels, so let’s add them.The minor ticks don’t add much, so let’s remove them.The maximum value on the axis could be increased a bit to accommodate the bar at the largest bin.The minimum value on the axis could be reduced a bit to accommodate the bar at 0.Looking at the above, there are a few changes that could be useful in improving the clarity of the figure:

Now let’s make some changes to the x axis.
