logo
down
shadow

Remove x axis and y axis black lines with matplotlib


Remove x axis and y axis black lines with matplotlib

Content Index :

Remove x axis and y axis black lines with matplotlib
Tag : python , By : vasil
Date : November 26 2020, 03:01 PM

This might help you I am trying to remove the black lines from x axis and y axis and leave the labels (letters & numbers) but without success. I've done it for right and top side with the following code: , You can make all spines invisible:
for spine in ax.spines.values():
    spine.set_visible(False)
ax.tick_params(axis=u'both', which=u'both',length=0)

Comments
No Comments Right Now !

Boards Message :
You Must Login Or Sign Up to Add Your Comments .

Share : facebook icon twitter icon

How to totally remove x-axis (and y-axis) from the plot and also draw tangent lines at certain points using Python or R-


Tag : python , By : user130518
Date : March 29 2020, 07:55 AM
this will help I have to create a plot that has axes suppressed and tangents drawn at regular intervals as shown in figure presented below. , Using Python,
import numpy as np
import matplotlib.pyplot as plt

tau = np.arange(-5, 5, 0.01)
a = 0.4  

sigma = a*tau 
x = 1/a*np.cosh(sigma)  
y = 1/a*np.sinh(sigma)

fig, ax = plt.subplots()
ax.plot(x, y, c='black')

# approximate the curve by a cubic
dxds = np.poly1d(np.polyfit(sigma, x, 3)).deriv()
dyds = np.poly1d(np.polyfit(sigma, y, 3)).deriv()

xs, ys, dxs, dys = [], [], [], []
for s in np.linspace(-1, 1, 5):
    # evaluate the derivative at s
    dx = np.polyval(dxds, s)
    dy = np.polyval(dyds, s)

    # record the x, y location and dx, dy tangent vector associated with s
    xi = 1/a*np.cosh(s)  
    yi = 1/a*np.sinh(s)
    xs.append(xi)
    ys.append(yi)
    dxs.append(dx)
    dys.append(dy)
    if s == 0:
        ax.text(xi-0.75, yi+1.5, '$u$', transform=ax.transData) 
        ax.annotate('$a^{-1}$',
                    xy=(xi, yi), xycoords='data',
                    xytext=(25, -5), textcoords='offset points',
                    verticalalignment='top', horizontalalignment='left', 
                    arrowprops=dict(arrowstyle='-', shrinkB=7))

ax.quiver(xs, ys, dxs, dys, scale=1.8, color='black', scale_units='xy', angles='xy',
          width=0.01)
ax.plot(xs, ys, 'ko')

# http://stackoverflow.com/a/13430772/190597 (lucasg)
ax.set_xlim(-0.1, x.max())
left, right = ax.get_xlim()
low, high = ax.get_ylim()
ax.arrow(0, 0, right, 0, length_includes_head=True, head_width=0.15 )
ax.arrow(0, low, 0, high-low, length_includes_head=True, head_width=0.15 ) 
ax.text(0.03, 1, '$t$', transform=ax.transAxes)
ax.text(1, 0.47, '$x$', transform=ax.transAxes)

plt.axis('off')
ax.set_aspect('equal')
plt.show()

I want gird lines of x-axis and y-axis in highcharts but i don't want x-axis value and y-axis value


Tag : javascript , By : Janko
Date : March 29 2020, 07:55 AM
With these it helps May be this will help you.. use this logic in it..fiddler
$(function () {
    var chart = new Highcharts.Chart({
        chart: {
            renderTo: 'container',
          ignoreHiddenSeries : false
        },

        xAxis: {
        },

        series: [{
            data: [29.9, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5, 216.4, 194.1, 95.6, 54.4]        
        }, {
            data: [129.2, 144.0, 176.0, 135.6, 148.5, 216.4, 194.1, 95.6, 54.4, 29.9, 71.5, 106.4]        
        }]
    });

    // the button action
  var series = chart.series[0];    
  series.hide();
  series = chart.series[1];    
  series.hide();
});

add axis lines to matplotlib plot


Tag : python , By : Doug
Date : March 29 2020, 07:55 AM
I wish this helpful for you The easiest way to accomplish this (without the fancy arrowheads, unfortunately) would be to use axvline and axhline to draw lines at x=0 and y=0, respectively:
t = arange(-2, 2, 0.1)
y2 = exp(-t)
axhline(0,color='red') # x = 0
axvline(0,color='red') # y = 0
grid()
plot(t, y2, '-')
show()

matplotlib scatter plot with xyz axis lines through origin (0,0,0) and axis project lines to each point


Tag : python , By : Manik
Date : March 29 2020, 07:55 AM
Hope that helps Ok, so maybe there is a direct way of achieving this. If not, this code will solve the greatest part of your problem. I created a function which generates the dashed lines as needed. Use ax.quiver() to generate the coordinate system.
EDIT: You can use commands like ax.set_axis_off()to generate the image you posted.
from mpl_toolkits.mplot3d import Axes3D
import matplotlib.pyplot as plt
import numpy as np

def make_dashedLines(x,y,z,ax):
    for i in range(0, len(x)):
        x_val, y_val, z_val = x[i],y[i],z[i]
        ax.plot([0,x_val],[y_val,y_val],zs=[0,0], linestyle="dashed",color="black")
        ax.plot([x_val,x_val],[0,y_val],zs=[0,0], linestyle="dashed",color="black")
        ax.plot([x_val,x_val],[y_val,y_val],zs=[0,z_val], linestyle="dashed",color="black")

fig = plt.figure()

ax = fig.add_subplot(111, projection='3d')
x = [1,1,-1]
y = [1,-1,1]
z = [1,1,-1]

ax.scatter( x,y,z, c='r', marker='o')
make_dashedLines(x,y,z,ax)

# Make a 3D quiver plot
x, y, z = np.array([[-2,0,0],[0,-2,0],[0,0,-2]])
u, v, w = np.array([[4,0,0],[0,4,0],[0,0,4]])
ax.quiver(x,y,z,u,v,w,arrow_length_ratio=0.1, color="black")
ax.grid(False)
ax.set_xlabel('X')
ax.set_ylabel('Y')
ax.set_zlabel('Z')

ax.set_xlim(-2,2)
ax.set_ylim(-2,2)
ax.set_zlim(-2,2)

plt.show()

avoid sorting in X axis in matplotlib and plot common X axis with multiple y axis


Tag : python , By : amorican
Date : March 29 2020, 07:55 AM
will be helpful for those in need I wish to clarify two queries in this post. , Try to draw the series/dataframe against the index:
col_to_draw = [col for col in df.columns if col!='col0']

# if your data frame is indexed as 0,1,2,... ignore this step
tmp_df = df.reset_index()

ax = tmp_df[col_to_draw].plot(figsize=(10,6))
xtick_vals = ax.get_xticks()
ax.set_xticklabels(tmp_df.col0[xtick_vals].tolist())
Related Posts Related QUESTIONS :
  • Tensorflow Estimator API save image summary in eval mode
  • How to Pack with PyQt - how to make QFrame/Layout adapt to content
  • How do I get certain Time Range in Python
  • python doubly linked list - insertAfter node
  • Open .h5 file in Python
  • Joining a directory name with a binary file name
  • python, sort list with two arguments in compare function
  • Is it possible to print from Python using non-ANSI colors?
  • Pandas concat historical data using date minus some number of days
  • CV2: Import Error in Python OpenCV
  • Is it possible to do this loop in a one-liner?
  • invalid literal for int() with base 10: - django
  • Why does my code print a value that I have not assigned as yet?
  • the collatz func in automate boring stuff with python
  • How to find all possible combinations of parameters and funtions
  • about backpropagation deep neural network in tensorflow
  • Sort strings in pandas
  • How do access my flask app hosted in docker?
  • Replace the sentence include some text with Python regex
  • Counting the most common element in a 2D List in Python
  • logout a user from the system using a function in python
  • mp4 metadata not found but exists
  • Django: QuerySet with ExpressionWrapper
  • Pandas string search in list of dicts
  • Decryption from RSA encrypted string from sqlite is not the same
  • need of maximum value in int
  • a list of several tuples, how to extract the same of the first two elements in the small tuple in the large tuple
  • Display image of 2D Sinewaves in 3D
  • how to prevent a for loop from overwriting a dictionary?
  • How To Fix: RuntimeError: size mismatch in pyTorch
  • Concatenating two Pandas DataFrames while maintaining index order
  • Why does this not run into an infinite loop?
  • Python Multithreading no current event loop
  • Element Tree - Seaching for specific element value without looping
  • Ignore Nulls in pandas map dictionary
  • How do I get scrap data from web pages using beautifulsoup in python
  • Variable used, golobal or local?
  • I have a regex statement to pull all numbers out of a text file, but it only finds 77 out of the 81 numbers in the file
  • How do I create a dataframe of jobs and companies that includes hyperlinks?
  • Detect if user has clicked the 'maximized' button
  • Does flask_login automatically set the "next" argument?
  • Indents in python 3
  • How to create a pool of threads
  • Pandas giving IndexError on one dataframe but not on another similar dataframe
  • Django Rest Framework - Testing client.login doesn't login user, ret anonymous user
  • Running dag without dag file in airflow
  • Filling across a specified dimension of a numpy array
  • Python populating dataframe in pandas from text files
  • How to interpolate a single ("non-piecewise") cubic spline from a set of data points?
  • Divide 2 integers (leetcode 29) - recursion issue
  • Can someone explain why do I get this output in Python?
  • How do I scrape pdf and html from search results without obvious url
  • Is there a way to automatically make a "collage" of plots with matplotlib?
  • How to combine multiple rows in pandas with shared column values
  • How do I get LOAD_CLASSDEREF instruction after dis.dis?
  • Django - How to add items to Bootstrap dropdown?
  • Linear Regression - Does the below implementation of ridge regression finding coefficient term using gradient method is
  • How to drop all rows in pandas dataframe with negative values?
  • Most Efficient Way to Find Closest Date Between 2 Dataframes
  • Execution error when Passing arguments to a python script using os.system. The script takes sys.argv arguments
  • shadow
    Privacy Policy - Terms - Contact Us © scrbit.com