Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4546236
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T15:55:37+00:00 2026-05-21T15:55:37+00:00

How can I make plots in MATLAB like in below? I won’t need labels,

  • 0

How can I make plots in MATLAB like in below? 1D plot example

I won’t need labels, so you can ignore them. I tried using normal 2D plot, by giving 0 to y parameter for each data points. It does help, but most of the plot remains empty/white and I don’t want that. 1d plot in 2d figure

How can I solve this problem?

Edit:

This is how I plot(playing with values of ylim does not help):

hold on
for i=1:120
    if genders(v_labels(i)) == CLASS_WOMAN
        plot(v_images_lda(i,:) * w_lda,0,'r*');
    else
        plot(v_images_lda(i,:) * w_lda,0,'b.');
    end
end
title('LDA 1D Plot');
ylim([-0.2 0.2]);
hold off
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T15:55:38+00:00Added an answer on May 21, 2026 at 3:55 pm

    Here’s one way to reproduce your figure using dsxy2figxy and annotate. dsxy2figxy can be hard to find the first time, as it is not really in your path. It is part of the MATLAB package and is provided in the example functions. You can reach it by searching for it in the help docs and once you find it, open it and save it to a folder in your path.

    h1=figure(1);clf
    subplot(4,1,1);
    hold on
    xlim([0.2,1]);ylim([-1,1])
    
    %arrow
    [arrowX,arrowY]=dsxy2figxy([0.2,1],[0,0]);
    annotation('arrow',arrowX,arrowY)
    
    %crosses
    x=[0.3,0.4,0.6,0.7,0.75];
    plot(x,0,'kx','markersize',10)
    
    %pipes
    p=[0.5,0.65];
    text(p,[0,0],'$$\vert$$','interpreter','latex')
    
    %text
    text([0.25,0.5,0.65],[1,-1,-1]/2,{'$$d_i$$','E[d]','$$\theta$$'},'interpreter','latex')
    
    axis off
    print('-depsc','arrowFigure')
    

    This will produce the following figure:

    enter image description here

    This is sort of a hackish way to do it, as I’ve tricked MATLAB into printing just one subplot. All rasterized formats (jpeg, png, etc) will not give you the same result, as they’ll all print the entire figure including where the non-declared subplots should’ve been. So to get this effect, it has to be an eps, and it works with it because eps uses much tighter bounding boxes… so all the meaningless whitespace is trimmed. You can then convert this to any other format you want.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using MATLAB to plot some data. I would like to create the legend
I can make a DAO recordset in VB6/Access do anything - add data, clean
I can make Firefox not display the ugly dotted focus outlines on links with
How can make a link within a facebox window that redirects it to another
I can make a single row IKImageBrowserView by setting the [imageBrowser setContentResizingMask:NSViewWidthSizable]; but in
Can someone tell me how I can make a table be 100% height in
Can someone tell me how I can make the following output? I have a
In C# you can make a block inside of a method that is not
so that you can make your program concurrent easily in the future.
I know that I can make a setter that checks to see if a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.