PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Monday, June 27, 2022

[FIXED] How can I show only the legend in MATLAB

 June 27, 2022     charts, graph, latex, matlab     No comments   

Issue

I want to show only the legend for a group of data in MATLAB.

The reason I want to do this is that I want to export the legend to .eps, but I only want the legend, not the plots.

Is there a way to turn off the plots and remove them from the figure, but still show just the legend centered?


Solution

I think that you need to "hide" the elements you don't want in your plot, leaving out only the legend. For example,

clear all; close all;
figure;
p1 = plot([1:10], [1:10], '+-');
hold on;
p2 = plot([1:10], [1:10]+2, 'o--');

legend('text1', 'text2');


set(p1, 'visible', 'off');
set(p2, 'visible', 'off');
set(gca, 'visible', 'off');

enter image description here



Answered By - Marcin
Answer Checked By - Dawn Plyler (PHPFixing Volunteer)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing