Skip to content

Missing top axis boundary and tick mark #214

Open
@nt229

Description

@nt229

Hi, I have the following code (from #192 ) for plotting a truncated ternary, which works well, except there is no boundary line on the top of the plot, and the tick mark at 50 on the left hand axis is missing, and the one on the right hand axis is thinner than the others?

I can force a fix for the issue regarding the missing boundary (plotting two points and drawing a line between them), which incidentally can also be used to fix the thin tick mark (by simply extending the line). (see the commented out part with line, line1 etc).

There must be a better way to fix these small-ish issues, that I'm just completely missing? It could be somewhere in #198 and I'm just missing it. Thanks

figure, tax = ternary.figure (scale = 100)

tax.boundary(linewidth=1)
tax.gridlines(c="black", multiple = 10, alpha = 0.3)

ycut_cartesian = np.sqrt(3)/2 * 50
limits = {'b':(0,110,10), 'r':(0,60,10), 'l':(50,110,10)} # limits = {which_axis:(minimum_limit, maximum_limit, step_size)}


#line = (53, 50, 0)
#line1 = (0, 50, 50)
#tax.line(line, line1, linewidth = 2, color = 'black', linestyle = "-", zorder = 0)

tax.scatter(mil03346, marker = 'o', s = 7, c = "yellowgreen", zorder = 2, label = "MIL 03346",linewidth = 0.1, edgecolors = "white")
tax.scatter(mil090030, marker = 'o', s = 7, c = "greenyellow", zorder = 2,linewidth = 0.1, edgecolors = "white")
tax.scatter(mil090032, marker = 'o', s = 7, c = "green", zorder = 2,linewidth = 0.1, edgecolors = "white")
tax.scatter(mil090136, marker = 'o', s = 7, c = "limegreen", zorder = 2,linewidth = 0.1, edgecolors = "white")
tax.scatter(nwa5790, marker = '^', s = 7, c = "black", zorder = 2,linewidth = 0.1, edgecolors = "white")
tax.scatter(nwa817, marker = 's', s = 7, c = "black", zorder = 2, linewidth = 0.1, edgecolors = "white")
tax.scatter(yamato, marker = 'D', s = 7, c = "black", zorder = 2, linewidth = 0.1, edgecolors = "white")
tax.scatter(nakhla, marker = 'X', s = 7, c = "black", zorder = 2, linewidth = 0.1, edgecolors = "white")
tax.scatter(gov_val, marker = 'v', s = 7, c = "black", zorder = 2, linewidth = 0.1, edgecolors = "white")
tax.scatter(laf, marker = '^', s = 7, c = "bisque", zorder = 2, linewidth = 0.1, edgecolors = "black")
tax.scatter(nwa998, marker = 's', s = 7, color = "bisque", zorder = 2, linewidth = 0.1, edgecolors = "black")

tax.legend(loc = "upper right", fontsize = 4, handletextpad = 0.05, markerscale = 1, fancybox = False, frameon=False)
tax.get_axes().axis('off')
tax.set_background_color(color = "white", alpha = 0.0)

tax.top_corner_label("Olivine", fontsize = 5, offset = 0.2)
tax.right_corner_label("Pyroxene", fontsize = 5, offset=0.01, )
tax.left_corner_label("Mesostasis", fontsize = 5, offset=0.01)

tax.get_axes().set_ylim(ymax = ycut_cartesian)
ManualTicks(tax, limits)
tax.get_axes().set_aspect(1) #sets as equilateral triangle, needs to be the last step of plotting
tax._redraw_labels() #see above

ternary.plt.show()
plt.savefig(fpath+'Truncated Nakhlite Modal Abundances.png', format = 'png', dpi = 400, bbox_inches = 'tight')

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions