How to create major and minor gridlines with different linestyles

Actually, it is as simple as setting major and minor separately: In [9]: plot([23, 456, 676, 89, 906, 34, 2345]) Out[9]: [<matplotlib.lines.Line2D at 0x6112f90>] In [10]: yscale(‘log’) In [11]: grid(b=True, which=”major”, color=”b”, linestyle=”-“) In [12]: grid(b=True, which=”minor”, color=”r”, linestyle=”–“) The gotcha with minor grids is that you have to have minor tick marks turned on … Read more

Add minor gridlines

Wound up combining CT Zhu’s answer with tcaswell’s hint: import numpy as np import matplotlib as mpl import matplotlib.pyplot as plt import seaborn as sbn x = np.linspace(0, 2 * np.pi, 100) y = np.sin(x) fig, ax = plt.subplots(1, 1) ax.scatter(x, y) ax.get_xaxis().set_minor_locator(mpl.ticker.AutoMinorLocator()) ax.get_yaxis().set_minor_locator(mpl.ticker.AutoMinorLocator()) ax.grid(b=True, which=”major”, color=”w”, linewidth=1.0) ax.grid(b=True, which=”minor”, color=”w”, linewidth=0.5)

wpf gridlines – changing style

It depends on the look you are going for. In WPF, there are different ways to do almost anything. Here are a couple of the easier ones. The easiest way is to set ShowGridlines=”True”: <Grid HorizontalAlignment=”Stretch” VerticalAlignment=”Stretch” Margin=”5″ ShowGridLines=”True”> <Grid.ColumnDefinitions> <ColumnDefinition Width=”*” /> <ColumnDefinition Width=”*” /> </Grid.ColumnDefinitions> <Grid.RowDefinitions> <RowDefinition Height=”*” /> <RowDefinition Height=”*” /> </Grid.RowDefinitions> … Read more